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 get_video_info token not found #23331

Closed
ssikyou opened this issue Dec 6, 2019 · 0 comments
Closed

Youtube get_video_info token not found #23331

ssikyou opened this issue Dec 6, 2019 · 0 comments

Comments

@ssikyou
Copy link

@ssikyou ssikyou commented Dec 6, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.11.28
  • 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

root@localhost:~# youtube-dl -s -4 -v --print-traffic bk7613_9Ymg
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-s', '-4', '-v', '--print-traffic', 'bk7613_9Ymg']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 3.5.2 (CPython) - Linux-4.4.0-141-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] bk7613_9Ymg: Downloading webpage
send: b'GET /watch?hl=en&disable_polymer=true&bpctr=9999999999&has_verified=1&gl=US&v=bk7613_9Ymg HTTP/1.1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.9 Safari/537.36\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
[youtube] bk7613_9Ymg: Downloading video info webpage
header: Strict-Transport-Security header: Content-Encoding header: P3P header: Cache-Control header: X-Content-Type-Options header: X-Frame-Options header: Expires header: Content-Type header: Date header: Server header: X-XSS-Protection header: Set-Cookie header: Set-Cookie header: Set-Cookie header: Set-Cookie header: Alt-Svc header: Connection header: Transfer-Encoding send: b'GET /get_video_info?hl=en&eurl=&video_id=bk7613_9Ymg&disable_polymer=true&el=embedded&ps=default&gl=US HTTP/1.1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.9 Safari/537.36\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en; YSC=T5rDAyaoNzU; s_gl=1d69aac621b2f9c0a25dade722d6e24bcwIAAABVUw==; GPS=1; VISITOR_INFO1_LIVE=yZD9bUvLd-Q\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Expires header: P3P header: Content-Type header: Cache-Control header: Strict-Transport-Security header: X-Content-Type-Options header: X-Frame-Options header: Content-Encoding header: Date header: Server header: X-XSS-Protection header: Alt-Svc header: Connection header: Transfer-Encoding send: b'GET /get_video_info?hl=en&eurl=&video_id=bk7613_9Ymg&disable_polymer=true&el=detailpage&ps=default&gl=US HTTP/1.1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.9 Safari/537.36\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en; YSC=T5rDAyaoNzU; s_gl=1d69aac621b2f9c0a25dade722d6e24bcwIAAABVUw==; GPS=1; VISITOR_INFO1_LIVE=yZD9bUvLd-Q\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type header: Strict-Transport-Security header: P3P header: X-Frame-Options header: Expires header: X-Content-Type-Options header: Content-Encoding header: Cache-Control header: Date header: Server header: X-XSS-Protection header: Alt-Svc header: Connection header: Transfer-Encoding send: b'GET /get_video_info?hl=en&eurl=&video_id=bk7613_9Ymg&disable_polymer=true&el=vevo&ps=default&gl=US HTTP/1.1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.9 Safari/537.36\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en; YSC=T5rDAyaoNzU; s_gl=1d69aac621b2f9c0a25dade722d6e24bcwIAAABVUw==; GPS=1; VISITOR_INFO1_LIVE=yZD9bUvLd-Q\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Expires header: Cache-Control header: Strict-Transport-Security header: X-Frame-Options header: Content-Type header: X-Content-Type-Options header: Content-Encoding header: P3P header: Date header: Server header: X-XSS-Protection header: Alt-Svc header: Connection header: Transfer-Encoding send: b'GET /get_video_info?hl=en&eurl=&video_id=bk7613_9Ymg&disable_polymer=true&ps=default&gl=US HTTP/1.1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.9 Safari/537.36\r\nHost: www.youtube.com\r\nCookie: PREF=f1=50000000&hl=en; YSC=T5rDAyaoNzU; s_gl=1d69aac621b2f9c0a25dade722d6e24bcwIAAABVUw==; GPS=1; VISITOR_INFO1_LIVE=yZD9bUvLd-Q\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
[debug] Default format spec: bestvideo+bestaudio/best
header: X-Content-Type-Options header: X-Frame-Options header: Expires header: Cache-Control header: Content-Type header: Content-Encoding header: Strict-Transport-Security header: P3P header: Date header: Server header: X-XSS-Protection header: Alt-Svc header: Connection header: Transfer-Encoding

Description

Does youtube change the get_video_info schema? It seems youtube-dl will request get_video_info four times to get the video info, is it the correct behavior?
BTW, I checked the code, it seems the "token" is not found, so a for loop is not breaked correctly.

                for el in ('embedded', 'detailpage', 'vevo', ''):
...
                    get_token = extract_token(get_video_info)
                    if get_token:
                        # Different get_video_info requests may report different results, e.g.
                        # some may report video unavailability, but some may serve it without
                        # any complaint (see https://github.com/ytdl-org/youtube-dl/issues/7362,
                        # the original webpage as well as el=info and el=embedded get_video_info
                        # requests report video unavailability due to geo restriction while
                        # el=detailpage succeeds and returns valid data). This is probably
                        # due to YouTube measures against IP ranges of hosting providers.
                        # Working around by preferring the first succeeded video_info containing
                        # the token if no such video_info yet was found.
                        token = extract_token(video_info)
                        if not token:
                            video_info = get_video_info
                        break
@ssikyou ssikyou closed this Dec 6, 2019
@PedroMSantosD PedroMSantosD mentioned this issue Dec 6, 2019
3 of 4 tasks complete
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
1 participant
You can’t perform that action at this time.