Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Kallbrig
Copy link

@Kallbrig Kallbrig commented Aug 2, 2020

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.

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.
@flashblaze
Copy link
Owner

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.

@SeifESlimene
Copy link

SeifESlimene commented Sep 2, 2021

@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).

Copy link

@SeifESlimene SeifESlimene left a 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(',', '')))

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants