From cef96f1abf97057d64e67c32b443ef41ef93231a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Mon, 24 Mar 2014 19:51:49 +0100 Subject: [PATCH 1/8] docs: generate a page with the command line options --- devscripts/docs/make_options.py | 29 ++ docs/cli_options.rst | 4 + docs/index.rst | 8 + docs/options.rst.inc | 465 ++++++++++++++++++++++++++++++++ 4 files changed, 506 insertions(+) create mode 100644 devscripts/docs/make_options.py create mode 100644 docs/cli_options.rst create mode 100644 docs/options.rst.inc diff --git a/devscripts/docs/make_options.py b/devscripts/docs/make_options.py new file mode 100644 index 000000000..cc30e5d28 --- /dev/null +++ b/devscripts/docs/make_options.py @@ -0,0 +1,29 @@ +from __future__ import unicode_literals +import io +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + +import youtube_dl +from youtube_dl.utils import compat_str + +OPTONS_FILE = 'docs/options.rst.inc' +parser,_ ,_ = youtube_dl.parseOpts() + +with io.open(OPTONS_FILE, 'wt', encoding='utf-8') as f: + f.write('.. program:: youtube-dl\n\n') + for group in parser.option_groups: + title = compat_str(group.title) + f.write(title + '\n') + f.write('-' * len(title) + '\n') + for option in group.option_list: + f.write('.. option:: ') + f.write(compat_str(option).replace('/', ', ')) + if option.metavar: + f.write(' <%s>' % option.metavar) + f.write('\n\n') + f.write(' ' * 4 + option.help) + f.write('\n\n') + f.write('\n') + diff --git a/docs/cli_options.rst b/docs/cli_options.rst new file mode 100644 index 000000000..067599301 --- /dev/null +++ b/docs/cli_options.rst @@ -0,0 +1,4 @@ +youtube-dl options +================== + +.. include:: options.rst.inc diff --git a/docs/index.rst b/docs/index.rst index b746ff95b..61fc5834b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,6 +4,14 @@ Welcome to youtube-dl's documentation! *youtube-dl* is a command-line program to download videos from YouTube.com and more sites. It can also be used in Python code. +User guide +---------- + +.. toctree:: + :maxdepth: 2 + + cli_options + Developer guide --------------- diff --git a/docs/options.rst.inc b/docs/options.rst.inc new file mode 100644 index 000000000..2ac9901a0 --- /dev/null +++ b/docs/options.rst.inc @@ -0,0 +1,465 @@ +.. program:: youtube-dl + +General Options +--------------- +.. option:: -h, --help + + print this help text and exit + +.. option:: --version + + print program version and exit + +.. option:: -U, --update + + update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed) + +.. option:: -i, --ignore-errors + + continue on download errors, for example to skip unavailable videos in a playlist + +.. option:: --abort-on-error + + Abort downloading of further videos (in the playlist or the command line) if an error occurs + +.. option:: --dump-user-agent + + display the current browser identification + +.. option:: --user-agent + + specify a custom user agent + +.. option:: --referer + + specify a custom referer, use if the video access is restricted to one domain + +.. option:: --add-header + + specify a custom HTTP header and its value, separated by a colon ':'. You can use this option multiple times + +.. option:: --list-extractors + + List all supported extractors and the URLs they would handle + +.. option:: --extractor-descriptions + + Output descriptions of all supported extractors + +.. option:: --proxy + + Use the specified HTTP/HTTPS proxy. Pass in an empty string (--proxy "") for direct connection + +.. option:: --no-check-certificate + + Suppress HTTPS certificate validation. + +.. option:: --prefer-insecure, --prefer-unsecure + + Use an unencrypted connection to retrieve information about the video. (Currently supported only for YouTube) + +.. option:: --cache-dir + + Location in the filesystem where youtube-dl can store some downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change. + +.. option:: --no-cache-dir + + Disable filesystem caching + +.. option:: --socket-timeout + + Time to wait before giving up, in seconds + +.. option:: --bidi-workaround + + Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH + +.. option:: --default-search + + Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dl "large apple". By default (with value "auto") youtube-dl guesses. + +.. option:: --ignore-config + + Do not read configuration files. When given in the global configuration file /etc/youtube-dl.conf: do not read the user configuration in ~/.config/youtube-dl.conf (%APPDATA%/youtube-dl/config.txt on Windows) + +.. option:: --encoding + + Force the specified encoding (experimental) + + +Video Selection +--------------- +.. option:: --playlist-start + + playlist video to start at (default is %default) + +.. option:: --playlist-end + + playlist video to end at (default is last) + +.. option:: --match-title + + download only matching titles (regex or caseless sub-string) + +.. option:: --reject-title + + skip download for matching titles (regex or caseless sub-string) + +.. option:: --max-downloads + + Abort after downloading NUMBER files + +.. option:: --min-filesize + + Do not download any videos smaller than SIZE (e.g. 50k or 44.6m) + +.. option:: --max-filesize + + Do not download any videos larger than SIZE (e.g. 50k or 44.6m) + +.. option:: --date + + download only videos uploaded in this date + +.. option:: --datebefore + + download only videos uploaded on or before this date (i.e. inclusive) + +.. option:: --dateafter + + download only videos uploaded on or after this date (i.e. inclusive) + +.. option:: --min-views + + Do not download any videos with less than COUNT views + +.. option:: --max-views + + Do not download any videos with more than COUNT views + +.. option:: --no-playlist + + download only the currently playing video + +.. option:: --age-limit + + download only videos suitable for the given age + +.. option:: --download-archive + + Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it. + +.. option:: --include-ads + + Download advertisements as well (experimental) + +.. option:: --youtube-include-dash-manifest + + Try to download the DASH manifest on YouTube videos (experimental) + + +Download Options +---------------- +.. option:: -r, --rate-limit + + maximum download rate in bytes per second (e.g. 50K or 4.2M) + +.. option:: -R, --retries + + number of retries (default is %default) + +.. option:: --buffer-size + + size of download buffer (e.g. 1024 or 16K) (default is %default) + +.. option:: --no-resize-buffer + + do not automatically adjust the buffer size. By default, the buffer size is automatically resized from an initial value of SIZE. + +.. option:: --test + + SUPPRESSHELP + + +Filesystem Options +------------------ +.. option:: -t, --title + + use title in file name (default) + +.. option:: --id + + use only video ID in file name + +.. option:: -l, --literal + + [deprecated] alias of --title + +.. option:: -A, --auto-number + + number downloaded files starting from 00000 + +.. option:: -o, --output