family-guy
commited on
Commit
·
702408d
1
Parent(s):
b746f0a
Update regex
Browse files- pytube/cipher.py +4 -2
pytube/cipher.py
CHANGED
@@ -37,9 +37,11 @@ def get_initial_function_name(js):
|
|
37 |
# c&&d.set("signature", EE(c));
|
38 |
pattern = [
|
39 |
r'yt\.akamaized\.net/\)\s*\|\|\s*'
|
40 |
-
r'.*?\s*c\s*&&\s*d\.set\([^,]+\s*,\s*(
|
|
|
41 |
r'\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(',
|
42 |
-
r'\bc\s*&&\s*d\.set\([^,]+\s*,\s*(
|
|
|
43 |
]
|
44 |
logger.debug('finding initial function name')
|
45 |
return regex_search(pattern, js, group=1)
|
|
|
37 |
# c&&d.set("signature", EE(c));
|
38 |
pattern = [
|
39 |
r'yt\.akamaized\.net/\)\s*\|\|\s*'
|
40 |
+
r'.*?\s*c\s*&&\s*d\.set\([^,]+\s*,\s*(?:encodeURIComponent'
|
41 |
+
r'\s*\()?(?P<sig>[a-zA-Z0-9$]+)\(',
|
42 |
r'\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(',
|
43 |
+
r'\bc\s*&&\s*d\.set\([^,]+\s*,\s*(?:encodeURIComponent'
|
44 |
+
r'\s*\()?(?P<sig>[a-zA-Z0-9$]+)\(',
|
45 |
]
|
46 |
logger.debug('finding initial function name')
|
47 |
return regex_search(pattern, js, group=1)
|