logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

yt-dlp.1 (152520B)


  1. .\"t
  2. .\" Automatically generated by Pandoc 2.9.2.1
  3. .\"
  4. .TH "yt-dlp" "1" "" "" ""
  5. .hy
  6. .SH NAME
  7. .PP
  8. yt-dlp - A feature-rich command-line audio/video downloader
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]yt-dlp\f[R] [OPTIONS] URL [URL...]
  12. .SH DESCRIPTION
  13. .PP
  14. yt-dlp is a feature-rich command-line audio/video downloader with
  15. support for thousands of sites.
  16. The project is a fork of
  17. youtube-dl (https://github.com/ytdl-org/youtube-dl) based on the now
  18. inactive youtube-dlc (https://github.com/blackjack4494/yt-dlc).
  19. .SH OPTIONS
  20. .SS General Options:
  21. .TP
  22. -h, --help
  23. Print this help text and exit
  24. .TP
  25. --version
  26. Print program version and exit
  27. .TP
  28. -U, --update
  29. Update this program to the latest version
  30. .TP
  31. --no-update
  32. Do not check for updates (default)
  33. .TP
  34. --update-to \f[I][CHANNEL]\[at][TAG]\f[R]
  35. Upgrade/downgrade to a specific version.
  36. CHANNEL can be a repository as well.
  37. CHANNEL and TAG default to \[dq]stable\[dq] and \[dq]latest\[dq]
  38. respectively if omitted; See \[dq]UPDATE\[dq] for details.
  39. Supported channels: stable, nightly, master
  40. .TP
  41. -i, --ignore-errors
  42. Ignore download and postprocessing errors.
  43. The download will be considered successful even if the postprocessing
  44. fails
  45. .TP
  46. --no-abort-on-error
  47. Continue with next video on download errors; e.g.
  48. to skip unavailable videos in a playlist (default)
  49. .TP
  50. --abort-on-error
  51. Abort downloading of further videos if an error occurs (Alias:
  52. --no-ignore-errors)
  53. .TP
  54. --dump-user-agent
  55. Display the current user-agent and exit
  56. .TP
  57. --list-extractors
  58. List all supported extractors and exit
  59. .TP
  60. --extractor-descriptions
  61. Output descriptions of all supported extractors and exit
  62. .TP
  63. --use-extractors \f[I]NAMES\f[R]
  64. Extractor names to use separated by commas.
  65. You can also use regexes, \[dq]all\[dq], \[dq]default\[dq] and
  66. \[dq]end\[dq] (end URL matching); e.g.
  67. --ies \[dq]holodex.*,end,youtube\[dq].
  68. Prefix the name with a \[dq]-\[dq] to exclude it, e.g.
  69. --ies default,-generic.
  70. Use --list-extractors for a list of extractor names.
  71. (Alias: --ies)
  72. .TP
  73. --default-search \f[I]PREFIX\f[R]
  74. Use this prefix for unqualified URLs.
  75. E.g.
  76. \[dq]gvsearch2:python\[dq] downloads two videos from google videos for
  77. the search term \[dq]python\[dq].
  78. Use the value \[dq]auto\[dq] to let yt-dlp guess (\[dq]auto_warning\[dq]
  79. to emit a warning when guessing).
  80. \[dq]error\[dq] just throws an error.
  81. The default value \[dq]fixup_error\[dq] repairs broken URLs, but emits
  82. an error if this is not possible instead of searching
  83. .TP
  84. --ignore-config
  85. Don\[aq]t load any more configuration files except those given to
  86. --config-locations.
  87. For backward compatibility, if this option is found inside the system
  88. configuration file, the user configuration is not loaded.
  89. (Alias: --no-config)
  90. .TP
  91. --no-config-locations
  92. Do not load any custom configuration files (default).
  93. When given inside a configuration file, ignore all previous
  94. --config-locations defined in the current file
  95. .TP
  96. --config-locations \f[I]PATH\f[R]
  97. Location of the main configuration file; either the path to the config
  98. or its containing directory (\[dq]-\[dq] for stdin).
  99. Can be used multiple times and inside other configuration files
  100. .TP
  101. --plugin-dirs \f[I]PATH\f[R]
  102. Path to an additional directory to search for plugins.
  103. This option can be used multiple times to add multiple directories.
  104. Note that this currently only works for extractor plugins; postprocessor
  105. plugins can only be loaded from the default plugin directories
  106. .TP
  107. --flat-playlist
  108. Do not extract a playlist\[aq]s URL result entries; some entry metadata
  109. may be missing and downloading may be bypassed
  110. .TP
  111. --no-flat-playlist
  112. Fully extract the videos of a playlist (default)
  113. .TP
  114. --live-from-start
  115. Download livestreams from the start.
  116. Currently only supported for YouTube (Experimental)
  117. .TP
  118. --no-live-from-start
  119. Download livestreams from the current time (default)
  120. .TP
  121. --wait-for-video \f[I]MIN[-MAX]\f[R]
  122. Wait for scheduled streams to become available.
  123. Pass the minimum number of seconds (or range) to wait between retries
  124. .TP
  125. --no-wait-for-video
  126. Do not wait for scheduled streams (default)
  127. .TP
  128. --mark-watched
  129. Mark videos watched (even with --simulate)
  130. .TP
  131. --no-mark-watched
  132. Do not mark videos watched (default)
  133. .TP
  134. --color \f[I][STREAM:]POLICY\f[R]
  135. Whether to emit color codes in output, optionally prefixed by the STREAM
  136. (stdout or stderr) to apply the setting to.
  137. Can be one of \[dq]always\[dq], \[dq]auto\[dq] (default),
  138. \[dq]never\[dq], or \[dq]no_color\[dq] (use non color terminal
  139. sequences).
  140. Use \[dq]auto-tty\[dq] or \[dq]no_color-tty\[dq] to decide based on
  141. terminal support only.
  142. Can be used multiple times
  143. .TP
  144. --compat-options \f[I]OPTS\f[R]
  145. Options that can help keep compatibility with youtube-dl or youtube-dlc
  146. configurations by reverting some of the changes made in yt-dlp.
  147. See \[dq]Differences in default behavior\[dq] for details
  148. .TP
  149. --alias \f[I]ALIASES OPTIONS\f[R]
  150. Create aliases for an option string.
  151. Unless an alias starts with a dash \[dq]-\[dq], it is prefixed with
  152. \[dq]--\[dq].
  153. Arguments are parsed according to the Python string formatting
  154. mini-language.
  155. E.g.
  156. --alias get-audio,-X \[dq]-S=aext:{0},abr -x --audio-format {0}\[dq]
  157. creates options \[dq]--get-audio\[dq] and \[dq]-X\[dq] that takes an
  158. argument (ARG0) and expands to \[dq]-S=aext:ARG0,abr -x --audio-format
  159. ARG0\[dq].
  160. All defined aliases are listed in the --help output.
  161. Alias options can trigger more aliases; so be careful to avoid defining
  162. recursive options.
  163. As a safety measure, each alias may be triggered a maximum of 100 times.
  164. This option can be used multiple times
  165. .SS Network Options:
  166. .TP
  167. --proxy \f[I]URL\f[R]
  168. Use the specified HTTP/HTTPS/SOCKS proxy.
  169. To enable SOCKS proxy, specify a proper scheme, e.g.
  170. socks5://user:pass\[at]127.0.0.1:1080/.
  171. Pass in an empty string (--proxy \[dq]\[dq]) for direct connection
  172. .TP
  173. --socket-timeout \f[I]SECONDS\f[R]
  174. Time to wait before giving up, in seconds
  175. .TP
  176. --source-address \f[I]IP\f[R]
  177. Client-side IP address to bind to
  178. .TP
  179. --impersonate \f[I]CLIENT[:OS]\f[R]
  180. Client to impersonate for requests.
  181. E.g.
  182. chrome, chrome-110, chrome:windows-10.
  183. Pass --impersonate=\[dq]\[dq] to impersonate any client.
  184. Note that forcing impersonation for all requests may have a detrimental
  185. impact on download speed and stability
  186. .TP
  187. --list-impersonate-targets
  188. List available clients to impersonate.
  189. .TP
  190. -4, --force-ipv4
  191. Make all connections via IPv4
  192. .TP
  193. -6, --force-ipv6
  194. Make all connections via IPv6
  195. .TP
  196. --enable-file-urls
  197. Enable file:// URLs.
  198. This is disabled by default for security reasons.
  199. .SS Geo-restriction:
  200. .TP
  201. --geo-verification-proxy \f[I]URL\f[R]
  202. Use this proxy to verify the IP address for some geo-restricted sites.
  203. The default proxy specified by --proxy (or none, if the option is not
  204. present) is used for the actual downloading
  205. .TP
  206. --xff \f[I]VALUE\f[R]
  207. How to fake X-Forwarded-For HTTP header to try bypassing geographic
  208. restriction.
  209. One of \[dq]default\[dq] (only when known to be useful),
  210. \[dq]never\[dq], an IP block in CIDR notation, or a two-letter ISO
  211. 3166-2 country code
  212. .SS Video Selection:
  213. .TP
  214. -I, --playlist-items \f[I]ITEM_SPEC\f[R]
  215. Comma separated playlist_index of the items to download.
  216. You can specify a range using \[dq][START]:[STOP][:STEP]\[dq].
  217. For backward compatibility, START-STOP is also supported.
  218. Use negative indices to count from the right and negative STEP to
  219. download in reverse order.
  220. E.g.
  221. \[dq]-I 1:3,7,-5::2\[dq] used on a playlist of size 15 will download the
  222. items at index 1,2,3,7,11,13,15
  223. .TP
  224. --min-filesize \f[I]SIZE\f[R]
  225. Abort download if filesize is smaller than SIZE, e.g.
  226. 50k or 44.6M
  227. .TP
  228. --max-filesize \f[I]SIZE\f[R]
  229. Abort download if filesize is larger than SIZE, e.g.
  230. 50k or 44.6M
  231. .TP
  232. --date \f[I]DATE\f[R]
  233. Download only videos uploaded on this date.
  234. The date can be \[dq]YYYYMMDD\[dq] or in the format
  235. [now|today|yesterday][-N[day|week|month|year]].
  236. E.g.
  237. \[dq]--date today-2weeks\[dq] downloads only videos uploaded on the same
  238. day two weeks ago
  239. .TP
  240. --datebefore \f[I]DATE\f[R]
  241. Download only videos uploaded on or before this date.
  242. The date formats accepted are the same as --date
  243. .TP
  244. --dateafter \f[I]DATE\f[R]
  245. Download only videos uploaded on or after this date.
  246. The date formats accepted are the same as --date
  247. .TP
  248. --match-filters \f[I]FILTER\f[R]
  249. Generic video filter.
  250. Any \[dq]OUTPUT TEMPLATE\[dq] field can be compared with a number or a
  251. string using the operators defined in \[dq]Filtering Formats\[dq].
  252. You can also simply specify a field to match if the field is present,
  253. use \[dq]!field\[dq] to check if the field is not present, and
  254. \[dq]&\[dq] to check multiple conditions.
  255. Use a \[dq]\[dq] to escape \[dq]&\[dq] or quotes if needed.
  256. If used multiple times, the filter matches if at least one of the
  257. conditions is met.
  258. E.g.
  259. --match-filters !is_live --match-filters \[dq]like_count>?100 &
  260. description\[ti]=\[aq](?i)& dogs\[dq] matches only videos that are not
  261. live OR those that have a like count more than 100 (or the like field is
  262. not available) and also has a description that contains the phrase
  263. \[dq]cats & dogs\[dq] (caseless).
  264. Use \[dq]--match-filters -\[dq] to interactively ask whether to download
  265. each video
  266. .TP
  267. --no-match-filters
  268. Do not use any --match-filters (default)
  269. .TP
  270. --break-match-filters \f[I]FILTER\f[R]
  271. Same as \[dq]--match-filters\[dq] but stops the download process when a
  272. video is rejected
  273. .TP
  274. --no-break-match-filters
  275. Do not use any --break-match-filters (default)
  276. .TP
  277. --no-playlist
  278. Download only the video, if the URL refers to a video and a playlist
  279. .TP
  280. --yes-playlist
  281. Download the playlist, if the URL refers to a video and a playlist
  282. .TP
  283. --age-limit \f[I]YEARS\f[R]
  284. Download only videos suitable for the given age
  285. .TP
  286. --download-archive \f[I]FILE\f[R]
  287. Download only videos not listed in the archive file.
  288. Record the IDs of all downloaded videos in it
  289. .TP
  290. --no-download-archive
  291. Do not use archive file (default)
  292. .TP
  293. --max-downloads \f[I]NUMBER\f[R]
  294. Abort after downloading NUMBER files
  295. .TP
  296. --break-on-existing
  297. Stop the download process when encountering a file that is in the
  298. archive supplied with the --download-archive option
  299. .TP
  300. --no-break-on-existing
  301. Do not stop the download process when encountering a file that is in the
  302. archive (default)
  303. .TP
  304. --break-per-input
  305. Alters --max-downloads, --break-on-existing, --break-match-filters, and
  306. autonumber to reset per input URL
  307. .TP
  308. --no-break-per-input
  309. --break-on-existing and similar options terminates the entire download
  310. queue
  311. .TP
  312. --skip-playlist-after-errors \f[I]N\f[R]
  313. Number of allowed failures until the rest of the playlist is skipped
  314. .SS Download Options:
  315. .TP
  316. -N, --concurrent-fragments \f[I]N\f[R]
  317. Number of fragments of a dash/hlsnative video that should be downloaded
  318. concurrently (default is 1)
  319. .TP
  320. -r, --limit-rate \f[I]RATE\f[R]
  321. Maximum download rate in bytes per second, e.g.
  322. 50K or 4.2M
  323. .TP
  324. --throttled-rate \f[I]RATE\f[R]
  325. Minimum download rate in bytes per second below which throttling is
  326. assumed and the video data is re-extracted, e.g.
  327. 100K
  328. .TP
  329. -R, --retries \f[I]RETRIES\f[R]
  330. Number of retries (default is 10), or \[dq]infinite\[dq]
  331. .TP
  332. --file-access-retries \f[I]RETRIES\f[R]
  333. Number of times to retry on file access error (default is 3), or
  334. \[dq]infinite\[dq]
  335. .TP
  336. --fragment-retries \f[I]RETRIES\f[R]
  337. Number of retries for a fragment (default is 10), or \[dq]infinite\[dq]
  338. (DASH, hlsnative and ISM)
  339. .TP
  340. --retry-sleep \f[I][TYPE:]EXPR\f[R]
  341. Time to sleep between retries in seconds (optionally) prefixed by the
  342. type of retry (http (default), fragment, file_access, extractor) to
  343. apply the sleep to.
  344. EXPR can be a number, linear=START[:END[:STEP=1]] or
  345. exp=START[:END[:BASE=2]].
  346. This option can be used multiple times to set the sleep for the
  347. different retry types, e.g.
  348. --retry-sleep linear=1::2 --retry-sleep fragment:exp=1:20
  349. .TP
  350. --skip-unavailable-fragments
  351. Skip unavailable fragments for DASH, hlsnative and ISM downloads
  352. (default) (Alias: --no-abort-on-unavailable-fragments)
  353. .TP
  354. --abort-on-unavailable-fragments
  355. Abort download if a fragment is unavailable (Alias:
  356. --no-skip-unavailable-fragments)
  357. .TP
  358. --keep-fragments
  359. Keep downloaded fragments on disk after downloading is finished
  360. .TP
  361. --no-keep-fragments
  362. Delete downloaded fragments after downloading is finished (default)
  363. .TP
  364. --buffer-size \f[I]SIZE\f[R]
  365. Size of download buffer, e.g.
  366. 1024 or 16K (default is 1024)
  367. .TP
  368. --resize-buffer
  369. The buffer size is automatically resized from an initial value of
  370. --buffer-size (default)
  371. .TP
  372. --no-resize-buffer
  373. Do not automatically adjust the buffer size
  374. .TP
  375. --http-chunk-size \f[I]SIZE\f[R]
  376. Size of a chunk for chunk-based HTTP downloading, e.g.
  377. 10485760 or 10M (default is disabled).
  378. May be useful for bypassing bandwidth throttling imposed by a webserver
  379. (experimental)
  380. .TP
  381. --playlist-random
  382. Download playlist videos in random order
  383. .TP
  384. --lazy-playlist
  385. Process entries in the playlist as they are received.
  386. This disables n_entries, --playlist-random and --playlist-reverse
  387. .TP
  388. --no-lazy-playlist
  389. Process videos in the playlist only after the entire playlist is parsed
  390. (default)
  391. .TP
  392. --xattr-set-filesize
  393. Set file xattribute ytdl.filesize with expected file size
  394. .TP
  395. --hls-use-mpegts
  396. Use the mpegts container for HLS videos; allowing some players to play
  397. the video while downloading, and reducing the chance of file corruption
  398. if download is interrupted.
  399. This is enabled by default for live streams
  400. .TP
  401. --no-hls-use-mpegts
  402. Do not use the mpegts container for HLS videos.
  403. This is default when not downloading live streams
  404. .TP
  405. --download-sections \f[I]REGEX\f[R]
  406. Download only chapters that match the regular expression.
  407. A \[dq]*\[dq] prefix denotes time-range instead of chapter.
  408. Negative timestamps are calculated from the end.
  409. \[dq]*from-url\[dq] can be used to download between the
  410. \[dq]start_time\[dq] and \[dq]end_time\[dq] extracted from the URL.
  411. Needs ffmpeg.
  412. This option can be used multiple times to download multiple sections,
  413. e.g.
  414. --download-sections \[dq]*10:15-inf\[dq] --download-sections
  415. \[dq]intro\[dq]
  416. .TP
  417. --downloader \f[I][PROTO:]NAME\f[R]
  418. Name or path of the external downloader to use (optionally) prefixed by
  419. the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for.
  420. Currently supports native, aria2c, avconv, axel, curl, ffmpeg, httpie,
  421. wget.
  422. You can use this option multiple times to set different downloaders for
  423. different protocols.
  424. E.g.
  425. --downloader aria2c --downloader \[dq]dash,m3u8:native\[dq] will use
  426. aria2c for http/ftp downloads, and the native downloader for dash/m3u8
  427. downloads (Alias: --external-downloader)
  428. .TP
  429. --downloader-args \f[I]NAME:ARGS\f[R]
  430. Give these arguments to the external downloader.
  431. Specify the downloader name and the arguments separated by a colon
  432. \[dq]:\[dq].
  433. For ffmpeg, arguments can be passed to different positions using the
  434. same syntax as --postprocessor-args.
  435. You can use this option multiple times to give different arguments to
  436. different downloaders (Alias: --external-downloader-args)
  437. .SS Filesystem Options:
  438. .TP
  439. -a, --batch-file \f[I]FILE\f[R]
  440. File containing URLs to download (\[dq]-\[dq] for stdin), one URL per
  441. line.
  442. Lines starting with \[dq]#\[dq], \[dq];\[dq] or \[dq]]\[dq] are
  443. considered as comments and ignored
  444. .TP
  445. --no-batch-file
  446. Do not read URLs from batch file (default)
  447. .TP
  448. -P, --paths \f[I][TYPES:]PATH\f[R]
  449. The paths where the files should be downloaded.
  450. Specify the type of file and the path separated by a colon \[dq]:\[dq].
  451. All the same TYPES as --output are supported.
  452. Additionally, you can also provide \[dq]home\[dq] (default) and
  453. \[dq]temp\[dq] paths.
  454. All intermediary files are first downloaded to the temp path and then
  455. the final files are moved over to the home path after download is
  456. finished.
  457. This option is ignored if --output is an absolute path
  458. .TP
  459. -o, --output \f[I][TYPES:]TEMPLATE\f[R]
  460. Output filename template; see \[dq]OUTPUT TEMPLATE\[dq] for details
  461. .TP
  462. --output-na-placeholder \f[I]TEXT\f[R]
  463. Placeholder for unavailable fields in --output (default: \[dq]NA\[dq])
  464. .TP
  465. --restrict-filenames
  466. Restrict filenames to only ASCII characters, and avoid \[dq]&\[dq] and
  467. spaces in filenames
  468. .TP
  469. --no-restrict-filenames
  470. Allow Unicode characters, \[dq]&\[dq] and spaces in filenames (default)
  471. .TP
  472. --windows-filenames
  473. Force filenames to be Windows-compatible
  474. .TP
  475. --no-windows-filenames
  476. Sanitize filenames only minimally
  477. .TP
  478. --trim-filenames \f[I]LENGTH\f[R]
  479. Limit the filename length (excluding extension) to the specified number
  480. of characters
  481. .TP
  482. -w, --no-overwrites
  483. Do not overwrite any files
  484. .TP
  485. --force-overwrites
  486. Overwrite all video and metadata files.
  487. This option includes --no-continue
  488. .TP
  489. --no-force-overwrites
  490. Do not overwrite the video, but overwrite related files (default)
  491. .TP
  492. -c, --continue
  493. Resume partially downloaded files/fragments (default)
  494. .TP
  495. --no-continue
  496. Do not resume partially downloaded fragments.
  497. If the file is not fragmented, restart download of the entire file
  498. .TP
  499. --part
  500. Use .part files instead of writing directly into output file (default)
  501. .TP
  502. --no-part
  503. Do not use .part files - write directly into output file
  504. .TP
  505. --mtime
  506. Use the Last-modified header to set the file modification time (default)
  507. .TP
  508. --no-mtime
  509. Do not use the Last-modified header to set the file modification time
  510. .TP
  511. --write-description
  512. Write video description to a .description file
  513. .TP
  514. --no-write-description
  515. Do not write video description (default)
  516. .TP
  517. --write-info-json
  518. Write video metadata to a .info.json file (this may contain personal
  519. information)
  520. .TP
  521. --no-write-info-json
  522. Do not write video metadata (default)
  523. .TP
  524. --write-playlist-metafiles
  525. Write playlist metadata in addition to the video metadata when using
  526. --write-info-json, --write-description etc.
  527. (default)
  528. .TP
  529. --no-write-playlist-metafiles
  530. Do not write playlist metadata when using --write-info-json,
  531. --write-description etc.
  532. .TP
  533. --clean-info-json
  534. Remove some internal metadata such as filenames from the infojson
  535. (default)
  536. .TP
  537. --no-clean-info-json
  538. Write all fields to the infojson
  539. .TP
  540. --write-comments
  541. Retrieve video comments to be placed in the infojson.
  542. The comments are fetched even without this option if the extraction is
  543. known to be quick (Alias: --get-comments)
  544. .TP
  545. --no-write-comments
  546. Do not retrieve video comments unless the extraction is known to be
  547. quick (Alias: --no-get-comments)
  548. .TP
  549. --load-info-json \f[I]FILE\f[R]
  550. JSON file containing the video information (created with the
  551. \[dq]--write-info-json\[dq] option)
  552. .TP
  553. --cookies \f[I]FILE\f[R]
  554. Netscape formatted file to read cookies from and dump cookie jar in
  555. .TP
  556. --no-cookies
  557. Do not read/dump cookies from/to file (default)
  558. .TP
  559. --cookies-from-browser \f[I]BROWSER[+KEYRING][:PROFILE][::CONTAINER]\f[R]
  560. The name of the browser to load cookies from.
  561. Currently supported browsers are: brave, chrome, chromium, edge,
  562. firefox, opera, safari, vivaldi, whale.
  563. Optionally, the KEYRING used for decrypting Chromium cookies on Linux,
  564. the name/path of the PROFILE to load cookies from, and the CONTAINER
  565. name (if Firefox) (\[dq]none\[dq] for no container) can be given with
  566. their respective separators.
  567. By default, all containers of the most recently accessed profile are
  568. used.
  569. Currently supported keyrings are: basictext, gnomekeyring, kwallet,
  570. kwallet5, kwallet6
  571. .TP
  572. --no-cookies-from-browser
  573. Do not load cookies from browser (default)
  574. .TP
  575. --cache-dir \f[I]DIR\f[R]
  576. Location in the filesystem where yt-dlp can store some downloaded
  577. information (such as client ids and signatures) permanently.
  578. By default ${XDG_CACHE_HOME}/yt-dlp
  579. .TP
  580. --no-cache-dir
  581. Disable filesystem caching
  582. .TP
  583. --rm-cache-dir
  584. Delete all filesystem cache files
  585. .SS Thumbnail Options:
  586. .TP
  587. --write-thumbnail
  588. Write thumbnail image to disk
  589. .TP
  590. --no-write-thumbnail
  591. Do not write thumbnail image to disk (default)
  592. .TP
  593. --write-all-thumbnails
  594. Write all thumbnail image formats to disk
  595. .TP
  596. --list-thumbnails
  597. List available thumbnails of each video.
  598. Simulate unless --no-simulate is used
  599. .SS Internet Shortcut Options:
  600. .TP
  601. --write-link
  602. Write an internet shortcut file, depending on the current platform
  603. (.url, .webloc or .desktop).
  604. The URL may be cached by the OS
  605. .TP
  606. --write-url-link
  607. Write a .url Windows internet shortcut.
  608. The OS caches the URL based on the file path
  609. .TP
  610. --write-webloc-link
  611. Write a .webloc macOS internet shortcut
  612. .TP
  613. --write-desktop-link
  614. Write a .desktop Linux internet shortcut
  615. .SS Verbosity and Simulation Options:
  616. .TP
  617. -q, --quiet
  618. Activate quiet mode.
  619. If used with --verbose, print the log to stderr
  620. .TP
  621. --no-quiet
  622. Deactivate quiet mode.
  623. (Default)
  624. .TP
  625. --no-warnings
  626. Ignore warnings
  627. .TP
  628. -s, --simulate
  629. Do not download the video and do not write anything to disk
  630. .TP
  631. --no-simulate
  632. Download the video even if printing/listing options are used
  633. .TP
  634. --ignore-no-formats-error
  635. Ignore \[dq]No video formats\[dq] error.
  636. Useful for extracting metadata even if the videos are not actually
  637. available for download (experimental)
  638. .TP
  639. --no-ignore-no-formats-error
  640. Throw error when no downloadable video formats are found (default)
  641. .TP
  642. --skip-download
  643. Do not download the video but write all related files (Alias:
  644. --no-download)
  645. .TP
  646. -O, --print \f[I][WHEN:]TEMPLATE\f[R]
  647. Field name or output template to print to screen, optionally prefixed
  648. with when to print it, separated by a \[dq]:\[dq].
  649. Supported values of \[dq]WHEN\[dq] are the same as that of
  650. --use-postprocessor (default: video).
  651. Implies --quiet.
  652. Implies --simulate unless --no-simulate or later stages of WHEN are
  653. used.
  654. This option can be used multiple times
  655. .TP
  656. --print-to-file \f[I][WHEN:]TEMPLATE FILE\f[R]
  657. Append given template to the file.
  658. The values of WHEN and TEMPLATE are the same as that of --print.
  659. FILE uses the same syntax as the output template.
  660. This option can be used multiple times
  661. .TP
  662. -j, --dump-json
  663. Quiet, but print JSON information for each video.
  664. Simulate unless --no-simulate is used.
  665. See \[dq]OUTPUT TEMPLATE\[dq] for a description of available keys
  666. .TP
  667. -J, --dump-single-json
  668. Quiet, but print JSON information for each URL or infojson passed.
  669. Simulate unless --no-simulate is used.
  670. If the URL refers to a playlist, the whole playlist information is
  671. dumped in a single line
  672. .TP
  673. --force-write-archive
  674. Force download archive entries to be written as far as no errors occur,
  675. even if -s or another simulation option is used (Alias:
  676. --force-download-archive)
  677. .TP
  678. --newline
  679. Output progress bar as new lines
  680. .TP
  681. --no-progress
  682. Do not print progress bar
  683. .TP
  684. --progress
  685. Show progress bar, even if in quiet mode
  686. .TP
  687. --console-title
  688. Display progress in console titlebar
  689. .TP
  690. --progress-template \f[I][TYPES:]TEMPLATE\f[R]
  691. Template for progress outputs, optionally prefixed with one of
  692. \[dq]download:\[dq] (default), \[dq]download-title:\[dq] (the console
  693. title), \[dq]postprocess:\[dq], or \[dq]postprocess-title:\[dq].
  694. The video\[aq]s fields are accessible under the \[dq]info\[dq] key and
  695. the progress attributes are accessible under \[dq]progress\[dq] key.
  696. E.g.
  697. --console-title --progress-template
  698. \[dq]download-title:%(info.id)s-%(progress.eta)s\[dq]
  699. .TP
  700. --progress-delta \f[I]SECONDS\f[R]
  701. Time between progress output (default: 0)
  702. .TP
  703. -v, --verbose
  704. Print various debugging information
  705. .TP
  706. --dump-pages
  707. Print downloaded pages encoded using base64 to debug problems (very
  708. verbose)
  709. .TP
  710. --write-pages
  711. Write downloaded intermediary pages to files in the current directory to
  712. debug problems
  713. .TP
  714. --print-traffic
  715. Display sent and read HTTP traffic
  716. .SS Workarounds:
  717. .TP
  718. --encoding \f[I]ENCODING\f[R]
  719. Force the specified encoding (experimental)
  720. .TP
  721. --legacy-server-connect
  722. Explicitly allow HTTPS connection to servers that do not support RFC
  723. 5746 secure renegotiation
  724. .TP
  725. --no-check-certificates
  726. Suppress HTTPS certificate validation
  727. .TP
  728. --prefer-insecure
  729. Use an unencrypted connection to retrieve information about the video
  730. (Currently supported only for YouTube)
  731. .TP
  732. --add-headers \f[I]FIELD:VALUE\f[R]
  733. Specify a custom HTTP header and its value, separated by a colon
  734. \[dq]:\[dq].
  735. You can use this option multiple times
  736. .TP
  737. --bidi-workaround
  738. Work around terminals that lack bidirectional text support.
  739. Requires bidiv or fribidi executable in PATH
  740. .TP
  741. --sleep-requests \f[I]SECONDS\f[R]
  742. Number of seconds to sleep between requests during data extraction
  743. .TP
  744. --sleep-interval \f[I]SECONDS\f[R]
  745. Number of seconds to sleep before each download.
  746. This is the minimum time to sleep when used along with
  747. --max-sleep-interval (Alias: --min-sleep-interval)
  748. .TP
  749. --max-sleep-interval \f[I]SECONDS\f[R]
  750. Maximum number of seconds to sleep.
  751. Can only be used along with --min-sleep-interval
  752. .TP
  753. --sleep-subtitles \f[I]SECONDS\f[R]
  754. Number of seconds to sleep before each subtitle download
  755. .SS Video Format Options:
  756. .TP
  757. -f, --format \f[I]FORMAT\f[R]
  758. Video format code, see \[dq]FORMAT SELECTION\[dq] for more details
  759. .TP
  760. -S, --format-sort \f[I]SORTORDER\f[R]
  761. Sort the formats by the fields given, see \[dq]Sorting Formats\[dq] for
  762. more details
  763. .TP
  764. --format-sort-force
  765. Force user specified sort order to have precedence over all fields, see
  766. \[dq]Sorting Formats\[dq] for more details (Alias: --S-force)
  767. .TP
  768. --no-format-sort-force
  769. Some fields have precedence over the user specified sort order (default)
  770. .TP
  771. --video-multistreams
  772. Allow multiple video streams to be merged into a single file
  773. .TP
  774. --no-video-multistreams
  775. Only one video stream is downloaded for each output file (default)
  776. .TP
  777. --audio-multistreams
  778. Allow multiple audio streams to be merged into a single file
  779. .TP
  780. --no-audio-multistreams
  781. Only one audio stream is downloaded for each output file (default)
  782. .TP
  783. --prefer-free-formats
  784. Prefer video formats with free containers over non-free ones of the same
  785. quality.
  786. Use with \[dq]-S ext\[dq] to strictly prefer free containers
  787. irrespective of quality
  788. .TP
  789. --no-prefer-free-formats
  790. Don\[aq]t give any special preference to free containers (default)
  791. .TP
  792. --check-formats
  793. Make sure formats are selected only from those that are actually
  794. downloadable
  795. .TP
  796. --check-all-formats
  797. Check all formats for whether they are actually downloadable
  798. .TP
  799. --no-check-formats
  800. Do not check that the formats are actually downloadable
  801. .TP
  802. -F, --list-formats
  803. List available formats of each video.
  804. Simulate unless --no-simulate is used
  805. .TP
  806. --merge-output-format \f[I]FORMAT\f[R]
  807. Containers that may be used when merging formats, separated by
  808. \[dq]/\[dq], e.g.
  809. \[dq]mp4/mkv\[dq].
  810. Ignored if no merge is required.
  811. (currently supported: avi, flv, mkv, mov, mp4, webm)
  812. .SS Subtitle Options:
  813. .TP
  814. --write-subs
  815. Write subtitle file
  816. .TP
  817. --no-write-subs
  818. Do not write subtitle file (default)
  819. .TP
  820. --write-auto-subs
  821. Write automatically generated subtitle file (Alias:
  822. --write-automatic-subs)
  823. .TP
  824. --no-write-auto-subs
  825. Do not write auto-generated subtitles (default) (Alias:
  826. --no-write-automatic-subs)
  827. .TP
  828. --list-subs
  829. List available subtitles of each video.
  830. Simulate unless --no-simulate is used
  831. .TP
  832. --sub-format \f[I]FORMAT\f[R]
  833. Subtitle format; accepts formats preference separated by \[dq]/\[dq],
  834. e.g.
  835. \[dq]srt\[dq] or \[dq]ass/srt/best\[dq]
  836. .TP
  837. --sub-langs \f[I]LANGS\f[R]
  838. Languages of the subtitles to download (can be regex) or \[dq]all\[dq]
  839. separated by commas, e.g.
  840. --sub-langs \[dq]en.*,ja\[dq] (where \[dq]en.*\[dq] is a regex pattern
  841. that matches \[dq]en\[dq] followed by 0 or more of any character).
  842. You can prefix the language code with a \[dq]-\[dq] to exclude it from
  843. the requested languages, e.g.
  844. --sub- langs all,-live_chat.
  845. Use --list-subs for a list of available language tags
  846. .SS Authentication Options:
  847. .TP
  848. -u, --username \f[I]USERNAME\f[R]
  849. Login with this account ID
  850. .TP
  851. -p, --password \f[I]PASSWORD\f[R]
  852. Account password.
  853. If this option is left out, yt-dlp will ask interactively
  854. .TP
  855. -2, --twofactor \f[I]TWOFACTOR\f[R]
  856. Two-factor authentication code
  857. .TP
  858. -n, --netrc
  859. Use .netrc authentication data
  860. .TP
  861. --netrc-location \f[I]PATH\f[R]
  862. Location of .netrc authentication data; either the path or its
  863. containing directory.
  864. Defaults to \[ti]/.netrc
  865. .TP
  866. --netrc-cmd \f[I]NETRC_CMD\f[R]
  867. Command to execute to get the credentials for an extractor.
  868. .TP
  869. --video-password \f[I]PASSWORD\f[R]
  870. Video-specific password
  871. .TP
  872. --ap-mso \f[I]MSO\f[R]
  873. Adobe Pass multiple-system operator (TV provider) identifier, use
  874. --ap-list-mso for a list of available MSOs
  875. .TP
  876. --ap-username \f[I]USERNAME\f[R]
  877. Multiple-system operator account login
  878. .TP
  879. --ap-password \f[I]PASSWORD\f[R]
  880. Multiple-system operator account password.
  881. If this option is left out, yt-dlp will ask interactively
  882. .TP
  883. --ap-list-mso
  884. List all supported multiple-system operators
  885. .TP
  886. --client-certificate \f[I]CERTFILE\f[R]
  887. Path to client certificate file in PEM format.
  888. May include the private key
  889. .TP
  890. --client-certificate-key \f[I]KEYFILE\f[R]
  891. Path to private key file for client certificate
  892. .TP
  893. --client-certificate-password \f[I]PASSWORD\f[R]
  894. Password for client certificate private key, if encrypted.
  895. If not provided, and the key is encrypted, yt-dlp will ask interactively
  896. .SS Post-Processing Options:
  897. .TP
  898. -x, --extract-audio
  899. Convert video files to audio-only files (requires ffmpeg and ffprobe)
  900. .TP
  901. --audio-format \f[I]FORMAT\f[R]
  902. Format to convert the audio to when -x is used.
  903. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus,
  904. vorbis, wav).
  905. You can specify multiple rules using similar syntax as --remux-video
  906. .TP
  907. --audio-quality \f[I]QUALITY\f[R]
  908. Specify ffmpeg audio quality to use when converting the audio with -x.
  909. Insert a value between 0 (best) and 10 (worst) for VBR or a specific
  910. bitrate like 128K (default 5)
  911. .TP
  912. --remux-video \f[I]FORMAT\f[R]
  913. Remux the video into another container if necessary (currently
  914. supported: avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac,
  915. m4a, mka, mp3, ogg, opus, vorbis, wav).
  916. If the target container does not support the video/audio codec, remuxing
  917. will fail.
  918. You can specify multiple rules; e.g.
  919. \[dq]aac>m4a/mov>mp4/mkv\[dq] will remux aac to m4a, mov to mp4 and
  920. anything else to mkv
  921. .TP
  922. --recode-video \f[I]FORMAT\f[R]
  923. Re-encode the video into another format if necessary.
  924. The syntax and supported formats are the same as --remux-video
  925. .TP
  926. --postprocessor-args \f[I]NAME:ARGS\f[R]
  927. Give these arguments to the postprocessors.
  928. Specify the postprocessor/executable name and the arguments separated by
  929. a colon \[dq]:\[dq] to give the argument to the specified
  930. postprocessor/executable.
  931. Supported PP are: Merger, ModifyChapters, SplitChapters, ExtractAudio,
  932. VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail,
  933. SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a,
  934. FixupM3u8, FixupTimestamp and FixupDuration.
  935. The supported executables are: AtomicParsley, FFmpeg and FFprobe.
  936. You can also specify \[dq]PP+EXE:ARGS\[dq] to give the arguments to the
  937. specified executable only when being used by the specified
  938. postprocessor.
  939. Additionally, for ffmpeg/ffprobe, \[dq]_i\[dq]/\[dq]_o\[dq] can be
  940. appended to the prefix optionally followed by a number to pass the
  941. argument before the specified input/output file, e.g.
  942. --ppa \[dq]Merger+ffmpeg_i1:-v quiet\[dq].
  943. You can use this option multiple times to give different arguments to
  944. different postprocessors.
  945. (Alias: --ppa)
  946. .TP
  947. -k, --keep-video
  948. Keep the intermediate video file on disk after post-processing
  949. .TP
  950. --no-keep-video
  951. Delete the intermediate video file after post-processing (default)
  952. .TP
  953. --post-overwrites
  954. Overwrite post-processed files (default)
  955. .TP
  956. --no-post-overwrites
  957. Do not overwrite post-processed files
  958. .TP
  959. --embed-subs
  960. Embed subtitles in the video (only for mp4, webm and mkv videos)
  961. .TP
  962. --no-embed-subs
  963. Do not embed subtitles (default)
  964. .TP
  965. --embed-thumbnail
  966. Embed thumbnail in the video as cover art
  967. .TP
  968. --no-embed-thumbnail
  969. Do not embed thumbnail (default)
  970. .TP
  971. --embed-metadata
  972. Embed metadata to the video file.
  973. Also embeds chapters/infojson if present unless
  974. --no-embed-chapters/--no-embed-info-json are used (Alias:
  975. --add-metadata)
  976. .TP
  977. --no-embed-metadata
  978. Do not add metadata to file (default) (Alias: --no-add-metadata)
  979. .TP
  980. --embed-chapters
  981. Add chapter markers to the video file (Alias: --add-chapters)
  982. .TP
  983. --no-embed-chapters
  984. Do not add chapter markers (default) (Alias: --no-add-chapters)
  985. .TP
  986. --embed-info-json
  987. Embed the infojson as an attachment to mkv/mka video files
  988. .TP
  989. --no-embed-info-json
  990. Do not embed the infojson as an attachment to the video file
  991. .TP
  992. --parse-metadata \f[I][WHEN:]FROM:TO\f[R]
  993. Parse additional metadata like title/artist from other fields; see
  994. \[dq]MODIFYING METADATA\[dq] for details.
  995. Supported values of \[dq]WHEN\[dq] are the same as that of
  996. --use-postprocessor (default: pre_process)
  997. .TP
  998. --replace-in-metadata \f[I][WHEN:]FIELDS REGEX REPLACE\f[R]
  999. Replace text in a metadata field using the given regex.
  1000. This option can be used multiple times.
  1001. Supported values of \[dq]WHEN\[dq] are the same as that of
  1002. --use-postprocessor (default: pre_process)
  1003. .TP
  1004. --xattrs
  1005. Write metadata to the video file\[aq]s xattrs (using Dublin Core and XDG
  1006. standards)
  1007. .TP
  1008. --concat-playlist \f[I]POLICY\f[R]
  1009. Concatenate videos in a playlist.
  1010. One of \[dq]never\[dq], \[dq]always\[dq], or \[dq]multi_video\[dq]
  1011. (default; only when the videos form a single show).
  1012. All the video files must have the same codecs and number of streams to
  1013. be concatenable.
  1014. The \[dq]pl_video:\[dq] prefix can be used with \[dq]--paths\[dq] and
  1015. \[dq]--output\[dq] to set the output filename for the concatenated
  1016. files.
  1017. See \[dq]OUTPUT TEMPLATE\[dq] for details
  1018. .TP
  1019. --fixup \f[I]POLICY\f[R]
  1020. Automatically correct known faults of the file.
  1021. One of never (do nothing), warn (only emit a warning), detect_or_warn
  1022. (the default; fix the file if we can, warn otherwise), force (try fixing
  1023. even if the file already exists)
  1024. .TP
  1025. --ffmpeg-location \f[I]PATH\f[R]
  1026. Location of the ffmpeg binary; either the path to the binary or its
  1027. containing directory
  1028. .TP
  1029. --exec \f[I][WHEN:]CMD\f[R]
  1030. Execute a command, optionally prefixed with when to execute it,
  1031. separated by a \[dq]:\[dq].
  1032. Supported values of \[dq]WHEN\[dq] are the same as that of
  1033. --use-postprocessor (default: after_move).
  1034. The same syntax as the output template can be used to pass any field as
  1035. arguments to the command.
  1036. If no fields are passed, %(filepath,_filename|)q is appended to the end
  1037. of the command.
  1038. This option can be used multiple times
  1039. .TP
  1040. --no-exec
  1041. Remove any previously defined --exec
  1042. .TP
  1043. --convert-subs \f[I]FORMAT\f[R]
  1044. Convert the subtitles to another format (currently supported: ass, lrc,
  1045. srt, vtt).
  1046. Use \[dq]--convert-subs none\[dq] to disable conversion (default)
  1047. (Alias: --convert- subtitles)
  1048. .TP
  1049. --convert-thumbnails \f[I]FORMAT\f[R]
  1050. Convert the thumbnails to another format (currently supported: jpg, png,
  1051. webp).
  1052. You can specify multiple rules using similar syntax as
  1053. \[dq]--remux-video\[dq].
  1054. Use \[dq]--convert- thumbnails none\[dq] to disable conversion (default)
  1055. .TP
  1056. --split-chapters
  1057. Split video into multiple files based on internal chapters.
  1058. The \[dq]chapter:\[dq] prefix can be used with \[dq]--paths\[dq] and
  1059. \[dq]--output\[dq] to set the output filename for the split files.
  1060. See \[dq]OUTPUT TEMPLATE\[dq] for details
  1061. .TP
  1062. --no-split-chapters
  1063. Do not split video based on chapters (default)
  1064. .TP
  1065. --remove-chapters \f[I]REGEX\f[R]
  1066. Remove chapters whose title matches the given regular expression.
  1067. The syntax is the same as --download-sections.
  1068. This option can be used multiple times
  1069. .TP
  1070. --no-remove-chapters
  1071. Do not remove any chapters from the file (default)
  1072. .TP
  1073. --force-keyframes-at-cuts
  1074. Force keyframes at cuts when downloading/splitting/removing sections.
  1075. This is slow due to needing a re-encode, but the resulting video may
  1076. have fewer artifacts around the cuts
  1077. .TP
  1078. --no-force-keyframes-at-cuts
  1079. Do not force keyframes around the chapters when cutting/splitting
  1080. (default)
  1081. .TP
  1082. --use-postprocessor \f[I]NAME[:ARGS]\f[R]
  1083. The (case-sensitive) name of plugin postprocessors to be enabled, and
  1084. (optionally) arguments to be passed to it, separated by a colon
  1085. \[dq]:\[dq].
  1086. ARGS are a semicolon \[dq];\[dq] delimited list of NAME=VALUE.
  1087. The \[dq]when\[dq] argument determines when the postprocessor is
  1088. invoked.
  1089. It can be one of \[dq]pre_process\[dq] (after video extraction),
  1090. \[dq]after_filter\[dq] (after video passes filter), \[dq]video\[dq]
  1091. (after --format; before --print/--output), \[dq]before_dl\[dq] (before
  1092. each video download), \[dq]post_process\[dq] (after each video download;
  1093. default), \[dq]after_move\[dq] (after moving the video file to its final
  1094. location), \[dq]after_video\[dq] (after downloading and processing all
  1095. formats of a video), or \[dq]playlist\[dq] (at end of playlist).
  1096. This option can be used multiple times to add different postprocessors
  1097. .SS SponsorBlock Options:
  1098. .PP
  1099. Make chapter entries for, or remove various segments (sponsor,
  1100. introductions, etc.) from downloaded YouTube videos using the
  1101. SponsorBlock API (https://sponsor.ajay.app)
  1102. .TP
  1103. --sponsorblock-mark \f[I]CATS\f[R]
  1104. SponsorBlock categories to create chapters for, separated by commas.
  1105. Available categories are sponsor, intro, outro, selfpromo, preview,
  1106. filler, interaction, music_offtopic, poi_highlight, chapter, all and
  1107. default (=all).
  1108. You can prefix the category with a \[dq]-\[dq] to exclude it.
  1109. See [1] for descriptions of the categories.
  1110. E.g.
  1111. --sponsorblock-mark all,-preview [1]
  1112. https://wiki.sponsor.ajay.app/w/Segment_Categories
  1113. .TP
  1114. --sponsorblock-remove \f[I]CATS\f[R]
  1115. SponsorBlock categories to be removed from the video file, separated by
  1116. commas.
  1117. If a category is present in both mark and remove, remove takes
  1118. precedence.
  1119. The syntax and available categories are the same as for
  1120. --sponsorblock-mark except that \[dq]default\[dq] refers to
  1121. \[dq]all,-filler\[dq] and poi_highlight, chapter are not available
  1122. .TP
  1123. --sponsorblock-chapter-title \f[I]TEMPLATE\f[R]
  1124. An output template for the title of the SponsorBlock chapters created by
  1125. --sponsorblock-mark.
  1126. The only available fields are start_time, end_time, category,
  1127. categories, name, category_names.
  1128. Defaults to \[dq][SponsorBlock]: %(category_names)l\[dq]
  1129. .TP
  1130. --no-sponsorblock
  1131. Disable both --sponsorblock-mark and --sponsorblock-remove
  1132. .TP
  1133. --sponsorblock-api \f[I]URL\f[R]
  1134. SponsorBlock API location, defaults to https://sponsor.ajay.app
  1135. .SS Extractor Options:
  1136. .TP
  1137. --extractor-retries \f[I]RETRIES\f[R]
  1138. Number of retries for known extractor errors (default is 3), or
  1139. \[dq]infinite\[dq]
  1140. .TP
  1141. --allow-dynamic-mpd
  1142. Process dynamic DASH manifests (default) (Alias:
  1143. --no-ignore-dynamic-mpd)
  1144. .TP
  1145. --ignore-dynamic-mpd
  1146. Do not process dynamic DASH manifests (Alias: --no-allow-dynamic-mpd)
  1147. .TP
  1148. --hls-split-discontinuity
  1149. Split HLS playlists to different formats at discontinuities such as ad
  1150. breaks
  1151. .TP
  1152. --no-hls-split-discontinuity
  1153. Do not split HLS playlists into different formats at discontinuities
  1154. such as ad breaks (default)
  1155. .TP
  1156. --extractor-args \f[I]IE_KEY:ARGS\f[R]
  1157. Pass ARGS arguments to the IE_KEY extractor.
  1158. See \[dq]EXTRACTOR ARGUMENTS\[dq] for details.
  1159. You can use this option multiple times to give arguments for different
  1160. extractors
  1161. .SH CONFIGURATION
  1162. .PP
  1163. You can configure yt-dlp by placing any supported command line option in
  1164. a configuration file.
  1165. The configuration is loaded from the following locations:
  1166. .IP "1." 3
  1167. \f[B]Main Configuration\f[R]:
  1168. .RS 4
  1169. .IP \[bu] 2
  1170. The file given to \f[C]--config-location\f[R]
  1171. .RE
  1172. .IP "2." 3
  1173. \f[B]Portable Configuration\f[R]: (Recommended for portable
  1174. installations)
  1175. .RS 4
  1176. .IP \[bu] 2
  1177. If using a binary, \f[C]yt-dlp.conf\f[R] in the same directory as the
  1178. binary
  1179. .IP \[bu] 2
  1180. If running from source-code, \f[C]yt-dlp.conf\f[R] in the parent
  1181. directory of \f[C]yt_dlp\f[R]
  1182. .RE
  1183. .IP "3." 3
  1184. \f[B]Home Configuration\f[R]:
  1185. .RS 4
  1186. .IP \[bu] 2
  1187. \f[C]yt-dlp.conf\f[R] in the home path given to \f[C]-P\f[R]
  1188. .IP \[bu] 2
  1189. If \f[C]-P\f[R] is not given, the current directory is searched
  1190. .RE
  1191. .IP "4." 3
  1192. \f[B]User Configuration\f[R]:
  1193. .RS 4
  1194. .IP \[bu] 2
  1195. \f[C]${XDG_CONFIG_HOME}/yt-dlp.conf\f[R]
  1196. .IP \[bu] 2
  1197. \f[C]${XDG_CONFIG_HOME}/yt-dlp/config\f[R] (recommended on Linux/macOS)
  1198. .IP \[bu] 2
  1199. \f[C]${XDG_CONFIG_HOME}/yt-dlp/config.txt\f[R]
  1200. .IP \[bu] 2
  1201. \f[C]${APPDATA}/yt-dlp.conf\f[R]
  1202. .IP \[bu] 2
  1203. \f[C]${APPDATA}/yt-dlp/config\f[R] (recommended on Windows)
  1204. .IP \[bu] 2
  1205. \f[C]${APPDATA}/yt-dlp/config.txt\f[R]
  1206. .IP \[bu] 2
  1207. \f[C]\[ti]/yt-dlp.conf\f[R]
  1208. .IP \[bu] 2
  1209. \f[C]\[ti]/yt-dlp.conf.txt\f[R]
  1210. .IP \[bu] 2
  1211. \f[C]\[ti]/.yt-dlp/config\f[R]
  1212. .IP \[bu] 2
  1213. \f[C]\[ti]/.yt-dlp/config.txt\f[R]
  1214. See also: Notes about environment variables
  1215. .RE
  1216. .IP "5." 3
  1217. \f[B]System Configuration\f[R]:
  1218. .RS 4
  1219. .IP \[bu] 2
  1220. \f[C]/etc/yt-dlp.conf\f[R]
  1221. .IP \[bu] 2
  1222. \f[C]/etc/yt-dlp/config\f[R]
  1223. .IP \[bu] 2
  1224. \f[C]/etc/yt-dlp/config.txt\f[R]
  1225. .RE
  1226. .PP
  1227. E.g.
  1228. with the following configuration file, yt-dlp will always extract the
  1229. audio, not copy the mtime, use a proxy and save all videos under
  1230. \f[C]YouTube\f[R] directory in your home directory:
  1231. .IP
  1232. .nf
  1233. \f[C]
  1234. # Lines starting with # are comments
  1235. # Always extract audio
  1236. -x
  1237. # Do not copy the mtime
  1238. --no-mtime
  1239. # Use this proxy
  1240. --proxy 127.0.0.1:3128
  1241. # Save all videos under YouTube directory in your home directory
  1242. -o \[ti]/YouTube/%(title)s.%(ext)s
  1243. \f[R]
  1244. .fi
  1245. .PP
  1246. \f[B]Note\f[R]: Options in a configuration file are just the same
  1247. options aka switches used in regular command line calls; thus there
  1248. \f[B]must be no whitespace\f[R] after \f[C]-\f[R] or \f[C]--\f[R], e.g.
  1249. \f[C]-o\f[R] or \f[C]--proxy\f[R] but not \f[C]- o\f[R] or
  1250. \f[C]-- proxy\f[R].
  1251. They must also be quoted when necessary, as if it were a UNIX shell.
  1252. .PP
  1253. You can use \f[C]--ignore-config\f[R] if you want to disable all
  1254. configuration files for a particular yt-dlp run.
  1255. If \f[C]--ignore-config\f[R] is found inside any configuration file, no
  1256. further configuration will be loaded.
  1257. For example, having the option in the portable configuration file
  1258. prevents loading of home, user, and system configurations.
  1259. Additionally, (for backward compatibility) if \f[C]--ignore-config\f[R]
  1260. is found inside the system configuration file, the user configuration is
  1261. not loaded.
  1262. .SS Configuration file encoding
  1263. .PP
  1264. The configuration files are decoded according to the UTF BOM if present,
  1265. and in the encoding from system locale otherwise.
  1266. .PP
  1267. If you want your file to be decoded differently, add
  1268. \f[C]# coding: ENCODING\f[R] to the beginning of the file (e.g.
  1269. \f[C]# coding: shift-jis\f[R]).
  1270. There must be no characters before that, even spaces or BOM.
  1271. .SS Authentication with netrc
  1272. .PP
  1273. You may also want to configure automatic credentials storage for
  1274. extractors that support authentication (by providing login and password
  1275. with \f[C]--username\f[R] and \f[C]--password\f[R]) in order not to pass
  1276. credentials as command line arguments on every yt-dlp execution and
  1277. prevent tracking plain text passwords in the shell command history.
  1278. You can achieve this using a \f[C].netrc\f[R]
  1279. file (https://stackoverflow.com/tags/.netrc/info) on a per-extractor
  1280. basis.
  1281. For that, you will need to create a \f[C].netrc\f[R] file in
  1282. \f[C]--netrc-location\f[R] and restrict permissions to read/write by
  1283. only you:
  1284. .IP
  1285. .nf
  1286. \f[C]
  1287. touch ${HOME}/.netrc
  1288. chmod a-rwx,u+rw ${HOME}/.netrc
  1289. \f[R]
  1290. .fi
  1291. .PP
  1292. After that, you can add credentials for an extractor in the following
  1293. format, where \f[I]extractor\f[R] is the name of the extractor in
  1294. lowercase:
  1295. .IP
  1296. .nf
  1297. \f[C]
  1298. machine <extractor> login <username> password <password>
  1299. \f[R]
  1300. .fi
  1301. .PP
  1302. E.g.
  1303. .IP
  1304. .nf
  1305. \f[C]
  1306. machine youtube login myaccount\[at]gmail.com password my_youtube_password
  1307. machine twitch login my_twitch_account_name password my_twitch_password
  1308. \f[R]
  1309. .fi
  1310. .PP
  1311. To activate authentication with the \f[C].netrc\f[R] file you should
  1312. pass \f[C]--netrc\f[R] to yt-dlp or place it in the configuration file.
  1313. .PP
  1314. The default location of the .netrc file is \f[C]\[ti]\f[R] (see below).
  1315. .PP
  1316. As an alternative to using the \f[C].netrc\f[R] file, which has the
  1317. disadvantage of keeping your passwords in a plain text file, you can
  1318. configure a custom shell command to provide the credentials for an
  1319. extractor.
  1320. This is done by providing the \f[C]--netrc-cmd\f[R] parameter, it shall
  1321. output the credentials in the netrc format and return \f[C]0\f[R] on
  1322. success, other values will be treated as an error.
  1323. \f[C]{}\f[R] in the command will be replaced by the name of the
  1324. extractor to make it possible to select the credentials for the right
  1325. extractor.
  1326. .PP
  1327. E.g.
  1328. To use an encrypted \f[C].netrc\f[R] file stored as
  1329. \f[C].authinfo.gpg\f[R]
  1330. .IP
  1331. .nf
  1332. \f[C]
  1333. yt-dlp --netrc-cmd \[aq]gpg --decrypt \[ti]/.authinfo.gpg\[aq] \[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]
  1334. \f[R]
  1335. .fi
  1336. .SS Notes about environment variables
  1337. .IP \[bu] 2
  1338. Environment variables are normally specified as
  1339. \f[C]${VARIABLE}\f[R]/\f[C]$VARIABLE\f[R] on UNIX and
  1340. \f[C]%VARIABLE%\f[R] on Windows; but is always shown as
  1341. \f[C]${VARIABLE}\f[R] in this documentation
  1342. .IP \[bu] 2
  1343. yt-dlp also allows using UNIX-style variables on Windows for path-like
  1344. options; e.g.
  1345. \f[C]--output\f[R], \f[C]--config-location\f[R]
  1346. .IP \[bu] 2
  1347. If unset, \f[C]${XDG_CONFIG_HOME}\f[R] defaults to
  1348. \f[C]\[ti]/.config\f[R] and \f[C]${XDG_CACHE_HOME}\f[R] to
  1349. \f[C]\[ti]/.cache\f[R]
  1350. .IP \[bu] 2
  1351. On Windows, \f[C]\[ti]\f[R] points to \f[C]${HOME}\f[R] if present; or,
  1352. \f[C]${USERPROFILE}\f[R] or \f[C]${HOMEDRIVE}${HOMEPATH}\f[R] otherwise
  1353. .IP \[bu] 2
  1354. On Windows, \f[C]${USERPROFILE}\f[R] generally points to
  1355. \f[C]C:\[rs]Users\[rs]<user name>\f[R] and \f[C]${APPDATA}\f[R] to
  1356. \f[C]${USERPROFILE}\[rs]AppData\[rs]Roaming\f[R]
  1357. .SH OUTPUT TEMPLATE
  1358. .PP
  1359. The \f[C]-o\f[R] option is used to indicate a template for the output
  1360. file names while \f[C]-P\f[R] option is used to specify the path each
  1361. type of file should be saved to.
  1362. .PP
  1363. The simplest usage of \f[C]-o\f[R] is not to set any template arguments
  1364. when downloading a single file, like in
  1365. \f[C]yt-dlp -o funny_video.flv \[dq]https://some/video\[dq]\f[R]
  1366. (hard-coding file extension like this is \f[I]not\f[R] recommended and
  1367. could break some post-processing).
  1368. .PP
  1369. It may however also contain special sequences that will be replaced when
  1370. downloading each video.
  1371. The special sequences may be formatted according to Python string
  1372. formatting
  1373. operations (https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting),
  1374. e.g.
  1375. \f[C]%(NAME)s\f[R] or \f[C]%(NAME)05d\f[R].
  1376. To clarify, that is a percent symbol followed by a name in parentheses,
  1377. followed by formatting operations.
  1378. .PP
  1379. The field names themselves (the part inside the parenthesis) can also
  1380. have some special formatting:
  1381. .IP "1." 3
  1382. \f[B]Object traversal\f[R]: The dictionaries and lists available in
  1383. metadata can be traversed by using a dot \f[C].\f[R] separator; e.g.
  1384. \f[C]%(tags.0)s\f[R], \f[C]%(subtitles.en.-1.ext)s\f[R].
  1385. You can do Python slicing with colon \f[C]:\f[R]; E.g.
  1386. \f[C]%(id.3:7)s\f[R], \f[C]%(id.6:2:-1)s\f[R],
  1387. \f[C]%(formats.:.format_id)s\f[R].
  1388. Curly braces \f[C]{}\f[R] can be used to build dictionaries with only
  1389. specific keys; e.g.
  1390. \f[C]%(formats.:.{format_id,height})#j\f[R].
  1391. An empty field name \f[C]%()s\f[R] refers to the entire infodict; e.g.
  1392. \f[C]%(.{id,title})s\f[R].
  1393. Note that all the fields that become available using this method are not
  1394. listed below.
  1395. Use \f[C]-j\f[R] to see such fields
  1396. .IP "2." 3
  1397. \f[B]Arithmetic\f[R]: Simple arithmetic can be done on numeric fields
  1398. using \f[C]+\f[R], \f[C]-\f[R] and \f[C]*\f[R].
  1399. E.g.
  1400. \f[C]%(playlist_index+10)03d\f[R],
  1401. \f[C]%(n_entries+1-playlist_index)d\f[R]
  1402. .IP "3." 3
  1403. \f[B]Date/time Formatting\f[R]: Date/time fields can be formatted
  1404. according to strftime
  1405. formatting (https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes)
  1406. by specifying it separated from the field name using a \f[C]>\f[R].
  1407. E.g.
  1408. \f[C]%(duration>%H-%M-%S)s\f[R], \f[C]%(upload_date>%Y-%m-%d)s\f[R],
  1409. \f[C]%(epoch-3600>%H-%M-%S)s\f[R]
  1410. .IP "4." 3
  1411. \f[B]Alternatives\f[R]: Alternate fields can be specified separated with
  1412. a \f[C],\f[R].
  1413. E.g.
  1414. \f[C]%(release_date>%Y,upload_date>%Y|Unknown)s\f[R]
  1415. .IP "5." 3
  1416. \f[B]Replacement\f[R]: A replacement value can be specified using a
  1417. \f[C]&\f[R] separator according to the \f[C]str.format\f[R]
  1418. mini-language (https://docs.python.org/3/library/string.html#format-specification-mini-language).
  1419. If the field is \f[I]not\f[R] empty, this replacement value will be used
  1420. instead of the actual field content.
  1421. This is done after alternate fields are considered; thus the replacement
  1422. is used if \f[I]any\f[R] of the alternative fields is \f[I]not\f[R]
  1423. empty.
  1424. E.g.
  1425. \f[C]%(chapters&has chapters|no chapters)s\f[R],
  1426. \f[C]%(title&TITLE={:>20}|NO TITLE)s\f[R]
  1427. .IP "6." 3
  1428. \f[B]Default\f[R]: A literal default value can be specified for when the
  1429. field is empty using a \f[C]|\f[R] separator.
  1430. This overrides \f[C]--output-na-placeholder\f[R].
  1431. E.g.
  1432. \f[C]%(uploader|Unknown)s\f[R]
  1433. .IP "7." 3
  1434. \f[B]More Conversions\f[R]: In addition to the normal format types
  1435. \f[C]diouxXeEfFgGcrs\f[R], yt-dlp additionally supports converting to
  1436. \f[C]B\f[R] = \f[B]B\f[R]ytes, \f[C]j\f[R] = \f[B]j\f[R]son (flag
  1437. \f[C]#\f[R] for pretty-printing, \f[C]+\f[R] for Unicode), \f[C]h\f[R] =
  1438. HTML escaping, \f[C]l\f[R] = a comma separated \f[B]l\f[R]ist (flag
  1439. \f[C]#\f[R] for \f[C]\[rs]n\f[R] newline-separated), \f[C]q\f[R] = a
  1440. string \f[B]q\f[R]uoted for the terminal (flag \f[C]#\f[R] to split a
  1441. list into different arguments), \f[C]D\f[R] = add \f[B]D\f[R]ecimal
  1442. suffixes (e.g.
  1443. 10M) (flag \f[C]#\f[R] to use 1024 as factor), and \f[C]S\f[R] =
  1444. \f[B]S\f[R]anitize as filename (flag \f[C]#\f[R] for restricted)
  1445. .IP "8." 3
  1446. \f[B]Unicode normalization\f[R]: The format type \f[C]U\f[R] can be used
  1447. for NFC Unicode
  1448. normalization (https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize).
  1449. The alternate form flag (\f[C]#\f[R]) changes the normalization to NFD
  1450. and the conversion flag \f[C]+\f[R] can be used for NFKC/NFKD
  1451. compatibility equivalence normalization.
  1452. E.g.
  1453. \f[C]%(title)+.100U\f[R] is NFKC
  1454. .PP
  1455. To summarize, the general syntax for a field is:
  1456. .IP
  1457. .nf
  1458. \f[C]
  1459. %(name[.keys][addition][>strf][,alternate][&replacement][|default])[flags][width][.precision][length]type
  1460. \f[R]
  1461. .fi
  1462. .PP
  1463. Additionally, you can set different output templates for the various
  1464. metadata files separately from the general output template by specifying
  1465. the type of file followed by the template separated by a colon
  1466. \f[C]:\f[R].
  1467. The different file types supported are \f[C]subtitle\f[R],
  1468. \f[C]thumbnail\f[R], \f[C]description\f[R], \f[C]annotation\f[R]
  1469. (deprecated), \f[C]infojson\f[R], \f[C]link\f[R],
  1470. \f[C]pl_thumbnail\f[R], \f[C]pl_description\f[R], \f[C]pl_infojson\f[R],
  1471. \f[C]chapter\f[R], \f[C]pl_video\f[R].
  1472. E.g.
  1473. \f[C]-o \[dq]%(title)s.%(ext)s\[dq] -o \[dq]thumbnail:%(title)s\[rs]%(title)s.%(ext)s\[dq]\f[R]
  1474. will put the thumbnails in a folder with the same name as the video.
  1475. If any of the templates is empty, that type of file will not be written.
  1476. E.g.
  1477. \f[C]--write-thumbnail -o \[dq]thumbnail:\[dq]\f[R] will write
  1478. thumbnails only for playlists and not for video.
  1479. .PP
  1480. .PP
  1481. \f[B]Note\f[R]: Due to post-processing (i.e.
  1482. merging etc.), the actual output filename might differ.
  1483. Use \f[C]--print after_move:filepath\f[R] to get the name after all
  1484. post-processing is complete.
  1485. .PP
  1486. The available fields are:
  1487. .IP \[bu] 2
  1488. \f[C]id\f[R] (string): Video identifier
  1489. .IP \[bu] 2
  1490. \f[C]title\f[R] (string): Video title
  1491. .IP \[bu] 2
  1492. \f[C]fulltitle\f[R] (string): Video title ignoring live timestamp and
  1493. generic title
  1494. .IP \[bu] 2
  1495. \f[C]ext\f[R] (string): Video filename extension
  1496. .IP \[bu] 2
  1497. \f[C]alt_title\f[R] (string): A secondary title of the video
  1498. .IP \[bu] 2
  1499. \f[C]description\f[R] (string): The description of the video
  1500. .IP \[bu] 2
  1501. \f[C]display_id\f[R] (string): An alternative identifier for the video
  1502. .IP \[bu] 2
  1503. \f[C]uploader\f[R] (string): Full name of the video uploader
  1504. .IP \[bu] 2
  1505. \f[C]uploader_id\f[R] (string): Nickname or id of the video uploader
  1506. .IP \[bu] 2
  1507. \f[C]uploader_url\f[R] (string): URL to the video uploader\[aq]s profile
  1508. .IP \[bu] 2
  1509. \f[C]license\f[R] (string): License name the video is licensed under
  1510. .IP \[bu] 2
  1511. \f[C]creators\f[R] (list): The creators of the video
  1512. .IP \[bu] 2
  1513. \f[C]creator\f[R] (string): The creators of the video; comma-separated
  1514. .IP \[bu] 2
  1515. \f[C]timestamp\f[R] (numeric): UNIX timestamp of the moment the video
  1516. became available
  1517. .IP \[bu] 2
  1518. \f[C]upload_date\f[R] (string): Video upload date in UTC (YYYYMMDD)
  1519. .IP \[bu] 2
  1520. \f[C]release_timestamp\f[R] (numeric): UNIX timestamp of the moment the
  1521. video was released
  1522. .IP \[bu] 2
  1523. \f[C]release_date\f[R] (string): The date (YYYYMMDD) when the video was
  1524. released in UTC
  1525. .IP \[bu] 2
  1526. \f[C]release_year\f[R] (numeric): Year (YYYY) when the video or album
  1527. was released
  1528. .IP \[bu] 2
  1529. \f[C]modified_timestamp\f[R] (numeric): UNIX timestamp of the moment the
  1530. video was last modified
  1531. .IP \[bu] 2
  1532. \f[C]modified_date\f[R] (string): The date (YYYYMMDD) when the video was
  1533. last modified in UTC
  1534. .IP \[bu] 2
  1535. \f[C]channel\f[R] (string): Full name of the channel the video is
  1536. uploaded on
  1537. .IP \[bu] 2
  1538. \f[C]channel_id\f[R] (string): Id of the channel
  1539. .IP \[bu] 2
  1540. \f[C]channel_url\f[R] (string): URL of the channel
  1541. .IP \[bu] 2
  1542. \f[C]channel_follower_count\f[R] (numeric): Number of followers of the
  1543. channel
  1544. .IP \[bu] 2
  1545. \f[C]channel_is_verified\f[R] (boolean): Whether the channel is verified
  1546. on the platform
  1547. .IP \[bu] 2
  1548. \f[C]location\f[R] (string): Physical location where the video was
  1549. filmed
  1550. .IP \[bu] 2
  1551. \f[C]duration\f[R] (numeric): Length of the video in seconds
  1552. .IP \[bu] 2
  1553. \f[C]duration_string\f[R] (string): Length of the video (HH:mm:ss)
  1554. .IP \[bu] 2
  1555. \f[C]view_count\f[R] (numeric): How many users have watched the video on
  1556. the platform
  1557. .IP \[bu] 2
  1558. \f[C]concurrent_view_count\f[R] (numeric): How many users are currently
  1559. watching the video on the platform.
  1560. .IP \[bu] 2
  1561. \f[C]like_count\f[R] (numeric): Number of positive ratings of the video
  1562. .IP \[bu] 2
  1563. \f[C]dislike_count\f[R] (numeric): Number of negative ratings of the
  1564. video
  1565. .IP \[bu] 2
  1566. \f[C]repost_count\f[R] (numeric): Number of reposts of the video
  1567. .IP \[bu] 2
  1568. \f[C]average_rating\f[R] (numeric): Average rating given by users, the
  1569. scale used depends on the webpage
  1570. .IP \[bu] 2
  1571. \f[C]comment_count\f[R] (numeric): Number of comments on the video (For
  1572. some extractors, comments are only downloaded at the end, and so this
  1573. field cannot be used)
  1574. .IP \[bu] 2
  1575. \f[C]age_limit\f[R] (numeric): Age restriction for the video (years)
  1576. .IP \[bu] 2
  1577. \f[C]live_status\f[R] (string): One of \[dq]not_live\[dq],
  1578. \[dq]is_live\[dq], \[dq]is_upcoming\[dq], \[dq]was_live\[dq],
  1579. \[dq]post_live\[dq] (was live, but VOD is not yet processed)
  1580. .IP \[bu] 2
  1581. \f[C]is_live\f[R] (boolean): Whether this video is a live stream or a
  1582. fixed-length video
  1583. .IP \[bu] 2
  1584. \f[C]was_live\f[R] (boolean): Whether this video was originally a live
  1585. stream
  1586. .IP \[bu] 2
  1587. \f[C]playable_in_embed\f[R] (string): Whether this video is allowed to
  1588. play in embedded players on other sites
  1589. .IP \[bu] 2
  1590. \f[C]availability\f[R] (string): Whether the video is \[dq]private\[dq],
  1591. \[dq]premium_only\[dq], \[dq]subscriber_only\[dq], \[dq]needs_auth\[dq],
  1592. \[dq]unlisted\[dq] or \[dq]public\[dq]
  1593. .IP \[bu] 2
  1594. \f[C]media_type\f[R] (string): The type of media as classified by the
  1595. site, e.g.
  1596. \[dq]episode\[dq], \[dq]clip\[dq], \[dq]trailer\[dq]
  1597. .IP \[bu] 2
  1598. \f[C]start_time\f[R] (numeric): Time in seconds where the reproduction
  1599. should start, as specified in the URL
  1600. .IP \[bu] 2
  1601. \f[C]end_time\f[R] (numeric): Time in seconds where the reproduction
  1602. should end, as specified in the URL
  1603. .IP \[bu] 2
  1604. \f[C]extractor\f[R] (string): Name of the extractor
  1605. .IP \[bu] 2
  1606. \f[C]extractor_key\f[R] (string): Key name of the extractor
  1607. .IP \[bu] 2
  1608. \f[C]epoch\f[R] (numeric): Unix epoch of when the information extraction
  1609. was completed
  1610. .IP \[bu] 2
  1611. \f[C]autonumber\f[R] (numeric): Number that will be increased with each
  1612. download, starting at \f[C]--autonumber-start\f[R], padded with leading
  1613. zeros to 5 digits
  1614. .IP \[bu] 2
  1615. \f[C]video_autonumber\f[R] (numeric): Number that will be increased with
  1616. each video
  1617. .IP \[bu] 2
  1618. \f[C]n_entries\f[R] (numeric): Total number of extracted items in the
  1619. playlist
  1620. .IP \[bu] 2
  1621. \f[C]playlist_id\f[R] (string): Identifier of the playlist that contains
  1622. the video
  1623. .IP \[bu] 2
  1624. \f[C]playlist_title\f[R] (string): Name of the playlist that contains
  1625. the video
  1626. .IP \[bu] 2
  1627. \f[C]playlist\f[R] (string): \f[C]playlist_title\f[R] if available or
  1628. else \f[C]playlist_id\f[R]
  1629. .IP \[bu] 2
  1630. \f[C]playlist_count\f[R] (numeric): Total number of items in the
  1631. playlist.
  1632. May not be known if entire playlist is not extracted
  1633. .IP \[bu] 2
  1634. \f[C]playlist_index\f[R] (numeric): Index of the video in the playlist
  1635. padded with leading zeros according the final index
  1636. .IP \[bu] 2
  1637. \f[C]playlist_autonumber\f[R] (numeric): Position of the video in the
  1638. playlist download queue padded with leading zeros according to the total
  1639. length of the playlist
  1640. .IP \[bu] 2
  1641. \f[C]playlist_uploader\f[R] (string): Full name of the playlist uploader
  1642. .IP \[bu] 2
  1643. \f[C]playlist_uploader_id\f[R] (string): Nickname or id of the playlist
  1644. uploader
  1645. .IP \[bu] 2
  1646. \f[C]playlist_channel\f[R] (string): Display name of the channel that
  1647. uploaded the playlist
  1648. .IP \[bu] 2
  1649. \f[C]playlist_channel_id\f[R] (string): Identifier of the channel that
  1650. uploaded the playlist
  1651. .IP \[bu] 2
  1652. \f[C]playlist_webpage_url\f[R] (string): URL of the playlist webpage
  1653. .IP \[bu] 2
  1654. \f[C]webpage_url\f[R] (string): A URL to the video webpage which, if
  1655. given to yt-dlp, should yield the same result again
  1656. .IP \[bu] 2
  1657. \f[C]webpage_url_basename\f[R] (string): The basename of the webpage URL
  1658. .IP \[bu] 2
  1659. \f[C]webpage_url_domain\f[R] (string): The domain of the webpage URL
  1660. .IP \[bu] 2
  1661. \f[C]original_url\f[R] (string): The URL given by the user (or the same
  1662. as \f[C]webpage_url\f[R] for playlist entries)
  1663. .IP \[bu] 2
  1664. \f[C]categories\f[R] (list): List of categories the video belongs to
  1665. .IP \[bu] 2
  1666. \f[C]tags\f[R] (list): List of tags assigned to the video
  1667. .IP \[bu] 2
  1668. \f[C]cast\f[R] (list): List of cast members
  1669. .PP
  1670. All the fields in Filtering Formats can also be used
  1671. .PP
  1672. Available for the video that belongs to some logical chapter or section:
  1673. .IP \[bu] 2
  1674. \f[C]chapter\f[R] (string): Name or title of the chapter the video
  1675. belongs to
  1676. .IP \[bu] 2
  1677. \f[C]chapter_number\f[R] (numeric): Number of the chapter the video
  1678. belongs to
  1679. .IP \[bu] 2
  1680. \f[C]chapter_id\f[R] (string): Id of the chapter the video belongs to
  1681. .PP
  1682. Available for the video that is an episode of some series or program:
  1683. .IP \[bu] 2
  1684. \f[C]series\f[R] (string): Title of the series or program the video
  1685. episode belongs to
  1686. .IP \[bu] 2
  1687. \f[C]series_id\f[R] (string): Id of the series or program the video
  1688. episode belongs to
  1689. .IP \[bu] 2
  1690. \f[C]season\f[R] (string): Title of the season the video episode belongs
  1691. to
  1692. .IP \[bu] 2
  1693. \f[C]season_number\f[R] (numeric): Number of the season the video
  1694. episode belongs to
  1695. .IP \[bu] 2
  1696. \f[C]season_id\f[R] (string): Id of the season the video episode belongs
  1697. to
  1698. .IP \[bu] 2
  1699. \f[C]episode\f[R] (string): Title of the video episode
  1700. .IP \[bu] 2
  1701. \f[C]episode_number\f[R] (numeric): Number of the video episode within a
  1702. season
  1703. .IP \[bu] 2
  1704. \f[C]episode_id\f[R] (string): Id of the video episode
  1705. .PP
  1706. Available for the media that is a track or a part of a music album:
  1707. .IP \[bu] 2
  1708. \f[C]track\f[R] (string): Title of the track
  1709. .IP \[bu] 2
  1710. \f[C]track_number\f[R] (numeric): Number of the track within an album or
  1711. a disc
  1712. .IP \[bu] 2
  1713. \f[C]track_id\f[R] (string): Id of the track
  1714. .IP \[bu] 2
  1715. \f[C]artists\f[R] (list): Artist(s) of the track
  1716. .IP \[bu] 2
  1717. \f[C]artist\f[R] (string): Artist(s) of the track; comma-separated
  1718. .IP \[bu] 2
  1719. \f[C]genres\f[R] (list): Genre(s) of the track
  1720. .IP \[bu] 2
  1721. \f[C]genre\f[R] (string): Genre(s) of the track; comma-separated
  1722. .IP \[bu] 2
  1723. \f[C]composers\f[R] (list): Composer(s) of the piece
  1724. .IP \[bu] 2
  1725. \f[C]composer\f[R] (string): Composer(s) of the piece; comma-separated
  1726. .IP \[bu] 2
  1727. \f[C]album\f[R] (string): Title of the album the track belongs to
  1728. .IP \[bu] 2
  1729. \f[C]album_type\f[R] (string): Type of the album
  1730. .IP \[bu] 2
  1731. \f[C]album_artists\f[R] (list): All artists appeared on the album
  1732. .IP \[bu] 2
  1733. \f[C]album_artist\f[R] (string): All artists appeared on the album;
  1734. comma-separated
  1735. .IP \[bu] 2
  1736. \f[C]disc_number\f[R] (numeric): Number of the disc or other physical
  1737. medium the track belongs to
  1738. .PP
  1739. Available only when using \f[C]--download-sections\f[R] and for
  1740. \f[C]chapter:\f[R] prefix when using \f[C]--split-chapters\f[R] for
  1741. videos with internal chapters:
  1742. .IP \[bu] 2
  1743. \f[C]section_title\f[R] (string): Title of the chapter
  1744. .IP \[bu] 2
  1745. \f[C]section_number\f[R] (numeric): Number of the chapter within the
  1746. file
  1747. .IP \[bu] 2
  1748. \f[C]section_start\f[R] (numeric): Start time of the chapter in seconds
  1749. .IP \[bu] 2
  1750. \f[C]section_end\f[R] (numeric): End time of the chapter in seconds
  1751. .PP
  1752. Available only when used in \f[C]--print\f[R]:
  1753. .IP \[bu] 2
  1754. \f[C]urls\f[R] (string): The URLs of all requested formats, one in each
  1755. line
  1756. .IP \[bu] 2
  1757. \f[C]filename\f[R] (string): Name of the video file.
  1758. Note that the actual filename may differ
  1759. .IP \[bu] 2
  1760. \f[C]formats_table\f[R] (table): The video format table as printed by
  1761. \f[C]--list-formats\f[R]
  1762. .IP \[bu] 2
  1763. \f[C]thumbnails_table\f[R] (table): The thumbnail format table as
  1764. printed by \f[C]--list-thumbnails\f[R]
  1765. .IP \[bu] 2
  1766. \f[C]subtitles_table\f[R] (table): The subtitle format table as printed
  1767. by \f[C]--list-subs\f[R]
  1768. .IP \[bu] 2
  1769. \f[C]automatic_captions_table\f[R] (table): The automatic subtitle
  1770. format table as printed by \f[C]--list-subs\f[R]
  1771. .PP
  1772. Available only after the video is downloaded
  1773. (\f[C]post_process\f[R]/\f[C]after_move\f[R]):
  1774. .IP \[bu] 2
  1775. \f[C]filepath\f[R]: Actual path of downloaded video file
  1776. .PP
  1777. Available only in \f[C]--sponsorblock-chapter-title\f[R]:
  1778. .IP \[bu] 2
  1779. \f[C]start_time\f[R] (numeric): Start time of the chapter in seconds
  1780. .IP \[bu] 2
  1781. \f[C]end_time\f[R] (numeric): End time of the chapter in seconds
  1782. .IP \[bu] 2
  1783. \f[C]categories\f[R] (list): The SponsorBlock
  1784. categories (https://wiki.sponsor.ajay.app/w/Types#Category) the chapter
  1785. belongs to
  1786. .IP \[bu] 2
  1787. \f[C]category\f[R] (string): The smallest SponsorBlock category the
  1788. chapter belongs to
  1789. .IP \[bu] 2
  1790. \f[C]category_names\f[R] (list): Friendly names of the categories
  1791. .IP \[bu] 2
  1792. \f[C]name\f[R] (string): Friendly name of the smallest category
  1793. .IP \[bu] 2
  1794. \f[C]type\f[R] (string): The SponsorBlock action
  1795. type (https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter
  1796. .PP
  1797. Each aforementioned sequence when referenced in an output template will
  1798. be replaced by the actual value corresponding to the sequence name.
  1799. E.g.
  1800. for \f[C]-o %(title)s-%(id)s.%(ext)s\f[R] and an mp4 video with title
  1801. \f[C]yt-dlp test video\f[R] and id \f[C]BaW_jenozKc\f[R], this will
  1802. result in a \f[C]yt-dlp test video-BaW_jenozKc.mp4\f[R] file created in
  1803. the current directory.
  1804. .PP
  1805. \f[B]Note\f[R]: Some of the sequences are not guaranteed to be present,
  1806. since they depend on the metadata obtained by a particular extractor.
  1807. Such sequences will be replaced with placeholder value provided with
  1808. \f[C]--output-na-placeholder\f[R] (\f[C]NA\f[R] by default).
  1809. .PP
  1810. \f[B]Tip\f[R]: Look at the \f[C]-j\f[R] output to identify which fields
  1811. are available for the particular URL
  1812. .PP
  1813. For numeric sequences, you can use numeric related
  1814. formatting (https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting);
  1815. e.g.
  1816. \f[C]%(view_count)05d\f[R] will result in a string with view count
  1817. padded with zeros up to 5 characters, like in \f[C]00042\f[R].
  1818. .PP
  1819. Output templates can also contain arbitrary hierarchical path, e.g.
  1820. \f[C]-o \[dq]%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq]\f[R]
  1821. which will result in downloading each video in a directory corresponding
  1822. to this path template.
  1823. Any missing directory will be automatically created for you.
  1824. .PP
  1825. To use percent literals in an output template use \f[C]%%\f[R].
  1826. To output to stdout use \f[C]-o -\f[R].
  1827. .PP
  1828. The current default template is \f[C]%(title)s [%(id)s].%(ext)s\f[R].
  1829. .PP
  1830. In some cases, you don\[aq]t want special characters such as \[u4E2D],
  1831. spaces, or &, such as when transferring the downloaded filename to a
  1832. Windows system or the filename through an 8bit-unsafe channel.
  1833. In these cases, add the \f[C]--restrict-filenames\f[R] flag to get a
  1834. shorter title.
  1835. .SS Output template examples
  1836. .IP
  1837. .nf
  1838. \f[C]
  1839. $ yt-dlp --print filename -o \[dq]test video.%(ext)s\[dq] BaW_jenozKc
  1840. test video.webm # Literal name with correct extension
  1841. $ yt-dlp --print filename -o \[dq]%(title)s.%(ext)s\[dq] BaW_jenozKc
  1842. youtube-dl test video \[aq]\[aq]_\[:a]\[u21AD]\[u1D550].webm # All kinds of weird characters
  1843. $ yt-dlp --print filename -o \[dq]%(title)s.%(ext)s\[dq] BaW_jenozKc --restrict-filenames
  1844. youtube-dl_test_video_.webm # Restricted file name
  1845. # Download YouTube playlist videos in separate directory indexed by video order in a playlist
  1846. $ yt-dlp -o \[dq]%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\[dq]
  1847. # Download YouTube playlist videos in separate directories according to their uploaded year
  1848. $ yt-dlp -o \[dq]%(upload_date>%Y)s/%(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re\[dq]
  1849. # Prefix playlist index with \[dq] - \[dq] separator, but only if it is available
  1850. $ yt-dlp -o \[dq]%(playlist_index&{} - |)s%(title)s.%(ext)s\[dq] BaW_jenozKc \[dq]https://www.youtube.com/user/TheLinuxFoundation/playlists\[dq]
  1851. # Download all playlists of YouTube channel/user keeping each playlist in separate directory:
  1852. $ yt-dlp -o \[dq]%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s\[dq] \[dq]https://www.youtube.com/user/TheLinuxFoundation/playlists\[dq]
  1853. # Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home
  1854. $ yt-dlp -u user -p password -P \[dq]\[ti]/MyVideos\[dq] -o \[dq]%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s\[dq] \[dq]https://www.udemy.com/java-tutorial\[dq]
  1855. # Download entire series season keeping each series and each season in separate directory under C:/MyVideos
  1856. $ yt-dlp -P \[dq]C:/MyVideos\[dq] -o \[dq]%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s\[dq] \[dq]https://videomore.ru/kino_v_detalayah/5_sezon/367617\[dq]
  1857. # Download video as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]title.ext\[dq], subtitles as \[dq]C:\[rs]MyVideos\[rs]subs\[rs]uploader\[rs]title.ext\[dq]
  1858. # and put all temporary files in \[dq]C:\[rs]MyVideos\[rs]tmp\[dq]
  1859. $ yt-dlp -P \[dq]C:/MyVideos\[dq] -P \[dq]temp:tmp\[dq] -P \[dq]subtitle:subs\[dq] -o \[dq]%(uploader)s/%(title)s.%(ext)s\[dq] BaW_jenozKc --write-subs
  1860. # Download video as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]title.ext\[dq] and subtitles as \[dq]C:\[rs]MyVideos\[rs]uploader\[rs]subs\[rs]title.ext\[dq]
  1861. $ yt-dlp -P \[dq]C:/MyVideos\[dq] -o \[dq]%(uploader)s/%(title)s.%(ext)s\[dq] -o \[dq]subtitle:%(uploader)s/subs/%(title)s.%(ext)s\[dq] BaW_jenozKc --write-subs
  1862. # Stream the video being downloaded to stdout
  1863. $ yt-dlp -o - BaW_jenozKc
  1864. \f[R]
  1865. .fi
  1866. .SH FORMAT SELECTION
  1867. .PP
  1868. By default, yt-dlp tries to download the best available quality if you
  1869. \f[B]don\[aq]t\f[R] pass any options.
  1870. This is generally equivalent to using
  1871. \f[C]-f bestvideo*+bestaudio/best\f[R].
  1872. However, if multiple audiostreams is enabled
  1873. (\f[C]--audio-multistreams\f[R]), the default format changes to
  1874. \f[C]-f bestvideo+bestaudio/best\f[R].
  1875. Similarly, if ffmpeg is unavailable, or if you use yt-dlp to stream to
  1876. \f[C]stdout\f[R] (\f[C]-o -\f[R]), the default becomes
  1877. \f[C]-f best/bestvideo+bestaudio\f[R].
  1878. .PP
  1879. \f[B]Deprecation warning\f[R]: Latest versions of yt-dlp can stream
  1880. multiple formats to the stdout simultaneously using ffmpeg.
  1881. So, in future versions, the default for this will be set to
  1882. \f[C]-f bv*+ba/b\f[R] similar to normal downloads.
  1883. If you want to preserve the \f[C]-f b/bv+ba\f[R] setting, it is
  1884. recommended to explicitly specify it in the configuration options.
  1885. .PP
  1886. The general syntax for format selection is \f[C]-f FORMAT\f[R] (or
  1887. \f[C]--format FORMAT\f[R]) where \f[C]FORMAT\f[R] is a \f[I]selector
  1888. expression\f[R], i.e.
  1889. an expression that describes format or formats you would like to
  1890. download.
  1891. .PP
  1892. The simplest case is requesting a specific format; e.g.
  1893. with \f[C]-f 22\f[R] you can download the format with format code equal
  1894. to 22.
  1895. You can get the list of available format codes for particular video
  1896. using \f[C]--list-formats\f[R] or \f[C]-F\f[R].
  1897. Note that these format codes are extractor specific.
  1898. .PP
  1899. You can also use a file extension (currently \f[C]3gp\f[R],
  1900. \f[C]aac\f[R], \f[C]flv\f[R], \f[C]m4a\f[R], \f[C]mp3\f[R],
  1901. \f[C]mp4\f[R], \f[C]ogg\f[R], \f[C]wav\f[R], \f[C]webm\f[R] are
  1902. supported) to download the best quality format of a particular file
  1903. extension served as a single file, e.g.
  1904. \f[C]-f webm\f[R] will download the best quality format with the
  1905. \f[C]webm\f[R] extension served as a single file.
  1906. .PP
  1907. You can use \f[C]-f -\f[R] to interactively provide the format selector
  1908. \f[I]for each video\f[R]
  1909. .PP
  1910. You can also use special names to select particular edge case formats:
  1911. .IP \[bu] 2
  1912. \f[C]all\f[R]: Select \f[B]all formats\f[R] separately
  1913. .IP \[bu] 2
  1914. \f[C]mergeall\f[R]: Select and \f[B]merge all formats\f[R] (Must be used
  1915. with \f[C]--audio-multistreams\f[R], \f[C]--video-multistreams\f[R] or
  1916. both)
  1917. .IP \[bu] 2
  1918. \f[C]b*\f[R], \f[C]best*\f[R]: Select the best quality format that
  1919. \f[B]contains either\f[R] a video or an audio or both (i.e.;
  1920. \f[C]vcodec!=none or acodec!=none\f[R])
  1921. .IP \[bu] 2
  1922. \f[C]b\f[R], \f[C]best\f[R]: Select the best quality format that
  1923. \f[B]contains both\f[R] video and audio.
  1924. Equivalent to \f[C]best*[vcodec!=none][acodec!=none]\f[R]
  1925. .IP \[bu] 2
  1926. \f[C]bv\f[R], \f[C]bestvideo\f[R]: Select the best quality
  1927. \f[B]video-only\f[R] format.
  1928. Equivalent to \f[C]best*[acodec=none]\f[R]
  1929. .IP \[bu] 2
  1930. \f[C]bv*\f[R], \f[C]bestvideo*\f[R]: Select the best quality format that
  1931. \f[B]contains video\f[R].
  1932. It may also contain audio.
  1933. Equivalent to \f[C]best*[vcodec!=none]\f[R]
  1934. .IP \[bu] 2
  1935. \f[C]ba\f[R], \f[C]bestaudio\f[R]: Select the best quality
  1936. \f[B]audio-only\f[R] format.
  1937. Equivalent to \f[C]best*[vcodec=none]\f[R]
  1938. .IP \[bu] 2
  1939. \f[C]ba*\f[R], \f[C]bestaudio*\f[R]: Select the best quality format that
  1940. \f[B]contains audio\f[R].
  1941. It may also contain video.
  1942. Equivalent to \f[C]best*[acodec!=none]\f[R] (Do not
  1943. use! (https://github.com/yt-dlp/yt-dlp/issues/979#issuecomment-919629354))
  1944. .IP \[bu] 2
  1945. \f[C]w*\f[R], \f[C]worst*\f[R]: Select the worst quality format that
  1946. contains either a video or an audio
  1947. .IP \[bu] 2
  1948. \f[C]w\f[R], \f[C]worst\f[R]: Select the worst quality format that
  1949. contains both video and audio.
  1950. Equivalent to \f[C]worst*[vcodec!=none][acodec!=none]\f[R]
  1951. .IP \[bu] 2
  1952. \f[C]wv\f[R], \f[C]worstvideo\f[R]: Select the worst quality video-only
  1953. format.
  1954. Equivalent to \f[C]worst*[acodec=none]\f[R]
  1955. .IP \[bu] 2
  1956. \f[C]wv*\f[R], \f[C]worstvideo*\f[R]: Select the worst quality format
  1957. that contains video.
  1958. It may also contain audio.
  1959. Equivalent to \f[C]worst*[vcodec!=none]\f[R]
  1960. .IP \[bu] 2
  1961. \f[C]wa\f[R], \f[C]worstaudio\f[R]: Select the worst quality audio-only
  1962. format.
  1963. Equivalent to \f[C]worst*[vcodec=none]\f[R]
  1964. .IP \[bu] 2
  1965. \f[C]wa*\f[R], \f[C]worstaudio*\f[R]: Select the worst quality format
  1966. that contains audio.
  1967. It may also contain video.
  1968. Equivalent to \f[C]worst*[acodec!=none]\f[R]
  1969. .PP
  1970. For example, to download the worst quality video-only format you can use
  1971. \f[C]-f worstvideo\f[R].
  1972. It is, however, recommended not to use \f[C]worst\f[R] and related
  1973. options.
  1974. When your format selector is \f[C]worst\f[R], the format which is worst
  1975. in all respects is selected.
  1976. Most of the time, what you actually want is the video with the smallest
  1977. filesize instead.
  1978. So it is generally better to use \f[C]-S +size\f[R] or more rigorously,
  1979. \f[C]-S +size,+br,+res,+fps\f[R] instead of \f[C]-f worst\f[R].
  1980. See Sorting Formats for more details.
  1981. .PP
  1982. You can select the n\[aq]th best format of a type by using
  1983. \f[C]best<type>.<n>\f[R].
  1984. For example, \f[C]best.2\f[R] will select the 2nd best combined format.
  1985. Similarly, \f[C]bv*.3\f[R] will select the 3rd best format that contains
  1986. a video stream.
  1987. .PP
  1988. If you want to download multiple videos, and they don\[aq]t have the
  1989. same formats available, you can specify the order of preference using
  1990. slashes.
  1991. Note that formats on the left hand side are preferred; e.g.
  1992. \f[C]-f 22/17/18\f[R] will download format 22 if it\[aq]s available,
  1993. otherwise it will download format 17 if it\[aq]s available, otherwise it
  1994. will download format 18 if it\[aq]s available, otherwise it will
  1995. complain that no suitable formats are available for download.
  1996. .PP
  1997. If you want to download several formats of the same video use a comma as
  1998. a separator, e.g.
  1999. \f[C]-f 22,17,18\f[R] will download all these three formats, of course
  2000. if they are available.
  2001. Or a more sophisticated example combined with the precedence feature:
  2002. \f[C]-f 136/137/mp4/bestvideo,140/m4a/bestaudio\f[R].
  2003. .PP
  2004. You can merge the video and audio of multiple formats into a single file
  2005. using \f[C]-f <format1>+<format2>+...\f[R] (requires ffmpeg installed);
  2006. e.g.
  2007. \f[C]-f bestvideo+bestaudio\f[R] will download the best video-only
  2008. format, the best audio-only format and mux them together with ffmpeg.
  2009. .PP
  2010. \f[B]Deprecation warning\f[R]: Since the \f[I]below\f[R] described
  2011. behavior is complex and counter-intuitive, this will be removed and
  2012. multistreams will be enabled by default in the future.
  2013. A new operator will be instead added to limit formats to single
  2014. audio/video
  2015. .PP
  2016. Unless \f[C]--video-multistreams\f[R] is used, all formats with a video
  2017. stream except the first one are ignored.
  2018. Similarly, unless \f[C]--audio-multistreams\f[R] is used, all formats
  2019. with an audio stream except the first one are ignored.
  2020. E.g.
  2021. \f[C]-f bestvideo+best+bestaudio --video-multistreams --audio-multistreams\f[R]
  2022. will download and merge all 3 given formats.
  2023. The resulting file will have 2 video streams and 2 audio streams.
  2024. But \f[C]-f bestvideo+best+bestaudio --no-video-multistreams\f[R] will
  2025. download and merge only \f[C]bestvideo\f[R] and \f[C]bestaudio\f[R].
  2026. \f[C]best\f[R] is ignored since another format containing a video stream
  2027. (\f[C]bestvideo\f[R]) has already been selected.
  2028. The order of the formats is therefore important.
  2029. \f[C]-f best+bestaudio --no-audio-multistreams\f[R] will download only
  2030. \f[C]best\f[R] while \f[C]-f bestaudio+best --no-audio-multistreams\f[R]
  2031. will ignore \f[C]best\f[R] and download only \f[C]bestaudio\f[R].
  2032. .SS Filtering Formats
  2033. .PP
  2034. You can also filter the video formats by putting a condition in
  2035. brackets, as in \f[C]-f \[dq]best[height=720]\[dq]\f[R] (or
  2036. \f[C]-f \[dq][filesize>10M]\[dq]\f[R] since filters without a selector
  2037. are interpreted as \f[C]best\f[R]).
  2038. .PP
  2039. The following numeric meta fields can be used with comparisons
  2040. \f[C]<\f[R], \f[C]<=\f[R], \f[C]>\f[R], \f[C]>=\f[R], \f[C]=\f[R]
  2041. (equals), \f[C]!=\f[R] (not equals):
  2042. .IP \[bu] 2
  2043. \f[C]filesize\f[R]: The number of bytes, if known in advance
  2044. .IP \[bu] 2
  2045. \f[C]filesize_approx\f[R]: An estimate for the number of bytes
  2046. .IP \[bu] 2
  2047. \f[C]width\f[R]: Width of the video, if known
  2048. .IP \[bu] 2
  2049. \f[C]height\f[R]: Height of the video, if known
  2050. .IP \[bu] 2
  2051. \f[C]aspect_ratio\f[R]: Aspect ratio of the video, if known
  2052. .IP \[bu] 2
  2053. \f[C]tbr\f[R]: Average bitrate of audio and video in kbps
  2054. .IP \[bu] 2
  2055. \f[C]abr\f[R]: Average audio bitrate in kbps
  2056. .IP \[bu] 2
  2057. \f[C]vbr\f[R]: Average video bitrate in kbps
  2058. .IP \[bu] 2
  2059. \f[C]asr\f[R]: Audio sampling rate in Hertz
  2060. .IP \[bu] 2
  2061. \f[C]fps\f[R]: Frame rate
  2062. .IP \[bu] 2
  2063. \f[C]audio_channels\f[R]: The number of audio channels
  2064. .IP \[bu] 2
  2065. \f[C]stretched_ratio\f[R]: \f[C]width:height\f[R] of the video\[aq]s
  2066. pixels, if not square
  2067. .PP
  2068. Also filtering work for comparisons \f[C]=\f[R] (equals),
  2069. \f[C]\[ha]=\f[R] (starts with), \f[C]$=\f[R] (ends with), \f[C]*=\f[R]
  2070. (contains), \f[C]\[ti]=\f[R] (matches regex) and following string meta
  2071. fields:
  2072. .IP \[bu] 2
  2073. \f[C]url\f[R]: Video URL
  2074. .IP \[bu] 2
  2075. \f[C]ext\f[R]: File extension
  2076. .IP \[bu] 2
  2077. \f[C]acodec\f[R]: Name of the audio codec in use
  2078. .IP \[bu] 2
  2079. \f[C]vcodec\f[R]: Name of the video codec in use
  2080. .IP \[bu] 2
  2081. \f[C]container\f[R]: Name of the container format
  2082. .IP \[bu] 2
  2083. \f[C]protocol\f[R]: The protocol that will be used for the actual
  2084. download, lower-case (\f[C]http\f[R], \f[C]https\f[R], \f[C]rtsp\f[R],
  2085. \f[C]rtmp\f[R], \f[C]rtmpe\f[R], \f[C]mms\f[R], \f[C]f4m\f[R],
  2086. \f[C]ism\f[R], \f[C]http_dash_segments\f[R], \f[C]m3u8\f[R], or
  2087. \f[C]m3u8_native\f[R])
  2088. .IP \[bu] 2
  2089. \f[C]language\f[R]: Language code
  2090. .IP \[bu] 2
  2091. \f[C]dynamic_range\f[R]: The dynamic range of the video
  2092. .IP \[bu] 2
  2093. \f[C]format_id\f[R]: A short description of the format
  2094. .IP \[bu] 2
  2095. \f[C]format\f[R]: A human-readable description of the format
  2096. .IP \[bu] 2
  2097. \f[C]format_note\f[R]: Additional info about the format
  2098. .IP \[bu] 2
  2099. \f[C]resolution\f[R]: Textual description of width and height
  2100. .PP
  2101. Any string comparison may be prefixed with negation \f[C]!\f[R] in order
  2102. to produce an opposite comparison, e.g.
  2103. \f[C]!*=\f[R] (does not contain).
  2104. The comparand of a string comparison needs to be quoted with either
  2105. double or single quotes if it contains spaces or special characters
  2106. other than \f[C]._-\f[R].
  2107. .PP
  2108. \f[B]Note\f[R]: None of the aforementioned meta fields are guaranteed to
  2109. be present since this solely depends on the metadata obtained by the
  2110. particular extractor, i.e.
  2111. the metadata offered by the website.
  2112. Any other field made available by the extractor can also be used for
  2113. filtering.
  2114. .PP
  2115. Formats for which the value is not known are excluded unless you put a
  2116. question mark (\f[C]?\f[R]) after the operator.
  2117. You can combine format filters, so
  2118. \f[C]-f \[dq]bv[height<=?720][tbr>500]\[dq]\f[R] selects up to 720p
  2119. videos (or videos where the height is not known) with a bitrate of at
  2120. least 500 kbps.
  2121. You can also use the filters with \f[C]all\f[R] to download all formats
  2122. that satisfy the filter, e.g.
  2123. \f[C]-f \[dq]all[vcodec=none]\[dq]\f[R] selects all audio-only formats.
  2124. .PP
  2125. Format selectors can also be grouped using parentheses; e.g.
  2126. \f[C]-f \[dq](mp4,webm)[height<480]\[dq]\f[R] will download the best
  2127. pre-merged mp4 and webm formats with a height lower than 480.
  2128. .SS Sorting Formats
  2129. .PP
  2130. You can change the criteria for being considered the \f[C]best\f[R] by
  2131. using \f[C]-S\f[R] (\f[C]--format-sort\f[R]).
  2132. The general format for this is \f[C]--format-sort field1,field2...\f[R].
  2133. .PP
  2134. The available fields are:
  2135. .IP \[bu] 2
  2136. \f[C]hasvid\f[R]: Gives priority to formats that have a video stream
  2137. .IP \[bu] 2
  2138. \f[C]hasaud\f[R]: Gives priority to formats that have an audio stream
  2139. .IP \[bu] 2
  2140. \f[C]ie_pref\f[R]: The format preference
  2141. .IP \[bu] 2
  2142. \f[C]lang\f[R]: The language preference
  2143. .IP \[bu] 2
  2144. \f[C]quality\f[R]: The quality of the format
  2145. .IP \[bu] 2
  2146. \f[C]source\f[R]: The preference of the source
  2147. .IP \[bu] 2
  2148. \f[C]proto\f[R]: Protocol used for download
  2149. (\f[C]https\f[R]/\f[C]ftps\f[R] > \f[C]http\f[R]/\f[C]ftp\f[R] >
  2150. \f[C]m3u8_native\f[R]/\f[C]m3u8\f[R] > \f[C]http_dash_segments\f[R]>
  2151. \f[C]websocket_frag\f[R] > \f[C]mms\f[R]/\f[C]rtsp\f[R] >
  2152. \f[C]f4f\f[R]/\f[C]f4m\f[R])
  2153. .IP \[bu] 2
  2154. \f[C]vcodec\f[R]: Video Codec (\f[C]av01\f[R] > \f[C]vp9.2\f[R] >
  2155. \f[C]vp9\f[R] > \f[C]h265\f[R] > \f[C]h264\f[R] > \f[C]vp8\f[R] >
  2156. \f[C]h263\f[R] > \f[C]theora\f[R] > other)
  2157. .IP \[bu] 2
  2158. \f[C]acodec\f[R]: Audio Codec (\f[C]flac\f[R]/\f[C]alac\f[R] >
  2159. \f[C]wav\f[R]/\f[C]aiff\f[R] > \f[C]opus\f[R] > \f[C]vorbis\f[R] >
  2160. \f[C]aac\f[R] > \f[C]mp4a\f[R] > \f[C]mp3\f[R] > \f[C]ac4\f[R] >
  2161. \f[C]eac3\f[R] > \f[C]ac3\f[R] > \f[C]dts\f[R] > other)
  2162. .IP \[bu] 2
  2163. \f[C]codec\f[R]: Equivalent to \f[C]vcodec,acodec\f[R]
  2164. .IP \[bu] 2
  2165. \f[C]vext\f[R]: Video Extension (\f[C]mp4\f[R] > \f[C]mov\f[R] >
  2166. \f[C]webm\f[R] > \f[C]flv\f[R] > other).
  2167. If \f[C]--prefer-free-formats\f[R] is used, \f[C]webm\f[R] is preferred.
  2168. .IP \[bu] 2
  2169. \f[C]aext\f[R]: Audio Extension (\f[C]m4a\f[R] > \f[C]aac\f[R] >
  2170. \f[C]mp3\f[R] > \f[C]ogg\f[R] > \f[C]opus\f[R] > \f[C]webm\f[R] >
  2171. other).
  2172. If \f[C]--prefer-free-formats\f[R] is used, the order changes to
  2173. \f[C]ogg\f[R] > \f[C]opus\f[R] > \f[C]webm\f[R] > \f[C]mp3\f[R] >
  2174. \f[C]m4a\f[R] > \f[C]aac\f[R]
  2175. .IP \[bu] 2
  2176. \f[C]ext\f[R]: Equivalent to \f[C]vext,aext\f[R]
  2177. .IP \[bu] 2
  2178. \f[C]filesize\f[R]: Exact filesize, if known in advance
  2179. .IP \[bu] 2
  2180. \f[C]fs_approx\f[R]: Approximate filesize
  2181. .IP \[bu] 2
  2182. \f[C]size\f[R]: Exact filesize if available, otherwise approximate
  2183. filesize
  2184. .IP \[bu] 2
  2185. \f[C]height\f[R]: Height of video
  2186. .IP \[bu] 2
  2187. \f[C]width\f[R]: Width of video
  2188. .IP \[bu] 2
  2189. \f[C]res\f[R]: Video resolution, calculated as the smallest dimension.
  2190. .IP \[bu] 2
  2191. \f[C]fps\f[R]: Framerate of video
  2192. .IP \[bu] 2
  2193. \f[C]hdr\f[R]: The dynamic range of the video (\f[C]DV\f[R] >
  2194. \f[C]HDR12\f[R] > \f[C]HDR10+\f[R] > \f[C]HDR10\f[R] > \f[C]HLG\f[R] >
  2195. \f[C]SDR\f[R])
  2196. .IP \[bu] 2
  2197. \f[C]channels\f[R]: The number of audio channels
  2198. .IP \[bu] 2
  2199. \f[C]tbr\f[R]: Total average bitrate in kbps
  2200. .IP \[bu] 2
  2201. \f[C]vbr\f[R]: Average video bitrate in kbps
  2202. .IP \[bu] 2
  2203. \f[C]abr\f[R]: Average audio bitrate in kbps
  2204. .IP \[bu] 2
  2205. \f[C]br\f[R]: Average bitrate in kbps,
  2206. \f[C]tbr\f[R]/\f[C]vbr\f[R]/\f[C]abr\f[R]
  2207. .IP \[bu] 2
  2208. \f[C]asr\f[R]: Audio sample rate in Hz
  2209. .PP
  2210. \f[B]Deprecation warning\f[R]: Many of these fields have (currently
  2211. undocumented) aliases, that may be removed in a future version.
  2212. It is recommended to use only the documented field names.
  2213. .PP
  2214. All fields, unless specified otherwise, are sorted in descending order.
  2215. To reverse this, prefix the field with a \f[C]+\f[R].
  2216. E.g.
  2217. \f[C]+res\f[R] prefers format with the smallest resolution.
  2218. Additionally, you can suffix a preferred value for the fields, separated
  2219. by a \f[C]:\f[R].
  2220. E.g.
  2221. \f[C]res:720\f[R] prefers larger videos, but no larger than 720p and the
  2222. smallest video if there are no videos less than 720p.
  2223. For \f[C]codec\f[R] and \f[C]ext\f[R], you can provide two preferred
  2224. values, the first for video and the second for audio.
  2225. E.g.
  2226. \f[C]+codec:avc:m4a\f[R] (equivalent to
  2227. \f[C]+vcodec:avc,+acodec:m4a\f[R]) sets the video codec preference to
  2228. \f[C]h264\f[R] > \f[C]h265\f[R] > \f[C]vp9\f[R] > \f[C]vp9.2\f[R] >
  2229. \f[C]av01\f[R] > \f[C]vp8\f[R] > \f[C]h263\f[R] > \f[C]theora\f[R] and
  2230. audio codec preference to \f[C]mp4a\f[R] > \f[C]aac\f[R] >
  2231. \f[C]vorbis\f[R] > \f[C]opus\f[R] > \f[C]mp3\f[R] > \f[C]ac3\f[R] >
  2232. \f[C]dts\f[R].
  2233. You can also make the sorting prefer the nearest values to the provided
  2234. by using \f[C]\[ti]\f[R] as the delimiter.
  2235. E.g.
  2236. \f[C]filesize\[ti]1G\f[R] prefers the format with filesize closest to 1
  2237. GiB.
  2238. .PP
  2239. The fields \f[C]hasvid\f[R] and \f[C]ie_pref\f[R] are always given
  2240. highest priority in sorting, irrespective of the user-defined order.
  2241. This behavior can be changed by using \f[C]--format-sort-force\f[R].
  2242. Apart from these, the default order used is:
  2243. \f[C]lang,quality,res,fps,hdr:12,vcodec,channels,acodec,size,br,asr,proto,ext,hasaud,source,id\f[R].
  2244. The extractors may override this default order, but they cannot override
  2245. the user-provided order.
  2246. .PP
  2247. Note that the default for hdr is \f[C]hdr:12\f[R]; i.e.
  2248. Dolby Vision is not preferred.
  2249. This choice was made since DV formats are not yet fully compatible with
  2250. most devices.
  2251. This may be changed in the future.
  2252. .PP
  2253. If your format selector is \f[C]worst\f[R], the last item is selected
  2254. after sorting.
  2255. This means it will select the format that is worst in all respects.
  2256. Most of the time, what you actually want is the video with the smallest
  2257. filesize instead.
  2258. So it is generally better to use
  2259. \f[C]-f best -S +size,+br,+res,+fps\f[R].
  2260. .PP
  2261. \f[B]Tip\f[R]: You can use the \f[C]-v -F\f[R] to see how the formats
  2262. have been sorted (worst to best).
  2263. .SS Format Selection examples
  2264. .IP
  2265. .nf
  2266. \f[C]
  2267. # Download and merge the best video-only format and the best audio-only format,
  2268. # or download the best combined format if video-only format is not available
  2269. $ yt-dlp -f \[dq]bv+ba/b\[dq]
  2270. # Download best format that contains video,
  2271. # and if it doesn\[aq]t already have an audio stream, merge it with best audio-only format
  2272. $ yt-dlp -f \[dq]bv*+ba/b\[dq]
  2273. # Same as above
  2274. $ yt-dlp
  2275. # Download the best video-only format and the best audio-only format without merging them
  2276. # For this case, an output template should be used since
  2277. # by default, bestvideo and bestaudio will have the same file name.
  2278. $ yt-dlp -f \[dq]bv,ba\[dq] -o \[dq]%(title)s.f%(format_id)s.%(ext)s\[dq]
  2279. # Download and merge the best format that has a video stream,
  2280. # and all audio-only formats into one file
  2281. $ yt-dlp -f \[dq]bv*+mergeall[vcodec=none]\[dq] --audio-multistreams
  2282. # Download and merge the best format that has a video stream,
  2283. # and the best 2 audio-only formats into one file
  2284. $ yt-dlp -f \[dq]bv*+ba+ba.2\[dq] --audio-multistreams
  2285. # The following examples show the old method (without -S) of format selection
  2286. # and how to use -S to achieve a similar but (generally) better result
  2287. # Download the worst video available (old method)
  2288. $ yt-dlp -f \[dq]wv*+wa/w\[dq]
  2289. # Download the best video available but with the smallest resolution
  2290. $ yt-dlp -S \[dq]+res\[dq]
  2291. # Download the smallest video available
  2292. $ yt-dlp -S \[dq]+size,+br\[dq]
  2293. # Download the best mp4 video available, or the best video if no mp4 available
  2294. $ yt-dlp -f \[dq]bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b\[dq]
  2295. # Download the best video with the best extension
  2296. # (For video, mp4 > mov > webm > flv. For audio, m4a > aac > mp3 ...)
  2297. $ yt-dlp -S \[dq]ext\[dq]
  2298. # Download the best video available but no better than 480p,
  2299. # or the worst video if there is no video under 480p
  2300. $ yt-dlp -f \[dq]bv*[height<=480]+ba/b[height<=480] / wv*+ba/w\[dq]
  2301. # Download the best video available with the largest height but no better than 480p,
  2302. # or the best video with the smallest resolution if there is no video under 480p
  2303. $ yt-dlp -S \[dq]height:480\[dq]
  2304. # Download the best video available with the largest resolution but no better than 480p,
  2305. # or the best video with the smallest resolution if there is no video under 480p
  2306. # Resolution is determined by using the smallest dimension.
  2307. # So this works correctly for vertical videos as well
  2308. $ yt-dlp -S \[dq]res:480\[dq]
  2309. # Download the best video (that also has audio) but no bigger than 50 MB,
  2310. # or the worst video (that also has audio) if there is no video under 50 MB
  2311. $ yt-dlp -f \[dq]b[filesize<50M] / w\[dq]
  2312. # Download the largest video (that also has audio) but no bigger than 50 MB,
  2313. # or the smallest video (that also has audio) if there is no video under 50 MB
  2314. $ yt-dlp -f \[dq]b\[dq] -S \[dq]filesize:50M\[dq]
  2315. # Download the best video (that also has audio) that is closest in size to 50 MB
  2316. $ yt-dlp -f \[dq]b\[dq] -S \[dq]filesize\[ti]50M\[dq]
  2317. # Download best video available via direct link over HTTP/HTTPS protocol,
  2318. # or the best video available via any protocol if there is no such video
  2319. $ yt-dlp -f \[dq](bv*+ba/b)[protocol\[ha]=http][protocol!*=dash] / (bv*+ba/b)\[dq]
  2320. # Download best video available via the best protocol
  2321. # (https/ftps > http/ftp > m3u8_native > m3u8 > http_dash_segments ...)
  2322. $ yt-dlp -S \[dq]proto\[dq]
  2323. # Download the best video with either h264 or h265 codec,
  2324. # or the best video if there is no such video
  2325. $ yt-dlp -f \[dq](bv*[vcodec\[ti]=\[aq]\[ha]((he|a)vc|h26[45])\[aq]]+ba) / (bv*+ba/b)\[dq]
  2326. # Download the best video with best codec no better than h264,
  2327. # or the best video with worst codec if there is no such video
  2328. $ yt-dlp -S \[dq]codec:h264\[dq]
  2329. # Download the best video with worst codec no worse than h264,
  2330. # or the best video with best codec if there is no such video
  2331. $ yt-dlp -S \[dq]+codec:h264\[dq]
  2332. # More complex examples
  2333. # Download the best video no better than 720p preferring framerate greater than 30,
  2334. # or the worst video (still preferring framerate greater than 30) if there is no such video
  2335. $ yt-dlp -f \[dq]((bv*[fps>30]/bv*)[height<=720]/(wv*[fps>30]/wv*)) + ba / (b[fps>30]/b)[height<=720]/(w[fps>30]/w)\[dq]
  2336. # Download the video with the largest resolution no better than 720p,
  2337. # or the video with the smallest resolution available if there is no such video,
  2338. # preferring larger framerate for formats with the same resolution
  2339. $ yt-dlp -S \[dq]res:720,fps\[dq]
  2340. # Download the video with smallest resolution no worse than 480p,
  2341. # or the video with the largest resolution available if there is no such video,
  2342. # preferring better codec and then larger total bitrate for the same resolution
  2343. $ yt-dlp -S \[dq]+res:480,codec,br\[dq]
  2344. \f[R]
  2345. .fi
  2346. .SH MODIFYING METADATA
  2347. .PP
  2348. The metadata obtained by the extractors can be modified by using
  2349. \f[C]--parse-metadata\f[R] and \f[C]--replace-in-metadata\f[R]
  2350. .PP
  2351. \f[C]--replace-in-metadata FIELDS REGEX REPLACE\f[R] is used to replace
  2352. text in any metadata field using Python regular
  2353. expression (https://docs.python.org/3/library/re.html#regular-expression-syntax).
  2354. Backreferences (https://docs.python.org/3/library/re.html?highlight=backreferences#re.sub)
  2355. can be used in the replace string for advanced use.
  2356. .PP
  2357. The general syntax of \f[C]--parse-metadata FROM:TO\f[R] is to give the
  2358. name of a field or an output template to extract data from, and the
  2359. format to interpret it as, separated by a colon \f[C]:\f[R].
  2360. Either a Python regular
  2361. expression (https://docs.python.org/3/library/re.html#regular-expression-syntax)
  2362. with named capture groups, a single field name, or a similar syntax to
  2363. the output template (only \f[C]%(field)s\f[R] formatting is supported)
  2364. can be used for \f[C]TO\f[R].
  2365. The option can be used multiple times to parse and modify various
  2366. fields.
  2367. .PP
  2368. Note that these options preserve their relative order, allowing
  2369. replacements to be made in parsed fields and vice versa.
  2370. Also, any field thus created can be used in the output template and will
  2371. also affect the media file\[aq]s metadata added when using
  2372. \f[C]--embed-metadata\f[R].
  2373. .PP
  2374. This option also has a few special uses:
  2375. .IP \[bu] 2
  2376. You can download an additional URL based on the metadata of the
  2377. currently downloaded video.
  2378. To do this, set the field \f[C]additional_urls\f[R] to the URL that you
  2379. want to download.
  2380. E.g.
  2381. \f[C]--parse-metadata \[dq]description:(?P<additional_urls>https?://www\[rs].vimeo\[rs].com/\[rs]d+)\[dq]\f[R]
  2382. will download the first vimeo video found in the description
  2383. .IP \[bu] 2
  2384. You can use this to change the metadata that is embedded in the media
  2385. file.
  2386. To do this, set the value of the corresponding field with a
  2387. \f[C]meta_\f[R] prefix.
  2388. For example, any value you set to \f[C]meta_description\f[R] field will
  2389. be added to the \f[C]description\f[R] field in the file - you can use
  2390. this to set a different \[dq]description\[dq] and \[dq]synopsis\[dq].
  2391. To modify the metadata of individual streams, use the \f[C]meta<n>_\f[R]
  2392. prefix (e.g.
  2393. \f[C]meta1_language\f[R]).
  2394. Any value set to the \f[C]meta_\f[R] field will overwrite all default
  2395. values.
  2396. .PP
  2397. \f[B]Note\f[R]: Metadata modification happens before format selection,
  2398. post-extraction and other post-processing operations.
  2399. Some fields may be added or changed during these steps, overriding your
  2400. changes.
  2401. .PP
  2402. For reference, these are the fields yt-dlp adds by default to the file
  2403. metadata:
  2404. .PP
  2405. .TS
  2406. tab(@);
  2407. l l.
  2408. T{
  2409. Metadata fields
  2410. T}@T{
  2411. From
  2412. T}
  2413. _
  2414. T{
  2415. \f[C]title\f[R]
  2416. T}@T{
  2417. \f[C]track\f[R] or \f[C]title\f[R]
  2418. T}
  2419. T{
  2420. \f[C]date\f[R]
  2421. T}@T{
  2422. \f[C]upload_date\f[R]
  2423. T}
  2424. T{
  2425. \f[C]description\f[R], \f[C]synopsis\f[R]
  2426. T}@T{
  2427. \f[C]description\f[R]
  2428. T}
  2429. T{
  2430. \f[C]purl\f[R], \f[C]comment\f[R]
  2431. T}@T{
  2432. \f[C]webpage_url\f[R]
  2433. T}
  2434. T{
  2435. \f[C]track\f[R]
  2436. T}@T{
  2437. \f[C]track_number\f[R]
  2438. T}
  2439. T{
  2440. \f[C]artist\f[R]
  2441. T}@T{
  2442. \f[C]artist\f[R], \f[C]artists\f[R], \f[C]creator\f[R],
  2443. \f[C]creators\f[R], \f[C]uploader\f[R] or \f[C]uploader_id\f[R]
  2444. T}
  2445. T{
  2446. \f[C]composer\f[R]
  2447. T}@T{
  2448. \f[C]composer\f[R] or \f[C]composers\f[R]
  2449. T}
  2450. T{
  2451. \f[C]genre\f[R]
  2452. T}@T{
  2453. \f[C]genre\f[R] or \f[C]genres\f[R]
  2454. T}
  2455. T{
  2456. \f[C]album\f[R]
  2457. T}@T{
  2458. \f[C]album\f[R]
  2459. T}
  2460. T{
  2461. \f[C]album_artist\f[R]
  2462. T}@T{
  2463. \f[C]album_artist\f[R] or \f[C]album_artists\f[R]
  2464. T}
  2465. T{
  2466. \f[C]disc\f[R]
  2467. T}@T{
  2468. \f[C]disc_number\f[R]
  2469. T}
  2470. T{
  2471. \f[C]show\f[R]
  2472. T}@T{
  2473. \f[C]series\f[R]
  2474. T}
  2475. T{
  2476. \f[C]season_number\f[R]
  2477. T}@T{
  2478. \f[C]season_number\f[R]
  2479. T}
  2480. T{
  2481. \f[C]episode_id\f[R]
  2482. T}@T{
  2483. \f[C]episode\f[R] or \f[C]episode_id\f[R]
  2484. T}
  2485. T{
  2486. \f[C]episode_sort\f[R]
  2487. T}@T{
  2488. \f[C]episode_number\f[R]
  2489. T}
  2490. T{
  2491. \f[C]language\f[R] of each stream
  2492. T}@T{
  2493. the format\[aq]s \f[C]language\f[R]
  2494. T}
  2495. .TE
  2496. .PP
  2497. \f[B]Note\f[R]: The file format may not support some of these fields
  2498. .SS Modifying metadata examples
  2499. .IP
  2500. .nf
  2501. \f[C]
  2502. # Interpret the title as \[dq]Artist - Title\[dq]
  2503. $ yt-dlp --parse-metadata \[dq]title:%(artist)s - %(title)s\[dq]
  2504. # Regex example
  2505. $ yt-dlp --parse-metadata \[dq]description:Artist - (?P<artist>.+)\[dq]
  2506. # Set title as \[dq]Series name S01E05\[dq]
  2507. $ yt-dlp --parse-metadata \[dq]%(series)s S%(season_number)02dE%(episode_number)02d:%(title)s\[dq]
  2508. # Prioritize uploader as the \[dq]artist\[dq] field in video metadata
  2509. $ yt-dlp --parse-metadata \[dq]%(uploader|)s:%(meta_artist)s\[dq] --embed-metadata
  2510. # Set \[dq]comment\[dq] field in video metadata using description instead of webpage_url,
  2511. # handling multiple lines correctly
  2512. $ yt-dlp --parse-metadata \[dq]description:(?s)(?P<meta_comment>.+)\[dq] --embed-metadata
  2513. # Do not set any \[dq]synopsis\[dq] in the video metadata
  2514. $ yt-dlp --parse-metadata \[dq]:(?P<meta_synopsis>)\[dq]
  2515. # Remove \[dq]formats\[dq] field from the infojson by setting it to an empty string
  2516. $ yt-dlp --parse-metadata \[dq]video::(?P<formats>)\[dq] --write-info-json
  2517. # Replace all spaces and \[dq]_\[dq] in title and uploader with a \[ga]-\[ga]
  2518. $ yt-dlp --replace-in-metadata \[dq]title,uploader\[dq] \[dq][ _]\[dq] \[dq]-\[dq]
  2519. \f[R]
  2520. .fi
  2521. .SH EXTRACTOR ARGUMENTS
  2522. .PP
  2523. Some extractors accept additional arguments which can be passed using
  2524. \f[C]--extractor-args KEY:ARGS\f[R].
  2525. \f[C]ARGS\f[R] is a \f[C];\f[R] (semicolon) separated string of
  2526. \f[C]ARG=VAL1,VAL2\f[R].
  2527. E.g.
  2528. \f[C]--extractor-args \[dq]youtube:player-client=tv,mweb;formats=incomplete\[dq] --extractor-args \[dq]funimation:version=uncut\[dq]\f[R]
  2529. .PP
  2530. Note: In CLI, \f[C]ARG\f[R] can use \f[C]-\f[R] instead of \f[C]_\f[R];
  2531. e.g.
  2532. \f[C]youtube:player-client\[dq]\f[R] becomes
  2533. \f[C]youtube:player_client\[dq]\f[R]
  2534. .PP
  2535. The following extractors use this feature:
  2536. .SS youtube
  2537. .IP \[bu] 2
  2538. \f[C]lang\f[R]: Prefer translated metadata (\f[C]title\f[R],
  2539. \f[C]description\f[R] etc) of this language code (case-sensitive).
  2540. By default, the video primary language metadata is preferred, with a
  2541. fallback to \f[C]en\f[R] translated.
  2542. See
  2543. youtube.py (https://github.com/yt-dlp/yt-dlp/blob/c26f9b991a0681fd3ea548d535919cec1fbbd430/yt_dlp/extractor/youtube.py#L381-L390)
  2544. for list of supported content language codes
  2545. .IP \[bu] 2
  2546. \f[C]skip\f[R]: One or more of \f[C]hls\f[R], \f[C]dash\f[R] or
  2547. \f[C]translated_subs\f[R] to skip extraction of the m3u8 manifests, dash
  2548. manifests and auto-translated
  2549. subtitles (https://github.com/yt-dlp/yt-dlp/issues/4090#issuecomment-1158102032)
  2550. respectively
  2551. .IP \[bu] 2
  2552. \f[C]player_client\f[R]: Clients to extract video data from.
  2553. The main clients are \f[C]web\f[R], \f[C]ios\f[R] and \f[C]android\f[R],
  2554. with variants \f[C]_music\f[R] and \f[C]_creator\f[R] (e.g.
  2555. \f[C]ios_creator\f[R]); and \f[C]mweb\f[R], \f[C]android_vr\f[R],
  2556. \f[C]web_safari\f[R], \f[C]web_embedded\f[R], \f[C]tv\f[R] and
  2557. \f[C]tv_embedded\f[R] with no variants.
  2558. By default, \f[C]tv,ios,web\f[R] is used, or \f[C]tv,web\f[R] is used
  2559. when authenticating with cookies.
  2560. The \f[C]_music\f[R] variants may be added for
  2561. \f[C]music.youtube.com\f[R] URLs.
  2562. Some clients, such as \f[C]web\f[R] and \f[C]android\f[R], require a
  2563. \f[C]po_token\f[R] for their formats to be downloadable.
  2564. Some clients, such as the \f[C]_creator\f[R] variants, will only work
  2565. with authentication.
  2566. Not all clients support authentication via cookies.
  2567. You can use \f[C]default\f[R] for the default clients, or you can use
  2568. \f[C]all\f[R] for all clients (not recommended).
  2569. You can prefix a client with \f[C]-\f[R] to exclude it, e.g.
  2570. \f[C]youtube:player_client=default,-ios\f[R]
  2571. .IP \[bu] 2
  2572. \f[C]player_skip\f[R]: Skip some network requests that are generally
  2573. needed for robust extraction.
  2574. One or more of \f[C]configs\f[R] (skip client configs),
  2575. \f[C]webpage\f[R] (skip initial webpage), \f[C]js\f[R] (skip js player).
  2576. While these options can help reduce the number of requests needed or
  2577. avoid some rate-limiting, they could cause some issues.
  2578. See #860 (https://github.com/yt-dlp/yt-dlp/pull/860) for more details
  2579. .IP \[bu] 2
  2580. \f[C]player_params\f[R]: YouTube player parameters to use for player
  2581. requests.
  2582. Will overwrite any default ones set by yt-dlp.
  2583. .IP \[bu] 2
  2584. \f[C]comment_sort\f[R]: \f[C]top\f[R] or \f[C]new\f[R] (default) -
  2585. choose comment sorting mode (on YouTube\[aq]s side)
  2586. .IP \[bu] 2
  2587. \f[C]max_comments\f[R]: Limit the amount of comments to gather.
  2588. Comma-separated list of integers representing
  2589. \f[C]max-comments,max-parents,max-replies,max-replies-per-thread\f[R].
  2590. Default is \f[C]all,all,all,all\f[R]
  2591. .RS 2
  2592. .IP \[bu] 2
  2593. E.g.
  2594. \f[C]all,all,1000,10\f[R] will get a maximum of 1000 replies total, with
  2595. up to 10 replies per thread.
  2596. \f[C]1000,all,100\f[R] will get a maximum of 1000 comments, with a
  2597. maximum of 100 replies total
  2598. .RE
  2599. .IP \[bu] 2
  2600. \f[C]formats\f[R]: Change the types of formats to return.
  2601. \f[C]dashy\f[R] (convert HTTP to DASH), \f[C]duplicate\f[R] (identical
  2602. content but different URLs or protocol; includes \f[C]dashy\f[R]),
  2603. \f[C]incomplete\f[R] (cannot be downloaded completely - live dash and
  2604. post-live m3u8), \f[C]missing_pot\f[R] (include formats that require a
  2605. PO Token but are missing one)
  2606. .IP \[bu] 2
  2607. \f[C]innertube_host\f[R]: Innertube API host to use for all API
  2608. requests; e.g.
  2609. \f[C]studio.youtube.com\f[R], \f[C]youtubei.googleapis.com\f[R].
  2610. Note that cookies exported from one subdomain will not work on others
  2611. .IP \[bu] 2
  2612. \f[C]innertube_key\f[R]: Innertube API key to use for all API requests.
  2613. By default, no API key is used
  2614. .IP \[bu] 2
  2615. \f[C]raise_incomplete_data\f[R]: \f[C]Incomplete Data Received\f[R]
  2616. raises an error instead of reporting a warning
  2617. .IP \[bu] 2
  2618. \f[C]data_sync_id\f[R]: Overrides the account Data Sync ID used in
  2619. Innertube API requests.
  2620. This may be needed if you are using an account with
  2621. \f[C]youtube:player_skip=webpage,configs\f[R] or
  2622. \f[C]youtubetab:skip=webpage\f[R]
  2623. .IP \[bu] 2
  2624. \f[C]visitor_data\f[R]: Overrides the Visitor Data used in Innertube API
  2625. requests.
  2626. This should be used with \f[C]player_skip=webpage,configs\f[R] and
  2627. without cookies.
  2628. Note: this may have adverse effects if used improperly.
  2629. If a session from a browser is wanted, you should pass cookies instead
  2630. (which contain the Visitor ID)
  2631. .IP \[bu] 2
  2632. \f[C]po_token\f[R]: Proof of Origin (PO) Token(s) to use for requesting
  2633. video playback.
  2634. Comma seperated list of PO Tokens in the format
  2635. \f[C]CLIENT+PO_TOKEN\f[R], e.g.
  2636. \f[C]youtube:po_token=web+XXX,android+YYY\f[R]
  2637. .SS youtubetab (YouTube playlists, channels, feeds, etc.)
  2638. .IP \[bu] 2
  2639. \f[C]skip\f[R]: One or more of \f[C]webpage\f[R] (skip initial webpage
  2640. download), \f[C]authcheck\f[R] (allow the download of playlists
  2641. requiring authentication when no initial webpage is downloaded.
  2642. This may cause unwanted behavior, see
  2643. #1122 (https://github.com/yt-dlp/yt-dlp/pull/1122) for more details)
  2644. .IP \[bu] 2
  2645. \f[C]approximate_date\f[R]: Extract approximate \f[C]upload_date\f[R]
  2646. and \f[C]timestamp\f[R] in flat-playlist.
  2647. This may cause date-based filters to be slightly off
  2648. .SS generic
  2649. .IP \[bu] 2
  2650. \f[C]fragment_query\f[R]: Passthrough any query in mpd/m3u8 manifest
  2651. URLs to their fragments if no value is provided, or else apply the query
  2652. string given as \f[C]fragment_query=VALUE\f[R].
  2653. Note that if the stream has an HLS AES-128 key, then the query
  2654. parameters will be passed to the key URI as well, unless the
  2655. \f[C]key_query\f[R] extractor-arg is passed, or unless an external key
  2656. URI is provided via the \f[C]hls_key\f[R] extractor-arg.
  2657. Does not apply to ffmpeg
  2658. .IP \[bu] 2
  2659. \f[C]variant_query\f[R]: Passthrough the master m3u8 URL query to its
  2660. variant playlist URLs if no value is provided, or else apply the query
  2661. string given as \f[C]variant_query=VALUE\f[R]
  2662. .IP \[bu] 2
  2663. \f[C]key_query\f[R]: Passthrough the master m3u8 URL query to its HLS
  2664. AES-128 decryption key URI if no value is provided, or else apply the
  2665. query string given as \f[C]key_query=VALUE\f[R].
  2666. Note that this will have no effect if the key URI is provided via the
  2667. \f[C]hls_key\f[R] extractor-arg.
  2668. Does not apply to ffmpeg
  2669. .IP \[bu] 2
  2670. \f[C]hls_key\f[R]: An HLS AES-128 key URI \f[I]or\f[R] key (as hex), and
  2671. optionally the IV (as hex), in the form of \f[C](URI|KEY)[,IV]\f[R];
  2672. e.g.
  2673. \f[C]generic:hls_key=ABCDEF1234567980,0xFEDCBA0987654321\f[R].
  2674. Passing any of these values will force usage of the native HLS
  2675. downloader and override the corresponding values found in the m3u8
  2676. playlist
  2677. .IP \[bu] 2
  2678. \f[C]is_live\f[R]: Bypass live HLS detection and manually set
  2679. \f[C]live_status\f[R] - a value of \f[C]false\f[R] will set
  2680. \f[C]not_live\f[R], any other value (or no value) will set
  2681. \f[C]is_live\f[R]
  2682. .IP \[bu] 2
  2683. \f[C]impersonate\f[R]: Target(s) to try and impersonate with the initial
  2684. webpage request; e.g.
  2685. \f[C]generic:impersonate=safari,chrome-110\f[R].
  2686. Use \f[C]generic:impersonate\f[R] to impersonate any available target,
  2687. and use \f[C]generic:impersonate=false\f[R] to disable impersonation
  2688. (default)
  2689. .SS funimation
  2690. .IP \[bu] 2
  2691. \f[C]language\f[R]: Audio languages to extract, e.g.
  2692. \f[C]funimation:language=english,japanese\f[R]
  2693. .IP \[bu] 2
  2694. \f[C]version\f[R]: The video version to extract - \f[C]uncut\f[R] or
  2695. \f[C]simulcast\f[R]
  2696. .SS crunchyrollbeta (Crunchyroll)
  2697. .IP \[bu] 2
  2698. \f[C]hardsub\f[R]: One or more hardsub versions to extract (in order of
  2699. preference), or \f[C]all\f[R] (default: \f[C]None\f[R] = no hardsubs
  2700. will be extracted), e.g.
  2701. \f[C]crunchyrollbeta:hardsub=en-US,de-DE\f[R]
  2702. .SS vikichannel
  2703. .IP \[bu] 2
  2704. \f[C]video_types\f[R]: Types of videos to download - one or more of
  2705. \f[C]episodes\f[R], \f[C]movies\f[R], \f[C]clips\f[R],
  2706. \f[C]trailers\f[R]
  2707. .SS niconico
  2708. .IP \[bu] 2
  2709. \f[C]segment_duration\f[R]: Segment duration in milliseconds for HLS-DMC
  2710. formats.
  2711. Use it at your own risk since this feature \f[B]may result in your
  2712. account termination.\f[R]
  2713. .SS youtubewebarchive
  2714. .IP \[bu] 2
  2715. \f[C]check_all\f[R]: Try to check more at the cost of more requests.
  2716. One or more of \f[C]thumbnails\f[R], \f[C]captures\f[R]
  2717. .SS gamejolt
  2718. .IP \[bu] 2
  2719. \f[C]comment_sort\f[R]: \f[C]hot\f[R] (default), \f[C]you\f[R] (cookies
  2720. needed), \f[C]top\f[R], \f[C]new\f[R] - choose comment sorting mode (on
  2721. GameJolt\[aq]s side)
  2722. .SS hotstar
  2723. .IP \[bu] 2
  2724. \f[C]res\f[R]: resolution to ignore - one or more of \f[C]sd\f[R],
  2725. \f[C]hd\f[R], \f[C]fhd\f[R]
  2726. .IP \[bu] 2
  2727. \f[C]vcodec\f[R]: vcodec to ignore - one or more of \f[C]h264\f[R],
  2728. \f[C]h265\f[R], \f[C]dvh265\f[R]
  2729. .IP \[bu] 2
  2730. \f[C]dr\f[R]: dynamic range to ignore - one or more of \f[C]sdr\f[R],
  2731. \f[C]hdr10\f[R], \f[C]dv\f[R]
  2732. .SS niconicochannelplus
  2733. .IP \[bu] 2
  2734. \f[C]max_comments\f[R]: Maximum number of comments to extract - default
  2735. is \f[C]120\f[R]
  2736. .SS tiktok
  2737. .IP \[bu] 2
  2738. \f[C]api_hostname\f[R]: Hostname to use for mobile API calls, e.g.
  2739. \f[C]api22-normal-c-alisg.tiktokv.com\f[R]
  2740. .IP \[bu] 2
  2741. \f[C]app_name\f[R]: Default app name to use with mobile API calls, e.g.
  2742. \f[C]trill\f[R]
  2743. .IP \[bu] 2
  2744. \f[C]app_version\f[R]: Default app version to use with mobile API calls
  2745. - should be set along with \f[C]manifest_app_version\f[R], e.g.
  2746. \f[C]34.1.2\f[R]
  2747. .IP \[bu] 2
  2748. \f[C]manifest_app_version\f[R]: Default numeric app version to use with
  2749. mobile API calls, e.g.
  2750. \f[C]2023401020\f[R]
  2751. .IP \[bu] 2
  2752. \f[C]aid\f[R]: Default app ID to use with mobile API calls, e.g.
  2753. \f[C]1180\f[R]
  2754. .IP \[bu] 2
  2755. \f[C]app_info\f[R]: Enable mobile API extraction with one or more app
  2756. info strings in the format of
  2757. \f[C]<iid>/[app_name]/[app_version]/[manifest_app_version]/[aid]\f[R],
  2758. where \f[C]iid\f[R] is the unique app install ID.
  2759. \f[C]iid\f[R] is the only required value; all other values and their
  2760. \f[C]/\f[R] separators can be omitted, e.g.
  2761. \f[C]tiktok:app_info=1234567890123456789\f[R] or
  2762. \f[C]tiktok:app_info=123,456/trill///1180,789//34.0.1/340001\f[R]
  2763. .IP \[bu] 2
  2764. \f[C]device_id\f[R]: Enable mobile API extraction with a genuine device
  2765. ID to be used with mobile API calls.
  2766. Default is a random 19-digit string
  2767. .SS rokfinchannel
  2768. .IP \[bu] 2
  2769. \f[C]tab\f[R]: Which tab to download - one of \f[C]new\f[R],
  2770. \f[C]top\f[R], \f[C]videos\f[R], \f[C]podcasts\f[R], \f[C]streams\f[R],
  2771. \f[C]stacks\f[R]
  2772. .SS twitter
  2773. .IP \[bu] 2
  2774. \f[C]api\f[R]: Select one of \f[C]graphql\f[R] (default),
  2775. \f[C]legacy\f[R] or \f[C]syndication\f[R] as the API for tweet
  2776. extraction.
  2777. Has no effect if logged in
  2778. .SS stacommu, wrestleuniverse
  2779. .IP \[bu] 2
  2780. \f[C]device_id\f[R]: UUID value assigned by the website and used to
  2781. enforce device limits for paid livestream content.
  2782. Can be found in browser local storage
  2783. .SS twitch
  2784. .IP \[bu] 2
  2785. \f[C]client_id\f[R]: Client ID value to be sent with GraphQL requests,
  2786. e.g.
  2787. \f[C]twitch:client_id=kimne78kx3ncx6brgo4mv6wki5h1ko\f[R]
  2788. .SS nhkradirulive (NHK \[u3089]\[u3058]\[u308B]\[u2605]\[u3089]\[u3058]\[u308B] LIVE)
  2789. .IP \[bu] 2
  2790. \f[C]area\f[R]: Which regional variation to extract.
  2791. Valid areas are: \f[C]sapporo\f[R], \f[C]sendai\f[R], \f[C]tokyo\f[R],
  2792. \f[C]nagoya\f[R], \f[C]osaka\f[R], \f[C]hiroshima\f[R],
  2793. \f[C]matsuyama\f[R], \f[C]fukuoka\f[R].
  2794. Defaults to \f[C]tokyo\f[R]
  2795. .SS nflplusreplay
  2796. .IP \[bu] 2
  2797. \f[C]type\f[R]: Type(s) of game replays to extract.
  2798. Valid types are: \f[C]full_game\f[R], \f[C]full_game_spanish\f[R],
  2799. \f[C]condensed_game\f[R] and \f[C]all_22\f[R].
  2800. You can use \f[C]all\f[R] to extract all available replay types, which
  2801. is the default
  2802. .SS jiocinema
  2803. .IP \[bu] 2
  2804. \f[C]refresh_token\f[R]: The \f[C]refreshToken\f[R] UUID from browser
  2805. local storage can be passed to extend the life of your login session
  2806. when logging in with \f[C]token\f[R] as username and the
  2807. \f[C]accessToken\f[R] from browser local storage as password
  2808. .SS jiosaavn
  2809. .IP \[bu] 2
  2810. \f[C]bitrate\f[R]: Audio bitrates to request.
  2811. One or more of \f[C]16\f[R], \f[C]32\f[R], \f[C]64\f[R], \f[C]128\f[R],
  2812. \f[C]320\f[R].
  2813. Default is \f[C]128,320\f[R]
  2814. .SS afreecatvlive
  2815. .IP \[bu] 2
  2816. \f[C]cdn\f[R]: One or more CDN IDs to use with the API call for stream
  2817. URLs, e.g.
  2818. \f[C]gcp_cdn\f[R], \f[C]gs_cdn_pc_app\f[R], \f[C]gs_cdn_mobile_web\f[R],
  2819. \f[C]gs_cdn_pc_web\f[R]
  2820. .SS soundcloud
  2821. .IP \[bu] 2
  2822. \f[C]formats\f[R]: Formats to request from the API.
  2823. Requested values should be in the format of
  2824. \f[C]{protocol}_{codec}\f[R], e.g.
  2825. \f[C]hls_opus,http_aac\f[R].
  2826. The \f[C]*\f[R] character functions as a wildcard, e.g.
  2827. \f[C]*_mp3\f[R], and can be passed by itself to request all formats.
  2828. Known protocols include \f[C]http\f[R], \f[C]hls\f[R] and
  2829. \f[C]hls-aes\f[R]; known codecs include \f[C]aac\f[R], \f[C]opus\f[R]
  2830. and \f[C]mp3\f[R].
  2831. Original \f[C]download\f[R] formats are always extracted.
  2832. Default is
  2833. \f[C]http_aac,hls_aac,http_opus,hls_opus,http_mp3,hls_mp3\f[R]
  2834. .SS orfon (orf:on)
  2835. .IP \[bu] 2
  2836. \f[C]prefer_segments_playlist\f[R]: Prefer a playlist of program
  2837. segments instead of a single complete video when available.
  2838. If individual segments are desired, use
  2839. \f[C]--concat-playlist never --extractor-args \[dq]orfon:prefer_segments_playlist\[dq]\f[R]
  2840. .SS bilibili
  2841. .IP \[bu] 2
  2842. \f[C]prefer_multi_flv\f[R]: Prefer extracting flv formats over mp4 for
  2843. older videos that still provide legacy formats
  2844. .SS sonylivseries
  2845. .IP \[bu] 2
  2846. \f[C]sort_order\f[R]: Episode sort order for series extraction - one of
  2847. \f[C]asc\f[R] (ascending, oldest first) or \f[C]desc\f[R] (descending,
  2848. newest first).
  2849. Default is \f[C]asc\f[R]
  2850. .PP
  2851. \f[B]Note\f[R]: These options may be changed/removed in the future
  2852. without concern for backward compatibility
  2853. .SH INSTALLATION
  2854. .PP
  2855. You can install yt-dlp using the binaries,
  2856. pip (https://pypi.org/project/yt-dlp) or one using a third-party package
  2857. manager.
  2858. See the wiki (https://github.com/yt-dlp/yt-dlp/wiki/Installation) for
  2859. detailed instructions
  2860. .PP
  2861. \f[B]Note\f[R]: The manpages, shell completion (autocomplete) files etc.
  2862. are available inside the source
  2863. tarball (https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz)
  2864. .SS UPDATE
  2865. .PP
  2866. You can use \f[C]yt-dlp -U\f[R] to update if you are using the release
  2867. binaries
  2868. .PP
  2869. If you installed with
  2870. pip (https://github.com/yt-dlp/yt-dlp/wiki/Installation#with-pip),
  2871. simply re-run the same command that was used to install the program
  2872. .PP
  2873. For other third-party package managers, see the
  2874. wiki (https://github.com/yt-dlp/yt-dlp/wiki/Installation#third-party-package-managers)
  2875. or refer to their documentation
  2876. .PP
  2877. .PP
  2878. There are currently three release channels for binaries:
  2879. \f[C]stable\f[R], \f[C]nightly\f[R] and \f[C]master\f[R].
  2880. .IP \[bu] 2
  2881. \f[C]stable\f[R] is the default channel, and many of its changes have
  2882. been tested by users of the \f[C]nightly\f[R] and \f[C]master\f[R]
  2883. channels.
  2884. .IP \[bu] 2
  2885. The \f[C]nightly\f[R] channel has releases scheduled to build every day
  2886. around midnight UTC, for a snapshot of the project\[aq]s new patches and
  2887. changes.
  2888. This is the \f[B]recommended channel for regular users\f[R] of yt-dlp.
  2889. The \f[C]nightly\f[R] releases are available from
  2890. yt-dlp/yt-dlp-nightly-builds (https://github.com/yt-dlp/yt-dlp-nightly-builds/releases)
  2891. or as development releases of the \f[C]yt-dlp\f[R] PyPI package (which
  2892. can be installed with pip\[aq]s \f[C]--pre\f[R] flag).
  2893. .IP \[bu] 2
  2894. The \f[C]master\f[R] channel features releases that are built after each
  2895. push to the master branch, and these will have the very latest fixes and
  2896. additions, but may also be more prone to regressions.
  2897. They are available from
  2898. yt-dlp/yt-dlp-master-builds (https://github.com/yt-dlp/yt-dlp-master-builds/releases).
  2899. .PP
  2900. When using \f[C]--update\f[R]/\f[C]-U\f[R], a release binary will only
  2901. update to its current channel.
  2902. \f[C]--update-to CHANNEL\f[R] can be used to switch to a different
  2903. channel when a newer version is available.
  2904. \f[C]--update-to [CHANNEL\[at]]TAG\f[R] can also be used to upgrade or
  2905. downgrade to specific tags from a channel.
  2906. .PP
  2907. You may also use \f[C]--update-to <repository>\f[R]
  2908. (\f[C]<owner>/<repository>\f[R]) to update to a channel on a completely
  2909. different repository.
  2910. Be careful with what repository you are updating to though, there is no
  2911. verification done for binaries from different repositories.
  2912. .PP
  2913. Example usage:
  2914. .IP \[bu] 2
  2915. \f[C]yt-dlp --update-to master\f[R] switch to the \f[C]master\f[R]
  2916. channel and update to its latest release
  2917. .IP \[bu] 2
  2918. \f[C]yt-dlp --update-to stable\[at]2023.07.06\f[R] upgrade/downgrade to
  2919. release to \f[C]stable\f[R] channel tag \f[C]2023.07.06\f[R]
  2920. .IP \[bu] 2
  2921. \f[C]yt-dlp --update-to 2023.10.07\f[R] upgrade/downgrade to tag
  2922. \f[C]2023.10.07\f[R] if it exists on the current channel
  2923. .IP \[bu] 2
  2924. \f[C]yt-dlp --update-to example/yt-dlp\[at]2023.09.24\f[R]
  2925. upgrade/downgrade to the release from the \f[C]example/yt-dlp\f[R]
  2926. repository, tag \f[C]2023.09.24\f[R]
  2927. .PP
  2928. \f[B]Important\f[R]: Any user experiencing an issue with the
  2929. \f[C]stable\f[R] release should install or update to the
  2930. \f[C]nightly\f[R] release before submitting a bug report:
  2931. .IP
  2932. .nf
  2933. \f[C]
  2934. # To update to nightly from stable executable/binary:
  2935. yt-dlp --update-to nightly
  2936. # To install nightly with pip:
  2937. python3 -m pip install -U --pre \[dq]yt-dlp[default]\[dq]
  2938. \f[R]
  2939. .fi
  2940. .SS DEPENDENCIES
  2941. .PP
  2942. Python versions 3.9+ (CPython) and 3.10+ (PyPy) are supported.
  2943. Other versions and implementations may or may not work correctly.
  2944. .PP
  2945. While all the other dependencies are optional, \f[C]ffmpeg\f[R] and
  2946. \f[C]ffprobe\f[R] are highly recommended
  2947. .SS Strongly recommended
  2948. .IP \[bu] 2
  2949. \f[B]ffmpeg\f[R] and \f[B]ffprobe\f[R] (https://www.ffmpeg.org) -
  2950. Required for merging separate video and audio files, as well as for
  2951. various post-processing tasks.
  2952. License depends on the build (https://www.ffmpeg.org/legal.html)
  2953. .RS 2
  2954. .PP
  2955. There are bugs in ffmpeg that cause various issues when used alongside
  2956. yt-dlp.
  2957. Since ffmpeg is such an important dependency, we provide custom
  2958. builds (https://github.com/yt-dlp/FFmpeg-Builds#ffmpeg-static-auto-builds)
  2959. with patches for some of these issues at
  2960. yt-dlp/FFmpeg-Builds (https://github.com/yt-dlp/FFmpeg-Builds).
  2961. See the readme (https://github.com/yt-dlp/FFmpeg-Builds#patches-applied)
  2962. for details on the specific issues solved by these builds
  2963. .PP
  2964. \f[B]Important\f[R]: What you need is ffmpeg \f[I]binary\f[R],
  2965. \f[B]NOT\f[R] the Python package of the same
  2966. name (https://pypi.org/project/ffmpeg)
  2967. .RE
  2968. .SS Networking
  2969. .IP \[bu] 2
  2970. \f[B]certifi\f[R] (https://github.com/certifi/python-certifi)* -
  2971. Provides Mozilla\[aq]s root certificate bundle.
  2972. Licensed under
  2973. MPLv2 (https://github.com/certifi/python-certifi/blob/master/LICENSE)
  2974. .IP \[bu] 2
  2975. \f[B]brotli\f[R] (https://github.com/google/brotli)* or
  2976. \f[B]brotlicffi\f[R] (https://github.com/python-hyper/brotlicffi) -
  2977. Brotli (https://en.wikipedia.org/wiki/Brotli) content encoding support.
  2978. Both licensed under MIT
  2979. 1 (https://github.com/google/brotli/blob/master/LICENSE)
  2980. 2 (https://github.com/python-hyper/brotlicffi/blob/master/LICENSE)
  2981. .IP \[bu] 2
  2982. \f[B]websockets\f[R] (https://github.com/aaugustin/websockets)* - For
  2983. downloading over websocket.
  2984. Licensed under
  2985. BSD-3-Clause (https://github.com/aaugustin/websockets/blob/main/LICENSE)
  2986. .IP \[bu] 2
  2987. \f[B]requests\f[R] (https://github.com/psf/requests)* - HTTP library.
  2988. For HTTPS proxy and persistent connections support.
  2989. Licensed under
  2990. Apache-2.0 (https://github.com/psf/requests/blob/main/LICENSE)
  2991. .SS Impersonation
  2992. .PP
  2993. The following provide support for impersonating browser requests.
  2994. This may be required for some sites that employ TLS fingerprinting.
  2995. .IP \[bu] 2
  2996. \f[B]curl_cffi\f[R] (https://github.com/lexiforest/curl_cffi)
  2997. (recommended) - Python binding for
  2998. curl-impersonate (https://github.com/lexiforest/curl-impersonate).
  2999. Provides impersonation targets for Chrome, Edge and Safari.
  3000. Licensed under
  3001. MIT (https://github.com/lexiforest/curl_cffi/blob/main/LICENSE)
  3002. .RS 2
  3003. .IP \[bu] 2
  3004. Can be installed with the \f[C]curl-cffi\f[R] group, e.g.
  3005. \f[C]pip install \[dq]yt-dlp[default,curl-cffi]\[dq]\f[R]
  3006. .IP \[bu] 2
  3007. Currently included in \f[C]yt-dlp.exe\f[R], \f[C]yt-dlp_linux\f[R] and
  3008. \f[C]yt-dlp_macos\f[R] builds
  3009. .RE
  3010. .SS Metadata
  3011. .IP \[bu] 2
  3012. \f[B]mutagen\f[R] (https://github.com/quodlibet/mutagen)* - For
  3013. \f[C]--embed-thumbnail\f[R] in certain formats.
  3014. Licensed under
  3015. GPLv2+ (https://github.com/quodlibet/mutagen/blob/master/COPYING)
  3016. .IP \[bu] 2
  3017. \f[B]AtomicParsley\f[R] (https://github.com/wez/atomicparsley) - For
  3018. \f[C]--embed-thumbnail\f[R] in \f[C]mp4\f[R]/\f[C]m4a\f[R] files when
  3019. \f[C]mutagen\f[R]/\f[C]ffmpeg\f[R] cannot.
  3020. Licensed under
  3021. GPLv2+ (https://github.com/wez/atomicparsley/blob/master/COPYING)
  3022. .IP \[bu] 2
  3023. \f[B]xattr\f[R] (https://github.com/xattr/xattr),
  3024. \f[B]pyxattr\f[R] (https://github.com/iustin/pyxattr) or
  3025. \f[B]setfattr\f[R] (http://savannah.nongnu.org/projects/attr) - For
  3026. writing xattr metadata (\f[C]--xattr\f[R]) on \f[B]Mac\f[R] and
  3027. \f[B]BSD\f[R].
  3028. Licensed under
  3029. MIT (https://github.com/xattr/xattr/blob/master/LICENSE.txt),
  3030. LGPL2.1 (https://github.com/iustin/pyxattr/blob/master/COPYING) and
  3031. GPLv2+ (http://git.savannah.nongnu.org/cgit/attr.git/tree/doc/COPYING)
  3032. respectively
  3033. .SS Misc
  3034. .IP \[bu] 2
  3035. \f[B]pycryptodomex\f[R] (https://github.com/Legrandin/pycryptodome)* -
  3036. For decrypting AES-128 HLS streams and various other data.
  3037. Licensed under
  3038. BSD-2-Clause (https://github.com/Legrandin/pycryptodome/blob/master/LICENSE.rst)
  3039. .IP \[bu] 2
  3040. \f[B]phantomjs\f[R] (https://github.com/ariya/phantomjs) - Used in
  3041. extractors where javascript needs to be run.
  3042. Licensed under
  3043. BSD-3-Clause (https://github.com/ariya/phantomjs/blob/master/LICENSE.BSD)
  3044. .IP \[bu] 2
  3045. \f[B]secretstorage\f[R] (https://github.com/mitya57/secretstorage)* -
  3046. For \f[C]--cookies-from-browser\f[R] to access the \f[B]Gnome\f[R]
  3047. keyring while decrypting cookies of \f[B]Chromium\f[R]-based browsers on
  3048. \f[B]Linux\f[R].
  3049. Licensed under
  3050. BSD-3-Clause (https://github.com/mitya57/secretstorage/blob/master/LICENSE)
  3051. .IP \[bu] 2
  3052. Any external downloader that you want to use with \f[C]--downloader\f[R]
  3053. .SS Deprecated
  3054. .IP \[bu] 2
  3055. \f[B]avconv\f[R] and \f[B]avprobe\f[R] (https://www.libav.org) - Now
  3056. \f[B]deprecated\f[R] alternative to ffmpeg.
  3057. License depends on the build (https://libav.org/legal)
  3058. .IP \[bu] 2
  3059. \f[B]sponskrub\f[R] (https://github.com/faissaloo/SponSkrub) - For using
  3060. the now \f[B]deprecated\f[R] sponskrub options.
  3061. Licensed under
  3062. GPLv3+ (https://github.com/faissaloo/SponSkrub/blob/master/LICENCE.md)
  3063. .IP \[bu] 2
  3064. \f[B]rtmpdump\f[R] (http://rtmpdump.mplayerhq.hu) - For downloading
  3065. \f[C]rtmp\f[R] streams.
  3066. ffmpeg can be used instead with \f[C]--downloader ffmpeg\f[R].
  3067. Licensed under GPLv2+ (http://rtmpdump.mplayerhq.hu)
  3068. .IP \[bu] 2
  3069. \f[B]mplayer\f[R] (http://mplayerhq.hu/design7/info.html) or
  3070. \f[B]mpv\f[R] (https://mpv.io) - For downloading
  3071. \f[C]rstp\f[R]/\f[C]mms\f[R] streams.
  3072. ffmpeg can be used instead with \f[C]--downloader ffmpeg\f[R].
  3073. Licensed under
  3074. GPLv2+ (https://github.com/mpv-player/mpv/blob/master/Copyright)
  3075. .PP
  3076. To use or redistribute the dependencies, you must agree to their
  3077. respective licensing terms.
  3078. .PP
  3079. The standalone release binaries are built with the Python interpreter
  3080. and the packages marked with \f[B]*\f[R] included.
  3081. .PP
  3082. If you do not have the necessary dependencies for a task you are
  3083. attempting, yt-dlp will warn you.
  3084. All the currently available dependencies are visible at the top of the
  3085. \f[C]--verbose\f[R] output
  3086. .SS COMPILE
  3087. .SS Standalone PyInstaller Builds
  3088. .PP
  3089. To build the standalone executable, you must have Python and
  3090. \f[C]pyinstaller\f[R] (plus any of yt-dlp\[aq]s optional dependencies if
  3091. needed).
  3092. The executable will be built for the same CPU architecture as the Python
  3093. used.
  3094. .PP
  3095. You can run the following commands:
  3096. .IP
  3097. .nf
  3098. \f[C]
  3099. python3 devscripts/install_deps.py --include pyinstaller
  3100. python3 devscripts/make_lazy_extractors.py
  3101. python3 -m bundle.pyinstaller
  3102. \f[R]
  3103. .fi
  3104. .PP
  3105. On some systems, you may need to use \f[C]py\f[R] or \f[C]python\f[R]
  3106. instead of \f[C]python3\f[R].
  3107. .PP
  3108. \f[C]python -m bundle.pyinstaller\f[R] accepts any arguments that can be
  3109. passed to \f[C]pyinstaller\f[R], such as \f[C]--onefile/-F\f[R] or
  3110. \f[C]--onedir/-D\f[R], which is further documented
  3111. here (https://pyinstaller.org/en/stable/usage.html#what-to-generate).
  3112. .PP
  3113. \f[B]Note\f[R]: Pyinstaller versions below 4.4 do not
  3114. support (https://github.com/pyinstaller/pyinstaller#requirements-and-tested-platforms)
  3115. Python installed from the Windows store without using a virtual
  3116. environment.
  3117. .PP
  3118. \f[B]Important\f[R]: Running \f[C]pyinstaller\f[R] directly \f[B]instead
  3119. of\f[R] using \f[C]python -m bundle.pyinstaller\f[R] is \f[B]not\f[R]
  3120. officially supported.
  3121. This may or may not work correctly.
  3122. .SS Platform-independent Binary (UNIX)
  3123. .PP
  3124. You will need the build tools \f[C]python\f[R] (3.9+), \f[C]zip\f[R],
  3125. \f[C]make\f[R] (GNU), \f[C]pandoc\f[R]* and \f[C]pytest\f[R]*.
  3126. .PP
  3127. After installing these, simply run \f[C]make\f[R].
  3128. .PP
  3129. You can also run \f[C]make yt-dlp\f[R] instead to compile only the
  3130. binary without updating any of the additional files.
  3131. (The build tools marked with \f[B]*\f[R] are not needed for this)
  3132. .SS Related scripts
  3133. .IP \[bu] 2
  3134. \f[B]\f[CB]devscripts/install_deps.py\f[B]\f[R] - Install dependencies
  3135. for yt-dlp.
  3136. .IP \[bu] 2
  3137. \f[B]\f[CB]devscripts/update-version.py\f[B]\f[R] - Update the version
  3138. number based on the current date.
  3139. .IP \[bu] 2
  3140. \f[B]\f[CB]devscripts/set-variant.py\f[B]\f[R] - Set the build variant
  3141. of the executable.
  3142. .IP \[bu] 2
  3143. \f[B]\f[CB]devscripts/make_changelog.py\f[B]\f[R] - Create a markdown
  3144. changelog using short commit messages and update \f[C]CONTRIBUTORS\f[R]
  3145. file.
  3146. .IP \[bu] 2
  3147. \f[B]\f[CB]devscripts/make_lazy_extractors.py\f[B]\f[R] - Create lazy
  3148. extractors.
  3149. Running this before building the binaries (any variant) will improve
  3150. their startup performance.
  3151. Set the environment variable \f[C]YTDLP_NO_LAZY_EXTRACTORS\f[R] to
  3152. something nonempty to forcefully disable lazy extractor loading.
  3153. .PP
  3154. Note: See their \f[C]--help\f[R] for more info.
  3155. .SS Forking the project
  3156. .PP
  3157. If you fork the project on GitHub, you can run your fork\[aq]s build
  3158. workflow to automatically build the selected version(s) as artifacts.
  3159. Alternatively, you can run the release workflow or enable the nightly
  3160. workflow to create full (pre-)releases.
  3161. .SH PLUGINS
  3162. .PP
  3163. Note that \f[B]all\f[R] plugins are imported even if not invoked, and
  3164. that \f[B]there are no checks\f[R] performed on plugin code.
  3165. \f[B]Use plugins at your own risk and only if you trust the code!\f[R]
  3166. .PP
  3167. Plugins can be of \f[C]<type>\f[R]s \f[C]extractor\f[R] or
  3168. \f[C]postprocessor\f[R].
  3169. - Extractor plugins do not need to be enabled from the CLI and are
  3170. automatically invoked when the input URL is suitable for it.
  3171. - Extractor plugins take priority over built-in extractors.
  3172. - Postprocessor plugins can be invoked using
  3173. \f[C]--use-postprocessor NAME\f[R].
  3174. .PP
  3175. Plugins are loaded from the namespace packages
  3176. \f[C]yt_dlp_plugins.extractor\f[R] and
  3177. \f[C]yt_dlp_plugins.postprocessor\f[R].
  3178. .PP
  3179. In other words, the file structure on the disk looks something like:
  3180. .IP
  3181. .nf
  3182. \f[C]
  3183. yt_dlp_plugins/
  3184. extractor/
  3185. myplugin.py
  3186. postprocessor/
  3187. myplugin.py
  3188. \f[R]
  3189. .fi
  3190. .PP
  3191. yt-dlp looks for these \f[C]yt_dlp_plugins\f[R] namespace folders in
  3192. many locations (see below) and loads in plugins from \f[B]all\f[R] of
  3193. them.
  3194. Set the environment variable \f[C]YTDLP_NO_PLUGINS\f[R] to something
  3195. nonempty to disable loading plugins entirely.
  3196. .PP
  3197. See the wiki for some known
  3198. plugins (https://github.com/yt-dlp/yt-dlp/wiki/Plugins)
  3199. .SS Installing Plugins
  3200. .PP
  3201. Plugins can be installed using various methods and locations.
  3202. .IP "1." 3
  3203. \f[B]Configuration directories\f[R]: Plugin packages (containing a
  3204. \f[C]yt_dlp_plugins\f[R] namespace folder) can be dropped into the
  3205. following standard configuration locations:
  3206. .RS 4
  3207. .IP \[bu] 2
  3208. \f[B]User Plugins\f[R]
  3209. .RS 2
  3210. .IP \[bu] 2
  3211. \f[C]${XDG_CONFIG_HOME}/yt-dlp/plugins/<package name>/yt_dlp_plugins/\f[R]
  3212. (recommended on Linux/macOS)
  3213. .IP \[bu] 2
  3214. \f[C]${XDG_CONFIG_HOME}/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3215. .IP \[bu] 2
  3216. \f[C]${APPDATA}/yt-dlp/plugins/<package name>/yt_dlp_plugins/\f[R]
  3217. (recommended on Windows)
  3218. .IP \[bu] 2
  3219. \f[C]${APPDATA}/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3220. .IP \[bu] 2
  3221. \f[C]\[ti]/.yt-dlp/plugins/<package name>/yt_dlp_plugins/\f[R]
  3222. .IP \[bu] 2
  3223. \f[C]\[ti]/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3224. .RE
  3225. .IP \[bu] 2
  3226. \f[B]System Plugins\f[R]
  3227. .RS 2
  3228. .IP \[bu] 2
  3229. \f[C]/etc/yt-dlp/plugins/<package name>/yt_dlp_plugins/\f[R]
  3230. .IP \[bu] 2
  3231. \f[C]/etc/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3232. .RE
  3233. .RE
  3234. .IP "2." 3
  3235. \f[B]Executable location\f[R]: Plugin packages can similarly be
  3236. installed in a \f[C]yt-dlp-plugins\f[R] directory under the executable
  3237. location (recommended for portable installations):
  3238. .RS 4
  3239. .IP \[bu] 2
  3240. Binary: where \f[C]<root-dir>/yt-dlp.exe\f[R],
  3241. \f[C]<root-dir>/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3242. .IP \[bu] 2
  3243. Source: where \f[C]<root-dir>/yt_dlp/__main__.py\f[R],
  3244. \f[C]<root-dir>/yt-dlp-plugins/<package name>/yt_dlp_plugins/\f[R]
  3245. .RE
  3246. .IP "3." 3
  3247. \f[B]pip and other locations in \f[CB]PYTHONPATH\f[B]\f[R]
  3248. .RS 4
  3249. .IP \[bu] 2
  3250. Plugin packages can be installed and managed using \f[C]pip\f[R].
  3251. See
  3252. yt-dlp-sample-plugins (https://github.com/yt-dlp/yt-dlp-sample-plugins)
  3253. for an example.
  3254. .RS 2
  3255. .IP \[bu] 2
  3256. Note: plugin files between plugin packages installed with pip must have
  3257. unique filenames.
  3258. .RE
  3259. .IP \[bu] 2
  3260. Any path in \f[C]PYTHONPATH\f[R] is searched in for the
  3261. \f[C]yt_dlp_plugins\f[R] namespace folder.
  3262. .RS 2
  3263. .IP \[bu] 2
  3264. Note: This does not apply for Pyinstaller builds.
  3265. .RE
  3266. .RE
  3267. .PP
  3268. \f[C].zip\f[R], \f[C].egg\f[R] and \f[C].whl\f[R] archives containing a
  3269. \f[C]yt_dlp_plugins\f[R] namespace folder in their root are also
  3270. supported as plugin packages.
  3271. .IP \[bu] 2
  3272. e.g.
  3273. \f[C]${XDG_CONFIG_HOME}/yt-dlp/plugins/mypluginpkg.zip\f[R] where
  3274. \f[C]mypluginpkg.zip\f[R] contains
  3275. \f[C]yt_dlp_plugins/<type>/myplugin.py\f[R]
  3276. .PP
  3277. Run yt-dlp with \f[C]--verbose\f[R] to check if the plugin has been
  3278. loaded.
  3279. .SS Developing Plugins
  3280. .PP
  3281. See the
  3282. yt-dlp-sample-plugins (https://github.com/yt-dlp/yt-dlp-sample-plugins)
  3283. repo for a template plugin package and the Plugin
  3284. Development (https://github.com/yt-dlp/yt-dlp/wiki/Plugin-Development)
  3285. section of the wiki for a plugin development guide.
  3286. .PP
  3287. All public classes with a name ending in \f[C]IE\f[R]/\f[C]PP\f[R] are
  3288. imported from each file for extractors and postprocessors respectively.
  3289. This respects underscore prefix (e.g.
  3290. \f[C]_MyBasePluginIE\f[R] is private) and \f[C]__all__\f[R].
  3291. Modules can similarly be excluded by prefixing the module name with an
  3292. underscore (e.g.
  3293. \f[C]_myplugin.py\f[R]).
  3294. .PP
  3295. To replace an existing extractor with a subclass of one, set the
  3296. \f[C]plugin_name\f[R] class keyword argument (e.g.
  3297. \f[C]class MyPluginIE(ABuiltInIE, plugin_name=\[aq]myplugin\[aq])\f[R]
  3298. will replace \f[C]ABuiltInIE\f[R] with \f[C]MyPluginIE\f[R]).
  3299. Since the extractor replaces the parent, you should exclude the subclass
  3300. extractor from being imported separately by making it private using one
  3301. of the methods described above.
  3302. .PP
  3303. If you are a plugin author, add
  3304. yt-dlp-plugins (https://github.com/topics/yt-dlp-plugins) as a topic to
  3305. your repository for discoverability.
  3306. .PP
  3307. See the Developer
  3308. Instructions (https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#developer-instructions)
  3309. on how to write and test an extractor.
  3310. .SH EMBEDDING YT-DLP
  3311. .PP
  3312. yt-dlp makes the best effort to be a good command-line program, and thus
  3313. should be callable from any programming language.
  3314. .PP
  3315. Your program should avoid parsing the normal stdout since they may
  3316. change in future versions.
  3317. Instead, they should use options such as \f[C]-J\f[R],
  3318. \f[C]--print\f[R], \f[C]--progress-template\f[R], \f[C]--exec\f[R] etc
  3319. to create console output that you can reliably reproduce and parse.
  3320. .PP
  3321. From a Python program, you can embed yt-dlp in a more powerful fashion,
  3322. like this:
  3323. .IP
  3324. .nf
  3325. \f[C]
  3326. from yt_dlp import YoutubeDL
  3327. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3328. with YoutubeDL() as ydl:
  3329. ydl.download(URLS)
  3330. \f[R]
  3331. .fi
  3332. .PP
  3333. Most likely, you\[aq]ll want to use various options.
  3334. For a list of options available, have a look at
  3335. \f[C]yt_dlp/YoutubeDL.py\f[R] or \f[C]help(yt_dlp.YoutubeDL)\f[R] in a
  3336. Python shell.
  3337. If you are already familiar with the CLI, you can use
  3338. \f[C]devscripts/cli_to_api.py\f[R] (https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/cli_to_api.py)
  3339. to translate any CLI switches to \f[C]YoutubeDL\f[R] params.
  3340. .PP
  3341. \f[B]Tip\f[R]: If you are porting your code from youtube-dl to yt-dlp,
  3342. one important point to look out for is that we do not guarantee the
  3343. return value of \f[C]YoutubeDL.extract_info\f[R] to be json
  3344. serializable, or even be a dictionary.
  3345. It will be dictionary-like, but if you want to ensure it is a
  3346. serializable dictionary, pass it through
  3347. \f[C]YoutubeDL.sanitize_info\f[R] as shown in the example below
  3348. .SS Embedding examples
  3349. .SS Extracting information
  3350. .IP
  3351. .nf
  3352. \f[C]
  3353. import json
  3354. import yt_dlp
  3355. URL = \[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]
  3356. # \[u2139]\[uFE0F] See help(yt_dlp.YoutubeDL) for a list of available options and public functions
  3357. ydl_opts = {}
  3358. with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  3359. info = ydl.extract_info(URL, download=False)
  3360. # \[u2139]\[uFE0F] ydl.sanitize_info makes the info json-serializable
  3361. print(json.dumps(ydl.sanitize_info(info)))
  3362. \f[R]
  3363. .fi
  3364. .SS Download using an info-json
  3365. .IP
  3366. .nf
  3367. \f[C]
  3368. import yt_dlp
  3369. INFO_FILE = \[aq]path/to/video.info.json\[aq]
  3370. with yt_dlp.YoutubeDL() as ydl:
  3371. error_code = ydl.download_with_info_file(INFO_FILE)
  3372. print(\[aq]Some videos failed to download\[aq] if error_code
  3373. else \[aq]All videos successfully downloaded\[aq])
  3374. \f[R]
  3375. .fi
  3376. .SS Extract audio
  3377. .IP
  3378. .nf
  3379. \f[C]
  3380. import yt_dlp
  3381. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3382. ydl_opts = {
  3383. \[aq]format\[aq]: \[aq]m4a/bestaudio/best\[aq],
  3384. # \[u2139]\[uFE0F] See help(yt_dlp.postprocessor) for a list of available Postprocessors and their arguments
  3385. \[aq]postprocessors\[aq]: [{ # Extract audio using ffmpeg
  3386. \[aq]key\[aq]: \[aq]FFmpegExtractAudio\[aq],
  3387. \[aq]preferredcodec\[aq]: \[aq]m4a\[aq],
  3388. }]
  3389. }
  3390. with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  3391. error_code = ydl.download(URLS)
  3392. \f[R]
  3393. .fi
  3394. .SS Filter videos
  3395. .IP
  3396. .nf
  3397. \f[C]
  3398. import yt_dlp
  3399. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3400. def longer_than_a_minute(info, *, incomplete):
  3401. \[dq]\[dq]\[dq]Download only videos longer than a minute (or with unknown duration)\[dq]\[dq]\[dq]
  3402. duration = info.get(\[aq]duration\[aq])
  3403. if duration and duration < 60:
  3404. return \[aq]The video is too short\[aq]
  3405. ydl_opts = {
  3406. \[aq]match_filter\[aq]: longer_than_a_minute,
  3407. }
  3408. with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  3409. error_code = ydl.download(URLS)
  3410. \f[R]
  3411. .fi
  3412. .SS Adding logger and progress hook
  3413. .IP
  3414. .nf
  3415. \f[C]
  3416. import yt_dlp
  3417. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3418. class MyLogger:
  3419. def debug(self, msg):
  3420. # For compatibility with youtube-dl, both debug and info are passed into debug
  3421. # You can distinguish them by the prefix \[aq][debug] \[aq]
  3422. if msg.startswith(\[aq][debug] \[aq]):
  3423. pass
  3424. else:
  3425. self.info(msg)
  3426. def info(self, msg):
  3427. pass
  3428. def warning(self, msg):
  3429. pass
  3430. def error(self, msg):
  3431. print(msg)
  3432. # \[u2139]\[uFE0F] See \[dq]progress_hooks\[dq] in help(yt_dlp.YoutubeDL)
  3433. def my_hook(d):
  3434. if d[\[aq]status\[aq]] == \[aq]finished\[aq]:
  3435. print(\[aq]Done downloading, now post-processing ...\[aq])
  3436. ydl_opts = {
  3437. \[aq]logger\[aq]: MyLogger(),
  3438. \[aq]progress_hooks\[aq]: [my_hook],
  3439. }
  3440. with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  3441. ydl.download(URLS)
  3442. \f[R]
  3443. .fi
  3444. .SS Add a custom PostProcessor
  3445. .IP
  3446. .nf
  3447. \f[C]
  3448. import yt_dlp
  3449. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3450. # \[u2139]\[uFE0F] See help(yt_dlp.postprocessor.PostProcessor)
  3451. class MyCustomPP(yt_dlp.postprocessor.PostProcessor):
  3452. def run(self, info):
  3453. self.to_screen(\[aq]Doing stuff\[aq])
  3454. return [], info
  3455. with yt_dlp.YoutubeDL() as ydl:
  3456. # \[u2139]\[uFE0F] \[dq]when\[dq] can take any value in yt_dlp.utils.POSTPROCESS_WHEN
  3457. ydl.add_post_processor(MyCustomPP(), when=\[aq]pre_process\[aq])
  3458. ydl.download(URLS)
  3459. \f[R]
  3460. .fi
  3461. .SS Use a custom format selector
  3462. .IP
  3463. .nf
  3464. \f[C]
  3465. import yt_dlp
  3466. URLS = [\[aq]https://www.youtube.com/watch?v=BaW_jenozKc\[aq]]
  3467. def format_selector(ctx):
  3468. \[dq]\[dq]\[dq] Select the best video and the best audio that won\[aq]t result in an mkv.
  3469. NOTE: This is just an example and does not handle all cases \[dq]\[dq]\[dq]
  3470. # formats are already sorted worst to best
  3471. formats = ctx.get(\[aq]formats\[aq])[::-1]
  3472. # acodec=\[aq]none\[aq] means there is no audio
  3473. best_video = next(f for f in formats
  3474. if f[\[aq]vcodec\[aq]] != \[aq]none\[aq] and f[\[aq]acodec\[aq]] == \[aq]none\[aq])
  3475. # find compatible audio extension
  3476. audio_ext = {\[aq]mp4\[aq]: \[aq]m4a\[aq], \[aq]webm\[aq]: \[aq]webm\[aq]}[best_video[\[aq]ext\[aq]]]
  3477. # vcodec=\[aq]none\[aq] means there is no video
  3478. best_audio = next(f for f in formats if (
  3479. f[\[aq]acodec\[aq]] != \[aq]none\[aq] and f[\[aq]vcodec\[aq]] == \[aq]none\[aq] and f[\[aq]ext\[aq]] == audio_ext))
  3480. # These are the minimum required fields for a merged format
  3481. yield {
  3482. \[aq]format_id\[aq]: f\[aq]{best_video[\[dq]format_id\[dq]]}+{best_audio[\[dq]format_id\[dq]]}\[aq],
  3483. \[aq]ext\[aq]: best_video[\[aq]ext\[aq]],
  3484. \[aq]requested_formats\[aq]: [best_video, best_audio],
  3485. # Must be + separated list of protocols
  3486. \[aq]protocol\[aq]: f\[aq]{best_video[\[dq]protocol\[dq]]}+{best_audio[\[dq]protocol\[dq]]}\[aq]
  3487. }
  3488. ydl_opts = {
  3489. \[aq]format\[aq]: format_selector,
  3490. }
  3491. with yt_dlp.YoutubeDL(ydl_opts) as ydl:
  3492. ydl.download(URLS)
  3493. \f[R]
  3494. .fi
  3495. .SH CHANGES FROM YOUTUBE-DL
  3496. .SS New features
  3497. .IP \[bu] 2
  3498. Forked from
  3499. \f[B]yt-dlc\[at]f9401f2\f[R] (https://github.com/blackjack4494/yt-dlc/commit/f9401f2a91987068139c5f757b12fc711d4c0cee)
  3500. and merged with
  3501. \f[B]youtube-dl\[at]a08f2b7\f[R] (https://github.com/ytdl-org/youtube-dl/commit/a08f2b7e4567cdc50c0614ee0a4ffdff49b8b6e6)
  3502. (exceptions (https://github.com/yt-dlp/yt-dlp/issues/21))
  3503. .IP \[bu] 2
  3504. \f[B]SponsorBlock Integration\f[R]: You can mark/remove sponsor sections
  3505. in YouTube videos by utilizing the
  3506. SponsorBlock (https://sponsor.ajay.app) API
  3507. .IP \[bu] 2
  3508. \f[B]Format Sorting\f[R]: The default format sorting options have been
  3509. changed so that higher resolution and better codecs will be now
  3510. preferred instead of simply using larger bitrate.
  3511. Furthermore, you can now specify the sort order using \f[C]-S\f[R].
  3512. This allows for much easier format selection than what is possible by
  3513. simply using \f[C]--format\f[R] (examples)
  3514. .IP \[bu] 2
  3515. \f[B]Merged with animelover1984/youtube-dl\f[R]: You get most of the
  3516. features and improvements from
  3517. animelover1984/youtube-dl (https://github.com/animelover1984/youtube-dl)
  3518. including \f[C]--write-comments\f[R], \f[C]BiliBiliSearch\f[R],
  3519. \f[C]BilibiliChannel\f[R], Embedding thumbnail in mp4/ogg/opus, playlist
  3520. infojson etc.
  3521. Note that NicoNico livestreams are not available.
  3522. See #31 (https://github.com/yt-dlp/yt-dlp/pull/31) for details.
  3523. .IP \[bu] 2
  3524. \f[B]YouTube improvements\f[R]:
  3525. .RS 2
  3526. .IP \[bu] 2
  3527. Supports Clips, Stories (\f[C]ytstories:<channel UCID>\f[R]), Search
  3528. (including filters)\f[B]*\f[R], YouTube Music Search, Channel-specific
  3529. search, Search prefixes (\f[C]ytsearch:\f[R],
  3530. \f[C]ytsearchdate:\f[R])\f[B]*\f[R], Mixes, and Feeds (\f[C]:ytfav\f[R],
  3531. \f[C]:ytwatchlater\f[R], \f[C]:ytsubs\f[R], \f[C]:ythistory\f[R],
  3532. \f[C]:ytrec\f[R], \f[C]:ytnotif\f[R])
  3533. .IP \[bu] 2
  3534. Fix for n-sig based
  3535. throttling (https://github.com/ytdl-org/youtube-dl/issues/29326)
  3536. \f[B]*\f[R]
  3537. .IP \[bu] 2
  3538. Download livestreams from the start using \f[C]--live-from-start\f[R]
  3539. (\f[I]experimental\f[R])
  3540. .IP \[bu] 2
  3541. Channel URLs download all uploads of the channel, including shorts and
  3542. live
  3543. .IP \[bu] 2
  3544. Support for logging in with
  3545. OAuth (https://github.com/yt-dlp/yt-dlp/wiki/Extractors#logging-in-with-oauth)
  3546. .RE
  3547. .IP \[bu] 2
  3548. \f[B]Cookies from browser\f[R]: Cookies can be automatically extracted
  3549. from all major web browsers using
  3550. \f[C]--cookies-from-browser BROWSER[+KEYRING][:PROFILE][::CONTAINER]\f[R]
  3551. .IP \[bu] 2
  3552. \f[B]Download time range\f[R]: Videos can be downloaded partially based
  3553. on either timestamps or chapters using \f[C]--download-sections\f[R]
  3554. .IP \[bu] 2
  3555. \f[B]Split video by chapters\f[R]: Videos can be split into multiple
  3556. files based on chapters using \f[C]--split-chapters\f[R]
  3557. .IP \[bu] 2
  3558. \f[B]Multi-threaded fragment downloads\f[R]: Download multiple fragments
  3559. of m3u8/mpd videos in parallel.
  3560. Use \f[C]--concurrent-fragments\f[R] (\f[C]-N\f[R]) option to set the
  3561. number of threads used
  3562. .IP \[bu] 2
  3563. \f[B]Aria2c with HLS/DASH\f[R]: You can use \f[C]aria2c\f[R] as the
  3564. external downloader for DASH(mpd) and HLS(m3u8) formats
  3565. .IP \[bu] 2
  3566. \f[B]New and fixed extractors\f[R]: Many new extractors have been added
  3567. and a lot of existing ones have been fixed.
  3568. See the changelog or the list of supported sites
  3569. .IP \[bu] 2
  3570. \f[B]New MSOs\f[R]: Philo, Spectrum, SlingTV, Cablevision, RCN etc.
  3571. .IP \[bu] 2
  3572. \f[B]Subtitle extraction from manifests\f[R]: Subtitles can be extracted
  3573. from streaming media manifests.
  3574. See
  3575. commit/be6202f (https://github.com/yt-dlp/yt-dlp/commit/be6202f12b97858b9d716e608394b51065d0419f)
  3576. for details
  3577. .IP \[bu] 2
  3578. \f[B]Multiple paths and output templates\f[R]: You can give different
  3579. output templates and download paths for different types of files.
  3580. You can also set a temporary path where intermediary files are
  3581. downloaded to using \f[C]--paths\f[R] (\f[C]-P\f[R])
  3582. .IP \[bu] 2
  3583. \f[B]Portable Configuration\f[R]: Configuration files are automatically
  3584. loaded from the home and root directories.
  3585. See CONFIGURATION for details
  3586. .IP \[bu] 2
  3587. \f[B]Output template improvements\f[R]: Output templates can now have
  3588. date-time formatting, numeric offsets, object traversal etc.
  3589. See output template for details.
  3590. Even more advanced operations can also be done with the help of
  3591. \f[C]--parse-metadata\f[R] and \f[C]--replace-in-metadata\f[R]
  3592. .IP \[bu] 2
  3593. \f[B]Other new options\f[R]: Many new options have been added such as
  3594. \f[C]--alias\f[R], \f[C]--print\f[R], \f[C]--concat-playlist\f[R],
  3595. \f[C]--wait-for-video\f[R], \f[C]--retry-sleep\f[R],
  3596. \f[C]--sleep-requests\f[R], \f[C]--convert-thumbnails\f[R],
  3597. \f[C]--force-download-archive\f[R], \f[C]--force-overwrites\f[R],
  3598. \f[C]--break-match-filters\f[R] etc
  3599. .IP \[bu] 2
  3600. \f[B]Improvements\f[R]: Regex and other operators in
  3601. \f[C]--format\f[R]/\f[C]--match-filters\f[R], multiple
  3602. \f[C]--postprocessor-args\f[R] and \f[C]--downloader-args\f[R], faster
  3603. archive checking, more format selection options, merge
  3604. multi-video/audio, multiple \f[C]--config-locations\f[R],
  3605. \f[C]--exec\f[R] at different stages, etc
  3606. .IP \[bu] 2
  3607. \f[B]Plugins\f[R]: Extractors and PostProcessors can be loaded from an
  3608. external file.
  3609. See plugins for details
  3610. .IP \[bu] 2
  3611. \f[B]Self updater\f[R]: The releases can be updated using
  3612. \f[C]yt-dlp -U\f[R], and downgraded using \f[C]--update-to\f[R] if
  3613. required
  3614. .IP \[bu] 2
  3615. \f[B]Automated builds\f[R]: Nightly/master builds can be used with
  3616. \f[C]--update-to nightly\f[R] and \f[C]--update-to master\f[R]
  3617. .PP
  3618. See changelog or commits (https://github.com/yt-dlp/yt-dlp/commits) for
  3619. the full list of changes
  3620. .PP
  3621. Features marked with a \f[B]*\f[R] have been back-ported to youtube-dl
  3622. .SS Differences in default behavior
  3623. .PP
  3624. Some of yt-dlp\[aq]s default options are different from that of
  3625. youtube-dl and youtube-dlc:
  3626. .IP \[bu] 2
  3627. yt-dlp supports only Python 3.9+, and will remove support for more
  3628. versions as they become
  3629. EOL (https://devguide.python.org/versions/#python-release-cycle); while
  3630. youtube-dl still supports Python 2.6+ and
  3631. 3.2+ (https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743)
  3632. .IP \[bu] 2
  3633. The options \f[C]--auto-number\f[R] (\f[C]-A\f[R]), \f[C]--title\f[R]
  3634. (\f[C]-t\f[R]) and \f[C]--literal\f[R] (\f[C]-l\f[R]), no longer work.
  3635. See removed options for details
  3636. .IP \[bu] 2
  3637. \f[C]avconv\f[R] is not supported as an alternative to \f[C]ffmpeg\f[R]
  3638. .IP \[bu] 2
  3639. yt-dlp stores config files in slightly different locations to
  3640. youtube-dl.
  3641. See CONFIGURATION for a list of correct locations
  3642. .IP \[bu] 2
  3643. The default output template is \f[C]%(title)s [%(id)s].%(ext)s\f[R].
  3644. There is no real reason for this change.
  3645. This was changed before yt-dlp was ever made public and now there are no
  3646. plans to change it back to \f[C]%(title)s-%(id)s.%(ext)s\f[R].
  3647. Instead, you may use \f[C]--compat-options filename\f[R]
  3648. .IP \[bu] 2
  3649. The default format sorting is different from youtube-dl and prefers
  3650. higher resolution and better codecs rather than higher bitrates.
  3651. You can use the \f[C]--format-sort\f[R] option to change this to any
  3652. order you prefer, or use \f[C]--compat-options format-sort\f[R] to use
  3653. youtube-dl\[aq]s sorting order.
  3654. Older versions of yt-dlp preferred VP9 due to its broader compatibility;
  3655. you can use \f[C]--compat-options prefer-vp9-sort\f[R] to revert to that
  3656. format sorting preference.
  3657. These two compat options cannot be used together
  3658. .IP \[bu] 2
  3659. The default format selector is \f[C]bv*+ba/b\f[R].
  3660. This means that if a combined video + audio format that is better than
  3661. the best video-only format is found, the former will be preferred.
  3662. Use \f[C]-f bv+ba/b\f[R] or \f[C]--compat-options format-spec\f[R] to
  3663. revert this
  3664. .IP \[bu] 2
  3665. Unlike youtube-dlc, yt-dlp does not allow merging multiple audio/video
  3666. streams into one file by default (since this conflicts with the use of
  3667. \f[C]-f bv*+ba\f[R]).
  3668. If needed, this feature must be enabled using
  3669. \f[C]--audio-multistreams\f[R] and \f[C]--video-multistreams\f[R].
  3670. You can also use \f[C]--compat-options multistreams\f[R] to enable both
  3671. .IP \[bu] 2
  3672. \f[C]--no-abort-on-error\f[R] is enabled by default.
  3673. Use \f[C]--abort-on-error\f[R] or
  3674. \f[C]--compat-options abort-on-error\f[R] to abort on errors instead
  3675. .IP \[bu] 2
  3676. When writing metadata files such as thumbnails, description or infojson,
  3677. the same information (if available) is also written for playlists.
  3678. Use \f[C]--no-write-playlist-metafiles\f[R] or
  3679. \f[C]--compat-options no-playlist-metafiles\f[R] to not write these
  3680. files
  3681. .IP \[bu] 2
  3682. \f[C]--add-metadata\f[R] attaches the \f[C]infojson\f[R] to
  3683. \f[C]mkv\f[R] files in addition to writing the metadata when used with
  3684. \f[C]--write-info-json\f[R].
  3685. Use \f[C]--no-embed-info-json\f[R] or
  3686. \f[C]--compat-options no-attach-info-json\f[R] to revert this
  3687. .IP \[bu] 2
  3688. Some metadata are embedded into different fields when using
  3689. \f[C]--add-metadata\f[R] as compared to youtube-dl.
  3690. Most notably, \f[C]comment\f[R] field contains the \f[C]webpage_url\f[R]
  3691. and \f[C]synopsis\f[R] contains the \f[C]description\f[R].
  3692. You can use \f[C]--parse-metadata\f[R] to modify this to your liking or
  3693. use \f[C]--compat-options embed-metadata\f[R] to revert this
  3694. .IP \[bu] 2
  3695. \f[C]playlist_index\f[R] behaves differently when used with options like
  3696. \f[C]--playlist-reverse\f[R] and \f[C]--playlist-items\f[R].
  3697. See #302 (https://github.com/yt-dlp/yt-dlp/issues/302) for details.
  3698. You can use \f[C]--compat-options playlist-index\f[R] if you want to
  3699. keep the earlier behavior
  3700. .IP \[bu] 2
  3701. The output of \f[C]-F\f[R] is listed in a new format.
  3702. Use \f[C]--compat-options list-formats\f[R] to revert this
  3703. .IP \[bu] 2
  3704. Live chats (if available) are considered as subtitles.
  3705. Use \f[C]--sub-langs all,-live_chat\f[R] to download all subtitles
  3706. except live chat.
  3707. You can also use \f[C]--compat-options no-live-chat\f[R] to prevent any
  3708. live chat/danmaku from downloading
  3709. .IP \[bu] 2
  3710. YouTube channel URLs download all uploads of the channel.
  3711. To download only the videos in a specific tab, pass the tab\[aq]s URL.
  3712. If the channel does not show the requested tab, an error will be raised.
  3713. Also, \f[C]/live\f[R] URLs raise an error if there are no live videos
  3714. instead of silently downloading the entire channel.
  3715. You may use \f[C]--compat-options no-youtube-channel-redirect\f[R] to
  3716. revert all these redirections
  3717. .IP \[bu] 2
  3718. Unavailable videos are also listed for YouTube playlists.
  3719. Use \f[C]--compat-options no-youtube-unavailable-videos\f[R] to remove
  3720. this
  3721. .IP \[bu] 2
  3722. The upload dates extracted from YouTube are in UTC when
  3723. available (https://github.com/yt-dlp/yt-dlp/blob/89e4d86171c7b7c997c77d4714542e0383bf0db0/yt_dlp/extractor/youtube.py#L3898-L3900).
  3724. Use \f[C]--compat-options no-youtube-prefer-utc-upload-date\f[R] to
  3725. prefer the non-UTC upload date.
  3726. .IP \[bu] 2
  3727. If \f[C]ffmpeg\f[R] is used as the downloader, the downloading and
  3728. merging of formats happen in a single step when possible.
  3729. Use \f[C]--compat-options no-direct-merge\f[R] to revert this
  3730. .IP \[bu] 2
  3731. Thumbnail embedding in \f[C]mp4\f[R] is done with mutagen if possible.
  3732. Use \f[C]--compat-options embed-thumbnail-atomicparsley\f[R] to force
  3733. the use of AtomicParsley instead
  3734. .IP \[bu] 2
  3735. Some internal metadata such as filenames are removed by default from the
  3736. infojson.
  3737. Use \f[C]--no-clean-infojson\f[R] or
  3738. \f[C]--compat-options no-clean-infojson\f[R] to revert this
  3739. .IP \[bu] 2
  3740. When \f[C]--embed-subs\f[R] and \f[C]--write-subs\f[R] are used
  3741. together, the subtitles are written to disk and also embedded in the
  3742. media file.
  3743. You can use just \f[C]--embed-subs\f[R] to embed the subs and
  3744. automatically delete the separate file.
  3745. See #630
  3746. (comment) (https://github.com/yt-dlp/yt-dlp/issues/630#issuecomment-893659460)
  3747. for more info.
  3748. \f[C]--compat-options no-keep-subs\f[R] can be used to revert this
  3749. .IP \[bu] 2
  3750. \f[C]certifi\f[R] will be used for SSL root certificates, if installed.
  3751. If you want to use system certificates (e.g.
  3752. self-signed), use \f[C]--compat-options no-certifi\f[R]
  3753. .IP \[bu] 2
  3754. yt-dlp\[aq]s sanitization of invalid characters in filenames is
  3755. different/smarter than in youtube-dl.
  3756. You can use \f[C]--compat-options filename-sanitization\f[R] to revert
  3757. to youtube-dl\[aq]s behavior
  3758. .IP \[bu] 2
  3759. [STRIKEOUT:yt-dlp tries to parse the external downloader outputs into
  3760. the standard progress output if possible (Currently implemented:
  3761. aria2c (https://github.com/yt-dlp/yt-dlp/issues/5931)). You can use
  3762. \f[C]--compat-options no-external-downloader-progress\f[R] to get the
  3763. downloader output as-is]
  3764. .IP \[bu] 2
  3765. yt-dlp versions between 2021.09.01 and 2023.01.02 applies
  3766. \f[C]--match-filters\f[R] to nested playlists.
  3767. This was an unintentional side-effect of
  3768. 8f18ac (https://github.com/yt-dlp/yt-dlp/commit/8f18aca8717bb0dd49054555af8d386e5eda3a88)
  3769. and is fixed in
  3770. d7b460 (https://github.com/yt-dlp/yt-dlp/commit/d7b460d0e5fc710950582baed2e3fc616ed98a80).
  3771. Use \f[C]--compat-options playlist-match-filter\f[R] to revert this
  3772. .IP \[bu] 2
  3773. yt-dlp versions between 2021.11.10 and 2023.06.21 estimated
  3774. \f[C]filesize_approx\f[R] values for fragmented/manifest formats.
  3775. This was added for convenience in
  3776. f2fe69 (https://github.com/yt-dlp/yt-dlp/commit/f2fe69c7b0d208bdb1f6292b4ae92bc1e1a7444a),
  3777. but was reverted in
  3778. 0dff8e (https://github.com/yt-dlp/yt-dlp/commit/0dff8e4d1e6e9fb938f4256ea9af7d81f42fd54f)
  3779. due to the potentially extreme inaccuracy of the estimated values.
  3780. Use \f[C]--compat-options manifest-filesize-approx\f[R] to keep
  3781. extracting the estimated values
  3782. .IP \[bu] 2
  3783. yt-dlp uses modern http client backends such as \f[C]requests\f[R].
  3784. Use \f[C]--compat-options prefer-legacy-http-handler\f[R] to prefer the
  3785. legacy http handler (\f[C]urllib\f[R]) to be used for standard http
  3786. requests.
  3787. .IP \[bu] 2
  3788. The sub-modules \f[C]swfinterp\f[R], \f[C]casefold\f[R] are removed.
  3789. .IP \[bu] 2
  3790. Passing \f[C]--simulate\f[R] (or calling \f[C]extract_info\f[R] with
  3791. \f[C]download=False\f[R]) no longer alters the default format selection.
  3792. See #9843 (https://github.com/yt-dlp/yt-dlp/issues/9843) for details.
  3793. .PP
  3794. For ease of use, a few more compat options are available:
  3795. .IP \[bu] 2
  3796. \f[C]--compat-options all\f[R]: Use all compat options (\f[B]Do NOT use
  3797. this!\f[R])
  3798. .IP \[bu] 2
  3799. \f[C]--compat-options youtube-dl\f[R]: Same as
  3800. \f[C]--compat-options all,-multistreams,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort\f[R]
  3801. .IP \[bu] 2
  3802. \f[C]--compat-options youtube-dlc\f[R]: Same as
  3803. \f[C]--compat-options all,-no-live-chat,-no-youtube-channel-redirect,-playlist-match-filter,-manifest-filesize-approx,-allow-unsafe-ext,-prefer-vp9-sort\f[R]
  3804. .IP \[bu] 2
  3805. \f[C]--compat-options 2021\f[R]: Same as
  3806. \f[C]--compat-options 2022,no-certifi,filename-sanitization,no-youtube-prefer-utc-upload-date\f[R]
  3807. .IP \[bu] 2
  3808. \f[C]--compat-options 2022\f[R]: Same as
  3809. \f[C]--compat-options 2023,playlist-match-filter,no-external-downloader-progress,prefer-legacy-http-handler,manifest-filesize-approx\f[R]
  3810. .IP \[bu] 2
  3811. \f[C]--compat-options 2023\f[R]: Same as
  3812. \f[C]--compat-options prefer-vp9-sort\f[R].
  3813. Use this to enable all future compat options
  3814. .PP
  3815. The following compat options restore vulnerable behavior from before
  3816. security patches:
  3817. .IP \[bu] 2
  3818. \f[C]--compat-options allow-unsafe-ext\f[R]: Allow files with any
  3819. extension (including unsafe ones) to be downloaded
  3820. (GHSA-79w7-vh3h-8g4j (https://github.com/yt-dlp/yt-dlp/security/advisories/GHSA-79w7-vh3h-8g4j))
  3821. .RS 2
  3822. .RS
  3823. .PP
  3824. :warning: Only use if a valid file download is rejected because its
  3825. extension is detected as uncommon
  3826. .PP
  3827. \f[B]This option can enable remote code execution! Consider opening an
  3828. issue (https://github.com/yt-dlp/yt-dlp/issues/new/choose) instead!\f[R]
  3829. .RE
  3830. .RE
  3831. .SS Deprecated options
  3832. .PP
  3833. These are all the deprecated options and the current alternative to
  3834. achieve the same effect
  3835. .SS Almost redundant options
  3836. .PP
  3837. While these options are almost the same as their new counterparts, there
  3838. are some differences that prevents them being redundant
  3839. .IP
  3840. .nf
  3841. \f[C]
  3842. -j, --dump-json --print \[dq]%()j\[dq]
  3843. -F, --list-formats --print formats_table
  3844. --list-thumbnails --print thumbnails_table --print playlist:thumbnails_table
  3845. --list-subs --print automatic_captions_table --print subtitles_table
  3846. \f[R]
  3847. .fi
  3848. .SS Redundant options
  3849. .PP
  3850. While these options are redundant, they are still expected to be used
  3851. due to their ease of use
  3852. .IP
  3853. .nf
  3854. \f[C]
  3855. --get-description --print description
  3856. --get-duration --print duration_string
  3857. --get-filename --print filename
  3858. --get-format --print format
  3859. --get-id --print id
  3860. --get-thumbnail --print thumbnail
  3861. -e, --get-title --print title
  3862. -g, --get-url --print urls
  3863. --match-title REGEX --match-filters \[dq]title \[ti]= (?i)REGEX\[dq]
  3864. --reject-title REGEX --match-filters \[dq]title !\[ti]= (?i)REGEX\[dq]
  3865. --min-views COUNT --match-filters \[dq]view_count >=? COUNT\[dq]
  3866. --max-views COUNT --match-filters \[dq]view_count <=? COUNT\[dq]
  3867. --break-on-reject Use --break-match-filters
  3868. --user-agent UA --add-headers \[dq]User-Agent:UA\[dq]
  3869. --referer URL --add-headers \[dq]Referer:URL\[dq]
  3870. --playlist-start NUMBER -I NUMBER:
  3871. --playlist-end NUMBER -I :NUMBER
  3872. --playlist-reverse -I ::-1
  3873. --no-playlist-reverse Default
  3874. --no-colors --color no_color
  3875. \f[R]
  3876. .fi
  3877. .SS Not recommended
  3878. .PP
  3879. While these options still work, their use is not recommended since there
  3880. are other alternatives to achieve the same
  3881. .IP
  3882. .nf
  3883. \f[C]
  3884. --force-generic-extractor --ies generic,default
  3885. --exec-before-download CMD --exec \[dq]before_dl:CMD\[dq]
  3886. --no-exec-before-download --no-exec
  3887. --all-formats -f all
  3888. --all-subs --sub-langs all --write-subs
  3889. --print-json -j --no-simulate
  3890. --autonumber-size NUMBER Use string formatting, e.g. %(autonumber)03d
  3891. --autonumber-start NUMBER Use internal field formatting like %(autonumber+NUMBER)s
  3892. --id -o \[dq]%(id)s.%(ext)s\[dq]
  3893. --metadata-from-title FORMAT --parse-metadata \[dq]%(title)s:FORMAT\[dq]
  3894. --hls-prefer-native --downloader \[dq]m3u8:native\[dq]
  3895. --hls-prefer-ffmpeg --downloader \[dq]m3u8:ffmpeg\[dq]
  3896. --list-formats-old --compat-options list-formats (Alias: --no-list-formats-as-table)
  3897. --list-formats-as-table --compat-options -list-formats [Default] (Alias: --no-list-formats-old)
  3898. --youtube-skip-dash-manifest --extractor-args \[dq]youtube:skip=dash\[dq] (Alias: --no-youtube-include-dash-manifest)
  3899. --youtube-skip-hls-manifest --extractor-args \[dq]youtube:skip=hls\[dq] (Alias: --no-youtube-include-hls-manifest)
  3900. --youtube-include-dash-manifest Default (Alias: --no-youtube-skip-dash-manifest)
  3901. --youtube-include-hls-manifest Default (Alias: --no-youtube-skip-hls-manifest)
  3902. --geo-bypass --xff \[dq]default\[dq]
  3903. --no-geo-bypass --xff \[dq]never\[dq]
  3904. --geo-bypass-country CODE --xff CODE
  3905. --geo-bypass-ip-block IP_BLOCK --xff IP_BLOCK
  3906. \f[R]
  3907. .fi
  3908. .SS Developer options
  3909. .PP
  3910. These options are not intended to be used by the end-user
  3911. .IP
  3912. .nf
  3913. \f[C]
  3914. --test Download only part of video for testing extractors
  3915. --load-pages Load pages dumped by --write-pages
  3916. --youtube-print-sig-code For testing youtube signatures
  3917. --allow-unplayable-formats List unplayable formats also
  3918. --no-allow-unplayable-formats Default
  3919. \f[R]
  3920. .fi
  3921. .SS Old aliases
  3922. .PP
  3923. These are aliases that are no longer documented for various reasons
  3924. .IP
  3925. .nf
  3926. \f[C]
  3927. --avconv-location --ffmpeg-location
  3928. --clean-infojson --clean-info-json
  3929. --cn-verification-proxy URL --geo-verification-proxy URL
  3930. --dump-headers --print-traffic
  3931. --dump-intermediate-pages --dump-pages
  3932. --force-write-download-archive --force-write-archive
  3933. --load-info --load-info-json
  3934. --no-clean-infojson --no-clean-info-json
  3935. --no-split-tracks --no-split-chapters
  3936. --no-write-srt --no-write-subs
  3937. --prefer-unsecure --prefer-insecure
  3938. --rate-limit RATE --limit-rate RATE
  3939. --split-tracks --split-chapters
  3940. --srt-lang LANGS --sub-langs LANGS
  3941. --trim-file-names LENGTH --trim-filenames LENGTH
  3942. --write-srt --write-subs
  3943. --yes-overwrites --force-overwrites
  3944. \f[R]
  3945. .fi
  3946. .SS Sponskrub Options
  3947. .PP
  3948. Support for SponSkrub (https://github.com/faissaloo/SponSkrub) has been
  3949. deprecated in favor of the \f[C]--sponsorblock\f[R] options
  3950. .IP
  3951. .nf
  3952. \f[C]
  3953. --sponskrub --sponsorblock-mark all
  3954. --no-sponskrub --no-sponsorblock
  3955. --sponskrub-cut --sponsorblock-remove all
  3956. --no-sponskrub-cut --sponsorblock-remove -all
  3957. --sponskrub-force Not applicable
  3958. --no-sponskrub-force Not applicable
  3959. --sponskrub-location Not applicable
  3960. --sponskrub-args Not applicable
  3961. \f[R]
  3962. .fi
  3963. .SS No longer supported
  3964. .PP
  3965. These options may no longer work as intended
  3966. .IP
  3967. .nf
  3968. \f[C]
  3969. --prefer-avconv avconv is not officially supported by yt-dlp (Alias: --no-prefer-ffmpeg)
  3970. --prefer-ffmpeg Default (Alias: --no-prefer-avconv)
  3971. -C, --call-home Not implemented
  3972. --no-call-home Default
  3973. --include-ads No longer supported
  3974. --no-include-ads Default
  3975. --write-annotations No supported site has annotations now
  3976. --no-write-annotations Default
  3977. --compat-options seperate-video-versions No longer needed
  3978. --compat-options no-youtube-prefer-utc-upload-date No longer supported
  3979. \f[R]
  3980. .fi
  3981. .SS Removed
  3982. .PP
  3983. These options were deprecated since 2014 and have now been entirely
  3984. removed
  3985. .IP
  3986. .nf
  3987. \f[C]
  3988. -A, --auto-number -o \[dq]%(autonumber)s-%(id)s.%(ext)s\[dq]
  3989. -t, -l, --title, --literal -o \[dq]%(title)s-%(id)s.%(ext)s\[dq]
  3990. \f[R]
  3991. .fi
  3992. .SH CONTRIBUTING
  3993. .PP
  3994. See CONTRIBUTING.md for instructions on Opening an Issue and
  3995. Contributing code to the project
  3996. .SH WIKI
  3997. .PP
  3998. See the Wiki (https://github.com/yt-dlp/yt-dlp/wiki) for more
  3999. information