Skip to content

Channel

gatecrasher777 edited this page Oct 18, 2021 · 16 revisions

Channel

Information Options

General options only.

Result Options

General options and

--items         -I videos|playlists|channels|search - what items to fetch - default: videos
                    * videos                 - returns videos only
                    * playlists              - returns channel playlists only
                    * channels               - returns channels related to this channel
                    * search                 - returns videos that match the search query

--order         -o new|old|views - order of results - default: new 
                    * new                    - newest to oldest
                    * old                    - oldest to newest
                    * views                  - most to least number of views

--query         -q string - provide a search term - default: "video" (applies only to items:search)

--quantity      -Q number - minimum number of results to fetch (if available) - default: 60 

--repeat        -R number - number of seconds between repeated requests. (Ctrl-C required to end the session)

Download Options

General options and

--audioFormat   -A number - specific audio stream number to download - default: -1 (use preference algorithm 
                   and fallback streams)

--audioQuality  -a highest|medium|lowest|none - audio quality preference - none for video only - default: medium
    
--container     -C any|mp4|webm|mkv - provide your container preference - default: any
                    * any             - no preference between mp4 (h264 with aac) or webm (vp9 with opus) (default)
                    * mp4             - prefers mp4 codecs to webm codecs when quality is equal
                    * webm            - prefers webm codecs to mp4 codecs when quality is equal 
                    * mkv             - no preference and can additionally allow mixed formats 
                                        (vp9 with aac) or (h264 with opus).
                    * mp3             - force audio only download and convert aac/opus to .mp3
                    * flac            - force audio only download and convert aac/opus to lossless .flac

--filename      -f string - supply a media download filename - you can use video property templates in your string
                   The default filename is "${author}_${datetime}_${title}_${id}_${videoQuality}_${videoCodec}_${audioCodec}"

--items         -I videos|search - what items to fetch - default: videos
                    * videos          - returns videos only
                    * search          - returns videos that match the search query

--limit         -L number [number] - limit concurrent downloads (default 1) and the total number of downloads (optional)

--mediaBitrate  -M highest|lowest - prefered bitrate when quality of two streams is equal - default: highest

--metadata      -m author|title|description|keywords|published|comment|key [string] - video property to embed in 
                   downloaded file, one or more (i.e. -m author -m title) of  
                    * author          - reflects as AUTHOR in webm/mkv containers, as artist in mp4 containers
                    * title           - reflects as TITLE in webm/mkv containers, as title in mp4 containers
                    * description     - reflects as DESCRIPTION in webm/mkv containers, as description in mp4 containers
                    * keywords        - reflects as KEYWORDS in webm/mkv containers, as synopsis in mp4 containers
                    * published       - reflects as DATE in webm/mkv containers, as date in mp4 containers
                    * comment text    - custom text, reflects as COMMENT in webm/mkv, as comment in mp4 containers
                    * key value       - custom key, custom value. key must be a single word without spaces
                   [string] is required for a comment metadata, and if specified for any other metadata fields its value  
                   will be used to override the fetched video property. 
                   
--overwrite     -O yes|no - whether to download existing files again.
                    * yes             - video will be downloaded again and overwrite the existing file.
                    * no              - video downloading will be skipped if the video already exists. (default) This is not true if 
                    "better" streams (as per your preferences) become available and the filename changes as a consequence.

--order         -o new|old|views - order of results - default: new 
                    * new             - newest to oldest
                    * old             - oldest to newest
                    * views           - most to least number of views

--path          -p string - specify the path to the media download folder. Defaults to '.' the current directory. 

--query         -q string - provide a search term - default: "video" (applies only to items:search)

--quantity      -Q number - minimum number of results to fetch (if available) - default: 60 

--repeat        -R number - number of seconds between repeated requests. (Ctrl-C required to end the session)  
                   Default: 0 - does not repeat, exits on completion. 
                 
--videoFormat   -V number - specific video stream to download. Default: -1 (use preference algorithm and fallback streams)

--videoQuality  -v highest|1080p|720p|480p|medium|360p|240p|144p|lowest|none - video quality preference - none for audio only  
                   default 1080p

Examples

Getting channel information with default options

>ytdl --info UCG5qGWdu8nIRZqJ_GgDwQ-w
>ytdl -i UCG5qGWdu8nIRZqJ_GgDwQ-w

Getting 120 most popular video results with specific file and path (save info only)

>ytdl --result UCG5qGWdu8nIRZqJ_GgDwQ-w --items video --quantity 120 --order views -spath "./data" -sfilter "premier_pop" --save info
>ytdl -r UCG5qGWdu8nIRZqJ_GgDwQ-w -i video -Q 120 -o views -sp "./data" -sf "premier_pop" -S info

Download all videos with best quality published after 15 October 2021, repeat the request every hour (will automatically download new videos on the channel, Ctrl-C to break) Will not overwrite earlier downloads, but will automatically download better quality versions as they become available. Don't save the raw/info data

>ytdl --download UCG5qGWdu8nIRZqJ_GgDwQ-w --items search --query "after:2021-10-15" --videoQuality highest --audioQuality highest --mediaBitrate highest --repeat 3600 --save none
>ytdl -d UCG5qGWdu8nIRZqJ_GgDwQ-w -i search -query "after:2021-10-15" -v highest -a highest -M highest -R 3600 -S none
Clone this wiki locally