-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update yts_downloader.py #2
base: master
Are you sure you want to change the base?
Conversation
On slower connections a 7 sec timeout is a very low threshold . I increased to 45. My 2020 MBP on 100/100 Mbps wifi was taking 25 seconds every time. Also yts.am html has changed. They wrapped the value you're trying to get in <b> tags. I updated line 23 to get the value needed. it was getting '<b>18' and then trying to convert that to int.
Thanks a lot for the PR. I'll need some time to approve the changes as I haven't touched the project in a year. I also need to check whether the package is working in the current condition or not. |
@flashblaze Actually the issue I was posted is the same that @Kallbrig talking about here (I mean the b tag stuff...) also another feature should be implemented (I talk about it in detail in the issue). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check!
Thanks.
except requests.Timeout: | ||
print('Request timeout') | ||
else: | ||
|
||
soup = BeautifulSoup(r.text, 'html.parser') | ||
h2 = soup.find_all('h2') | ||
movie_count = int((str(h2)[5:11].replace(',', ''))) | ||
movie_count = int((str(h2)[8:13].replace(',', ''))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
movie_count = int((str(h2)[8:14].replace(',', '')))
Be careful it's 8:14 not 8:13.
On slower connections a 7 sec timeout is a very low threshold . I increased to 45. My 2020 MBP on 100/100 Mbps wifi was taking 25 seconds every time.
Also yts.am html has changed. They wrapped the value you're trying to get in bold tags. I updated line 23 to get the value needed. it was getting the first <b tag and the first 2 values of the number (<\b >18 ) and then trying to convert that to int.