hbmartin commited on
Commit
5f5543f
·
1 Parent(s): 25329a0

fix akamaized cipher regex, note attribute filtering in readme

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. pytube/cipher.py +1 -1
README.md CHANGED
@@ -193,7 +193,7 @@ If you need to optimize for a specific feature, such as the "highest resolution"
193
  ```python
194
  >>> yt.streams.filter(progressive=True).order_by('resolution').desc().all()
195
  ```
196
- Note that ``order_by`` cannot be used if your attribute is undefined in any of the Stream instances, so be sure to apply a filter to remove those before calling it.
197
 
198
  ### Callbacks
199
 
 
193
  ```python
194
  >>> yt.streams.filter(progressive=True).order_by('resolution').desc().all()
195
  ```
196
+ Note: Using ``order_by`` on a given attribute will filter out all streams missing that attribute.
197
 
198
  ### Callbacks
199
 
pytube/cipher.py CHANGED
@@ -41,7 +41,7 @@ def get_initial_function_name(js):
41
  r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', # noqa: E501
42
  r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',
43
  r"\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(",
44
- r"yt\.akamaized\.net/\)\s*\|\|\s*.*?\s*[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?:encodeURIComponent\s*\()?\s*(?P<si$", # noqa: E501
45
  r"\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
46
  r"\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
47
  r"\bc\s*&&\s*a\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
 
41
  r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', # noqa: E501
42
  r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(',
43
  r"\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(",
44
+ r'yt\.akamaized\.net/\)\s*\|\|\s*.*?\s*[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?:encodeURIComponent\s*\()?\s*(?P<sig>[a-zA-Z0-9$]+)\(', # noqa: E501
45
  r"\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
46
  r"\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501
47
  r"\bc\s*&&\s*a\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(", # noqa: E501