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] Fix automatic captions not found #27388

Closed
wants to merge 2 commits into from

Conversation

RogerRordo
Copy link

@RogerRordo RogerRordo commented Dec 12, 2020

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

Related to #27315

The structure of ytplayer.config has changed, and it can no longer be explicitly obtained from the webpage. So the function _get_ytplayer_config used for getting automatic captions is no longer valid.

In the latest format of youtube webpage, the url of auto-captions is explicitly stored in ytInitialPlayerResponse, which is exactly the parameter player_response we pass in the edited function _get_automatic_captions. And the original code can handle such structures.

You can check with:

youtube-dl --write-auto-sub --skip-download https://www.youtube.com/watch?v=3lMUIUgRD-A

@denizveizov
Copy link

Hi, RogerRordo,

How to I edit the youtube_dl/extractor/youtube.py file, I have installed the youtube-dl with .exe file and cannot locate the youtube_dl/extractor/youtube.py?

Thanks in advance

@RogerRordo
Copy link
Author

Hi, RogerRordo,

How to I edit the youtube_dl/extractor/youtube.py file, I have installed the youtube-dl with .exe file and cannot locate the youtube_dl/extractor/youtube.py?

Thanks in advance

Use pip rather than executable file

@iNoSec2
Copy link

iNoSec2 commented Dec 17, 2020

i hope they will merge this ASAP, thanks a lot for contrib!!!

@zxl777
Copy link

zxl777 commented Dec 23, 2020

The bug is still there. - Couldn't find automatic captions

youtube-dl --write-auto-sub --sub-lang en --skip-download "https://www.youtube.com/watch?v=GWGbOjlJDkU"
[youtube] GWGbOjlJDkU: Downloading webpage
[youtube] GWGbOjlJDkU: Looking for automatic captions
WARNING: Couldn't find automatic captions for GWGbOjlJDkU

image

@ytdl-org ytdl-org locked and limited conversation to collaborators Dec 23, 2020
ThirumalaiK pushed a commit to ThirumalaiK/youtube-dl that referenced this pull request Jan 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants