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 has closed captions url for each language #24323

Closed
sebaro opened this issue Mar 11, 2020 · 0 comments
Closed

YouTube has closed captions url for each language #24323

sebaro opened this issue Mar 11, 2020 · 0 comments
Labels

Comments

@sebaro
Copy link

@sebaro sebaro commented Mar 11, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[youtube] fJ9rUzIMcZQ: Looking for automatic captions
[info] Writing video subtitles to: Queen – Bohemian Rhapsody (Official Video Remastered)-fJ9rUzIMcZQ.ro.vtt
send: b'GET /api/timedtext?v=fJ9rUzIMcZQ&xorp=true&hl=en&ip=0.0.0.0&ipbits=0&expire=1583947243&sparams=ip%2Cipbits%2Cexpire%2Cv%2Cxorp&signature=31A25893551B51525DE37B94CA9536A7583485DD.415413D23C633FEFAB036FA9C96C0F1DB7C2FECD&key=yt8&lang=ar&tlang=ro&fmt=vtt HTTP/1.1\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en; s_gl=1d69aac621b2f9c0a25dade722d6e24bcwIAAABVUw==; YSC=gGwmULRgjnE; VISITOR_INFO1_LIVE=rkNlx8Rw4LU\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3667.1 Safari/537.36\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,/*;q=0.8\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'

Description

YouTube now has an cc url for each language:

"captionTracks":[{"baseUrl":"https://www.youtube.com/api/timedtext?v=fJ9rUzIMcZQ\u0026xorp=true\u0026hl=en\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=1583948462\u0026sparams=ip,ipbits,expire,v,xorp\u0026signature=72B2059E51E420A1D99DB46F7019E78087406721.536C4092C7C97466EF1B463F0D3AA8C6EDB12458\u0026key=yt8\u0026lang=ar","name":{"simpleText":"Arabic"},"vssId":".ar","languageCode":"ar","rtl":true,"isTranslatable":true},{"baseUrl":"https://www.youtube.com/api/timedtext?v=fJ9rUzIMcZQ\u0026xorp=true\u0026hl=en\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=1583948462\u0026sparams=ip,ipbits,expire,v,xorp\u0026signature=72B2059E51E420A1D99DB46F7019E78087406721.536C4092C7C97466EF1B463F0D3AA8C6EDB12458\u0026key=yt8\u0026lang=zh-Hans","name":{"simpleText":"Chinese (Simplified)"},"vssId":".zh-Hans","languageCode":"zh-Hans","isTranslatable":true},{"baseUrl":"https://www.youtube.com/api/timedtext?v=fJ9rUzIMcZQ\u0026xorp=true\u0026hl=en\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=1583948462\u0026sparams=ip,ipbits,expire,v,xorp\u0026signature=72B2059E51E420A1D99DB46F7019E78087406721.536C4092C7C97466EF1B463F0D3AA8C6EDB12458\u0026key=yt8\u0026lang=zh-Hant","name":{"simpleText":"Chinese (Traditional)"},"vssId":".zh-Hant","languageCode":"zh-Hant","isTranslatable":true},{"baseUrl":"https://www.youtube.com/api/timedtext?v=fJ9rUzIMcZQ\u0026xorp=true\u0026hl=en\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=1583948462\u0026sparams=ip,ipbits,expire,v,xorp\u0026signature=72B2059E51E420A1D99DB46F7019E78087406721.536C4092C7C97466EF1B463F0D3AA8C6EDB12458\u0026key=yt8\u0026lang=cs","name":{"simpleText":"Czech"},"vssId":".cs","languageCode":"cs","isTranslatable":true},{"baseUrl":"https://www.youtube.com/api/timedtext?

Appending "tlang=" will translate from the language in the first cc url (Arabic) into the language from "--sub-lang" argument.

lang=ar&tlang=ro
@dstftw dstftw closed this Mar 11, 2020
@dstftw dstftw added the out-of-scope label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.