Skip to content

Commit

Permalink
Update cipher.py
Browse files Browse the repository at this point in the history
Fix sigfunc name extraction; based on ytdl-org/youtube-dl@e450f6c
  • Loading branch information
kpister committed Jul 28, 2020
1 parent d8d96e3 commit f35b948
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytube/cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def get_initial_function_name(js: str) -> str:
function_patterns = [
r"\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
r"\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
r'\b(?P<sig>[a-zA-Z0-9$]{2})\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', # noqa: E501
r'(?:\b|[^a-zA-Z0-9$])(?P<sig>[a-zA-Z0-9$]{2})\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', # noqa: E501
r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', # noqa: E501
r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',
r"\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(",
Expand Down

0 comments on commit f35b948

Please sign in to comment.