Skip to content

Commit

Permalink
[FIX] - Changed RegEx string to fix throtteling error of Pytube in RE…
Browse files Browse the repository at this point in the history
  • Loading branch information
Quasolaris authored Aug 28, 2024
1 parent 5a000e0 commit 9267b5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If no update was published or the error still persists, follow these steps:
4. Paste the following regex beneath the lines you just commented out (Make sure the white spaces are correct, it is Python after all):
```python
r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&.*?\|\|\s*([a-z]+)',
r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])?\([a-z]\)',
r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])\([a-z]\)',
```
5. Now go to line 290 (or 288 if you deleted the regex lines instead of commenting them out) with CTRL+_ in nano you can jump to a specific line.
6. Comment the following line out:
Expand All @@ -121,7 +121,7 @@ function_patterns = [
#r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&\s*'
#r'\([a-z]\s*=\s*([a-zA-Z0-9$]{3})(\[\d+\])?\([a-z]\)',
r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&.*?\|\|\s*([a-z]+)',
r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])?\([a-z]\)',
r'\([a-z]\s*=\s*([a-zA-Z0-9$]+)(\[\d+\])\([a-z]\)',
]
logger.debug('Finding throttling function name')
for pattern in function_patterns:
Expand Down

2 comments on commit 9267b5d

@RobinHirst11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't work

@Quasolaris
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobinHirst11
Works on my site, but I do not know what YouTube is changing on their API.
I sadly can only recommend to search on the few Pytube Repos/Forums and find some other RegEx that maybe can solve it on your system.

Please sign in to comment.