Previous commit replaced it with shorts-filtering, use sort code
number 4 for that instead. Sort by oldest is still broken
pending reverse engineering of new ctoken format, however.
This will be much less likely to break moving forward since
YouTube rarely changes the playlist api
Videos page now includes shorts and streams in the video lsit
Also include an option to filter out shorts on the videos page
Add channel tabs to the channel template and script
Update continuation token to request different tabs
Add support for 'reelItemRenderer' format required to extract shorts
Ensures channel profile picture & description are displayed
Also ensures that videos added to a local playlist from such pages
will have the channel name included
Fixes#151
get_channel_first_page was mistakenly used when the sorting
or view is different. Must use channel_tab which generates
the necessary ctokens.
Signed-off-by: Jesús <heckyel@hyperbola.info>
YouTube disabled the browse_ajax endpoint. Quick fix for first
channel page. In general, this will be more robust against api
endpoint changes. As YouTube continues to change api endpoints,
at least the subscriptions and first page will no longer break.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Use extract_str function since it's not always 'simpleText'
Make sure we don't output an empty error message if we don't
know what it is.
channel.py: Don't check if error message is empty, check if it's
None
These occur when too many requests are coming from a Tor exit node.
Before, there would be an error page with an exception instructing users to report the issue.
But this is an expected and persistent issue.
It was set to a fake value of 1000 previously in order to ensure there would be enough page buttons.
This was because two sequential requests are necessary (one to get the channel id corresponding to the custom url, another to get the number of videos from the "all uploaded videos" playlist, the url for which can be generated from the channel id).
Since Tor has a high latency, I thought at the time that this would be too slow, but in practice it's not too big of a deal.
Introduces cachetools dependency in order to cache the function which gets the number of videos.
The get_channel_id function has also been fixed since the ajax api seems to have been removed.
Deduplicates the code. channel_id logic was previously separate because of the need to get the number of videos and different page numbers
Also makes search work for general urls, not just channel_id urls