Skip to content

[Youtube] Skip v1/next requests, only need video formats #12826

Description

@leeblackc

Checklist

  • I'm requesting a site-specific feature
  • I've verified that I have updated yt-dlp to nightly or master (update instructions)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've searched the bugtracker for similar requests including closed ones. DO NOT post duplicates
  • I've read about sharing account credentials and I'm willing to share it if required

Region

No response

Example URLs

https://www.youtube.com/watch?v=OI4g4gElHG4

Provide a description that is worded well enough to be understood

Can we add an extra parameter in extractor-args to skip the v1/next request? If we only need to download the video and don't care about the extra data, this request is redundant.

Image

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

E:\>yt-dlp.exe -vU --extractor-args "youtube:player-client=tv;player_skip=webpage,configs;skip=hls,dash;visitor_data=Cgt4dkFVOE9qZEFoOCi2tLm_BjIKCgJISxIEGgAgLg%3D%3D" --print-traffic -F https://www.youtube.com/watch?v=ZD3LhA5y_c0
[debug] Command-line config: ['-vU', '--extractor-args', 'youtube:player-client=tv;player_skip=webpage,configs;skip=hls,dash;visitor_data=Cgt4dkFVOE9qZEFoOCi2tLm_BjIKCgJISxIEGgAgLg%3D%3D', '--print-traffic', '-F', 'https://www.youtube.com/watch?v=ZD3LhA5y_c0']
[debug] Encodings: locale cp936, fs utf-8, pref cp936, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.03.31 from yt-dlp/yt-dlp [5e457af57] (win_exe)
[debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1t  7 Feb 2023)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.22.0, brotli-1.1.0, certifi-2025.01.31, curl_cffi-0.10.0, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.3.0, websockets-15.0.1
[debug] Proxy map: {'http': 'http://127.0.0.1:7890', 'https': 'http://127.0.0.1:7890', 'ftp': 'http://127.0.0.1:7890'}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Plugin directories: none
[debug] Loaded 1850 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100
director: Checking if "requests" supports this request.
director: Sending request via "requests"
requests: Starting new HTTPS connection (1): api.github.com:443
send: b'CONNECT api.github.com:443 HTTP/1.0\r\n\r\n'
send: b'GET /repos/yt-dlp/yt-dlp/releases/latest HTTP/1.1\r\nHost: api.github.com\r\nConnection: keep-alive\r\nUser-Agent: yt-dlp\r\nAccept: application/vnd.github+json\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nX-Github-Api-Version: 2022-11-28\r\nAccept-Encoding: gzip, deflate, br\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Date: Thu, 03 Apr 2025 09:57:44 GMT
header: Cache-Control: public, max-age=60, s-maxage=60
header: Vary: Accept,Accept-Encoding, Accept, X-Requested-With
header: ETag: "34b28b80f0cb306e28f996a184a9ed51b79ae5c19c44b3237d5f615ff7ebe23e"
header: Last-Modified: Mon, 31 Mar 2025 22:03:20 GMT
header: x-github-api-version-selected: 2022-11-28
header: Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
header: Access-Control-Allow-Origin: *
header: Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
header: X-Frame-Options: deny
header: X-Content-Type-Options: nosniff
header: X-XSS-Protection: 0
header: Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
header: Content-Security-Policy: default-src 'none'
header: Server: github.com
header: Content-Type: application/json; charset=utf-8
header: X-GitHub-Media-Type: github.v3; format=json
header: Content-Encoding: gzip
header: Accept-Ranges: bytes
header: X-RateLimit-Limit: 60
header: X-RateLimit-Remaining: 48
header: X-RateLimit-Reset: 1743674923
header: X-RateLimit-Resource: core
header: X-RateLimit-Used: 12
header: Content-Length: 3286
header: X-GitHub-Request-Id: C209:289B00:11E7BD2:15539FA:67EE5BA3
Latest version: stable@2025.03.31 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.03.31 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=ZD3LhA5y_c0
[youtube] ZD3LhA5y_c0: Downloading iframe API JS
director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100
director: Checking if "requests" supports this request.
director: Sending request via "requests"
requests: Starting new HTTPS connection (1): www.youtube.com:443
send: b'CONNECT www.youtube.com:443 HTTP/1.0\r\n\r\n'
send: b'GET /iframe_api HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.20 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=hl=en&tz=UTC; SOCS=CAI\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: text/javascript; charset=utf-8
header: X-Content-Type-Options: nosniff
header: Expires: Thu, 03 Apr 2025 09:57:56 GMT
header: Date: Thu, 03 Apr 2025 09:57:56 GMT
header: Cache-Control: private, max-age=0
header: X-Frame-Options: SAMEORIGIN
header: Strict-Transport-Security: max-age=31536000
header: Cross-Origin-Opener-Policy-Report-Only: same-origin; report-to="youtube_main"
header: Accept-CH: Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Full-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Model, Sec-CH-UA-WoW64, Sec-CH-UA-Form-Factors, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version
header: Vary: Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Full-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Model, Sec-CH-UA-WoW64, Sec-CH-UA-Form-Factors, Sec-CH-UA-Platform, Sec-CH-UA-Platform-Version
header: Origin-Trial: AmhMBR6zCLzDDxpW+HfpP67BqwIknWnyMOXOQGfzYswFmJe+fgaI6XZgAzcxOrzNtP7hEDsOo1jdjFnVr2IdxQ4AAAB4eyJvcmlnaW4iOiJodHRwczovL3lvdXR1YmUuY29tOjQ0MyIsImZlYXR1cmUiOiJXZWJWaWV3WFJlcXVlc3RlZFdpdGhEZXByZWNhdGlvbiIsImV4cGlyeSI6MTc1ODA2NzE5OSwiaXNTdWJkb21haW4iOnRydWV9
header: Cross-Origin-Resource-Policy: cross-origin
header: Content-Security-Policy: require-trusted-types-for 'script'
header: Permissions-Policy: ch-ua-arch=*, ch-ua-bitness=*, ch-ua-full-version=*, ch-ua-full-version-list=*, ch-ua-model=*, ch-ua-wow64=*, ch-ua-form-factors=*, ch-ua-platform=*, ch-ua-platform-version=*
header: Report-To: {"group":"youtube_main","max_age":2592000,"endpoints":[{"url":"https://csp.withgoogle.com/csp/report-to/youtube_main"}]}
header: P3P: CP="This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl=en for more info."
header: Content-Encoding: br
header: Transfer-Encoding: chunked
header: Server: ESF
header: X-XSS-Protection: 0
header: Set-Cookie: YSC=feLz8pIBF6I; Domain=.youtube.com; Path=/; Secure; HttpOnly; SameSite=none; Partitioned
header: Set-Cookie: __Secure-ROLLOUT_TOKEN=COzzoNCc2r_5SxDug93uzLuMAxjug93uzLuMAw%3D%3D; Domain=youtube.com; Expires=Tue, 30-Sep-2025 09:57:56 GMT; Path=/; Secure; HttpOnly; SameSite=none; Partitioned
header: Set-Cookie: VISITOR_INFO1_LIVE=9ZVwWi5E9zg; Domain=.youtube.com; Expires=Tue, 30-Sep-2025 09:57:56 GMT; Path=/; Secure; HttpOnly; SameSite=none; Partitioned
header: Set-Cookie: VISITOR_PRIVACY_METADATA=CgJISxIEGgAgIQ%3D%3D; Domain=.youtube.com; Expires=Tue, 30-Sep-2025 09:57:56 GMT; Path=/; Secure; HttpOnly; SameSite=none; Partitioned
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[youtube] ZD3LhA5y_c0: Downloading player e63b9241-main
director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'GET /s/player/e63b9241/player_ias.vflset/en_US/base.js HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.20 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=hl=en&tz=UTC; SOCS=CAI; VISITOR_INFO1_LIVE=9ZVwWi5E9zg; VISITOR_PRIVACY_METADATA=CgJISxIEGgAgIQ%3D%3D; YSC=feLz8pIBF6I; __Secure-ROLLOUT_TOKEN=COzzoNCc2r_5SxDug93uzLuMAxjug93uzLuMAw%3D%3D\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Accept-Ranges: bytes
header: Content-Encoding: br
header: Cross-Origin-Resource-Policy: cross-origin
header: Cross-Origin-Opener-Policy-Report-Only: same-origin; report-to="youtube"
header: Report-To: {"group":"youtube","max_age":2592000,"endpoints":[{"url":"https://csp.withgoogle.com/csp/report-to/youtube"}]}
header: Content-Length: 662547
header: X-Content-Type-Options: nosniff
header: Server: sffe
header: X-XSS-Protection: 0
header: Date: Tue, 01 Apr 2025 07:21:32 GMT
header: Expires: Wed, 01 Apr 2026 07:21:32 GMT
header: Cache-Control: public, max-age=31536000
header: Last-Modified: Tue, 01 Apr 2025 04:33:54 GMT
header: Content-Type: text/javascript
header: Vary: Accept-Encoding, Origin
header: Age: 182184
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[youtube] ZD3LhA5y_c0: Downloading tv player API JSON
director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'POST /youtubei/v1/player?prettyPrint=false HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nContent-Type: application/json\r\nX-Youtube-Client-Name: 7\r\nX-Youtube-Client-Version: 7.20250312.16.00\r\nOrigin: https://www.youtube.com\r\nX-Goog-Visitor-Id: Cgt4dkFVOE9qZEFoOCi2tLm_BjIKCgJISxIEGgAgLg%3D%3D\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=hl=en&tz=UTC; SOCS=CAI; VISITOR_INFO1_LIVE=9ZVwWi5E9zg; VISITOR_PRIVACY_METADATA=CgJISxIEGgAgIQ%3D%3D; YSC=feLz8pIBF6I; __Secure-ROLLOUT_TOKEN=COzzoNCc2r_5SxDug93uzLuMAxjug93uzLuMAw%3D%3D\r\nContent-Length: 396\r\n\r\n'
send: b'{"context": {"client": {"clientName": "TVHTML5", "clientVersion": "7.20250312.16.00", "userAgent": "Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version", "hl": "en", "timeZone": "UTC", "utcOffsetMinutes": 0}}, "videoId": "ZD3LhA5y_c0", "playbackContext": {"contentPlaybackContext": {"html5Preference": "HTML5_PREF_WANTS", "signatureTimestamp": 20179}}, "contentCheckOk": true, "racyCheckOk": true}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json; charset=UTF-8
header: Vary: Origin
header: Vary: X-Origin
header: Vary: Referer
header: Content-Encoding: br
header: Date: Thu, 03 Apr 2025 09:57:56 GMT
header: Server: scaffolding on HTTPServer2
header: Content-Length: 9784
header: X-XSS-Protection: 0
header: X-Frame-Options: SAMEORIGIN
header: X-Content-Type-Options: nosniff
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
[debug] [youtube] Extracting signature function e63b9241-main-111
[debug] Loading youtube-sigfuncs.e63b9241-main-111 from cache
[debug] Loading youtube-nsig.e63b9241-main from cache
[debug] [youtube] Decrypted nsig 6e_PRLA8STtrgn => S5Vt0T1GXOpraA
[debug] [youtube] Decrypted nsig kPj7NWK2HDGLpU => OlOCHHdf7tLM5w
[debug] [youtube] Extracting signature function e63b9241-main-107
[debug] Loading youtube-sigfuncs.e63b9241-main-107 from cache
[youtube] ZD3LhA5y_c0: Downloading initial data API JSON
director: Handler preferences for this request: urllib=0, requests=100, websockets=0, curl_cffi=-100
director: Checking if "requests" supports this request.
director: Sending request via "requests"
send: b'POST /youtubei/v1/next?prettyPrint=false HTTP/1.1\r\nHost: www.youtube.com\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.20 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-us,en;q=0.5\r\nSec-Fetch-Mode: navigate\r\nContent-Type: application/json\r\nX-Youtube-Client-Name: 1\r\nX-Youtube-Client-Version: 2.20250312.04.00\r\nOrigin: https://www.youtube.com\r\nX-Goog-Visitor-Id: Cgt4dkFVOE9qZEFoOCi2tLm_BjIKCgJISxIEGgAgLg%3D%3D\r\nAccept-Encoding: gzip, deflate, br\r\nCookie: PREF=hl=en&tz=UTC; SOCS=CAI; VISITOR_INFO1_LIVE=9ZVwWi5E9zg; VISITOR_PRIVACY_METADATA=CgJISxIEGgAgIQ%3D%3D; YSC=feLz8pIBF6I; __Secure-ROLLOUT_TOKEN=COzzoNCc2r_5SxDug93uzLuMAxjug93uzLuMAw%3D%3D\r\nContent-Length: 208\r\n\r\n'
send: b'{"context": {"client": {"clientName": "WEB", "clientVersion": "2.20250312.04.00", "hl": "en", "timeZone": "UTC", "utcOffsetMinutes": 0}}, "videoId": "ZD3LhA5y_c0", "contentCheckOk": true, "racyCheckOk": true}'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: application/json; charset=UTF-8
header: Vary: Origin
header: Vary: X-Origin
header: Vary: Referer
header: Content-Encoding: br
header: Date: Thu, 03 Apr 2025 09:57:58 GMT
header: Server: scaffolding on HTTPServer2
header: Content-Length: 39816
header: X-XSS-Protection: 0
header: X-Frame-Options: SAMEORIGIN
header: X-Content-Type-Options: nosniff
header: Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
WARNING: Extractor failed to obtain "title". Creating a generic title instead
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec, channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[info] Available formats for ZD3LhA5y_c0:
ID  EXT   RESOLUTION FPS CH │   FILESIZE  TBR PROTO │ VCODEC         VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27        0    │                 mhtml │ images                                 storyboard
sb1 mhtml 80x45        1    │                 mhtml │ images                                 storyboard
sb0 mhtml 160x90       1    │                 mhtml │ images                                 storyboard
249 webm  audio only      2 │    1.64MiB  52k https │ audio only         opus        52k 48k low, TV, webm_dash
250 webm  audio only      2 │    2.17MiB  69k https │ audio only         opus        69k 48k low, TV, webm_dash
140 m4a   audio only      2 │    4.07MiB 129k https │ audio only         mp4a.40.2  129k 44k medium, TV, m4a_dash
251 webm  audio only      2 │    4.24MiB 135k https │ audio only         opus       135k 48k medium, TV, webm_dash
160 mp4   256x144     30    │  383.90KiB  12k https │ avc1.4d400c    12k video only          144p, TV, mp4_dash
278 webm  256x144     30    │  895.85KiB  28k https │ vp9            28k video only          144p, TV, webm_dash
394 mp4   256x144     30    │  544.98KiB  17k https │ av01.0.00M.08  17k video only          144p, TV, mp4_dash
133 mp4   426x240     30    │  506.98KiB  16k https │ avc1.4d4015    16k video only          240p, TV, mp4_dash
242 webm  426x240     30    │  950.97KiB  30k https │ vp9            30k video only          240p, TV, webm_dash
395 mp4   426x240     30    │  614.27KiB  19k https │ av01.0.00M.08  19k video only          240p, TV, mp4_dash
134 mp4   640x360     30    │  725.23KiB  23k https │ avc1.4d401e    23k video only          360p, TV, mp4_dash
18  mp4   640x360     30  2 │    5.00MiB 159k https │ avc1.42001E        mp4a.40.2       44k 360p, TV
243 webm  640x360     30    │    1.16MiB  37k https │ vp9            37k video only          360p, TV, webm_dash
396 mp4   640x360     30    │  758.26KiB  24k https │ av01.0.01M.08  24k video only          360p, TV, mp4_dash
135 mp4   854x480     30    │  932.17KiB  29k https │ avc1.4d401f    29k video only          480p, TV, mp4_dash
244 webm  854x480     30    │    1.41MiB  45k https │ vp9            45k video only          480p, TV, webm_dash
397 mp4   854x480     30    │    1.03MiB  33k https │ av01.0.04M.08  33k video only          480p, TV, mp4_dash
136 mp4   1280x720    30    │    1.36MiB  43k https │ avc1.4d401f    43k video only          720p, TV, mp4_dash
247 webm  1280x720    30    │    1.96MiB  62k https │ vp9            62k video only          720p, TV, webm_dash
398 mp4   1280x720    30    │    2.21MiB  70k https │ av01.0.05M.08  70k video only          720p, TV, mp4_dash
137 mp4   1920x1080   30    │    3.44MiB 109k https │ avc1.640028   109k video only          1080p, TV, mp4_dash
248 webm  1920x1080   30    │    3.27MiB 104k https │ vp9           104k video only          1080p, TV, webm_dash
399 mp4   1920x1080   30    │    3.85MiB 123k https │ av01.0.08M.08 123k video only          1080p, TV, mp4_dash

Activity

  1. coletdjnz commented on Apr 4, 2025

    @coletdjnz
    Member

    This should be fine to add. But note this would cause metadata extraction to fail in a lot of cases (including the title in your example).

    It would be for advanced users and testing, and we would not be able to guarantee stable extraction (same as with the other extractor args).

    low-priority to implement (maintainers are busy with other yt stuff atm). PR is welcome

  2. added
    PR-neededFeatures that maintainers will not work on; but PRs are welcome
    gateway-issueA good issue for new devs! (No AI allowed!)
    and removed
    triageUntriaged issue
    on Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR-neededFeatures that maintainers will not work on; but PRs are welcomegateway-issueA good issue for new devs! (No AI allowed!)site-enhancementFeature request for some websitesite:youtube

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions