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
Fixed the Description bug #1863
base: master
Are you sure you want to change the base?
Conversation
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.
Why get rid of getting data from vid_info
altogether? It should at least be used as a fallback.
Also, not really fond of doing requests inside a property getter. It should be a separate function/method, and I also think it should be called as a fallback if nothing is found in vid_info
.
pytube/__main__.py
Outdated
ind1 = page_detail.index(''.join(match1)) + 19 | ||
ind2 = page_detail.index(''.join(match2)) - 3 |
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.
What are these magic numbers?
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.
Initially, I considered creating another request and then retrieving the description from the HTML. However, I discovered that "self.watch_html" also contains the description between "Shortdescription" and "iscrawlable." Therefore, I utilized a regex to find their indexes and return anything in between them, which constitutes the description. The addition and subtraction of 3 is for removing the colon and double quotes to get the text only.
The latest commit "Removed Internal request for Description - 2" consist of all the changes i mentioned
Using vid_info wouldn't be useful as it doesn't contain relevant information regarding the description. |
Any Update?? |
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.
Looks good to me
Waiting for it to get merged then. |
Since the video info was not returning anything related to description, I created another http get request to fetch the description using regex.