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

[YouTube] Use new browse API for continuation page extraction. #131

Merged
merged 6 commits into from
Mar 3, 2021
Merged

[YouTube] Use new browse API for continuation page extraction. #131

merged 6 commits into from
Mar 3, 2021

Conversation

coletdjnz
Copy link
Member

@coletdjnz coletdjnz commented Mar 3, 2021

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.

YouTube appears to be abandoning the old 'browse_ajax' API for the new POST front-end API. This is evident with the rise in 404 related errors during playlist downloads. ytdl-org/youtube-dl#28289 ytdl-org/youtube-dl#28327 ytdl-org/youtube-dl#28324

This PR is a hot fix to use this new API when getting the next page using the continuation token. I have not thoroughly tested this so more work may need to be done.

@coletdjnz coletdjnz changed the title [YouTube] Use new front-end API for continuation page extraction. [YouTube] Use new front-end POST API for continuation page extraction. Mar 3, 2021
@coletdjnz coletdjnz changed the title [YouTube] Use new front-end POST API for continuation page extraction. [YouTube] Use new browse API for continuation page extraction. Mar 3, 2021
@coletdjnz
Copy link
Member Author

Has been fixed upstream now: ytdl-org/youtube-dl@061c030

@pukkandan pukkandan marked this pull request as ready for review March 3, 2021 05:31
yt_dlp/extractor/youtube.py Outdated Show resolved Hide resolved
yt_dlp/extractor/youtube.py Outdated Show resolved Hide resolved
@pukkandan pukkandan merged commit a5c5623 into yt-dlp:master Mar 3, 2021
@jbruchon
Copy link
Contributor

jbruchon commented Mar 3, 2021

This fixed a massive 404 problem I've been having (so far). Thanks a lot for this fix.

nixxo referenced this pull request in nixxo/yt-dlp Nov 22, 2021
Known issues (these issues existed in previous API as well)
* Mix playlists only give 1 page (25 vids)
* Trending only gives 1 video
* History gives 5 pages (200 vids)

Co-authored-by: colethedj, pukkandan
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

4 participants