The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

yt-download - Download YouTube and other videos.

VERSION

Version 0.101

SYNOPSIS

    yt-download -h|-?|--help

    yt-download

    yt-download url [url ...]

    yt-download -f|--file filename

The urls can be entered after calling yt-download - this is useful if urls contain shell metacharacters like &.

The urls can also be passed with a file: yt-download -f|--file filename. The urls in the file have to be space separated.

DESCRIPTION

With this release the format of the files created by yt-download - apart from the log file - have changed. To see where the configuration directory with these files is located call yt-download -h and select INFO.

Download single videos or/and choose videos from playlists or/and channels.

When choosing from a channel or a playlist it is possible to filter the displayed video titles with a regexp.

Before the download the script shows some video info and lets you choose the video quality from the available qualities.

Instead of choosing the quality manually it is possible to set and use preferred qualities.

To set the different options call yt-download -h.

App::YTDL uses youtube-dl to get the data required for the video download.

Where to set the preferred qualities

Set the option Auto quality mode to 0 or 1. Then, when downloading a video, instead of selecting the desired video quality select the entry "Menu" and then the entry "Preferred qualities".

Legacy encodings

Non mappable characters on the output are replaced with *. In file names they are replaced with &#xNNN; where NNN is the Unicode code point in a decimal number.

Options

HELP

Shows this HELP text.

INFO

Shows the path and the version of the running yt-download, the path of the video and the configuration directory and the version of youtube-dl.

Directory

Video directory

Choose an alternative main video directory.

Extractor directory

  • 0 => No.

  • 1 => Create/use extractor directories.

Channel directory

  • 0 => Don't create/use channel directories.

  • 1 => Create/use channel directories if the videos are chosen from a channel or a list.

  • 2 => Always create/use channel directories.

File

Max filename length

Set the maximum length of the filename. Filenames longer as the maximum length are truncated.

Upload date is file date

Change the file timestamps to the upload date.

Quality

Auto quality mode

Set the auto quality mode:

  • mode 0: choose the video quality always manually

  • mode 1: keep the first quality chosen for a video of a playlist/channel for all videos of that playlist/channel if possible.

  • mode 2: keep the first quality chosen for a video of an extractor for all videos of that extractor if possible.

  • mode 3: use preferred qualities.

  • mode 4: use always the default (best) quality.

Preferred qualities

Prints the set preferred qualities.

See "Where to set the preferred qualities".

Download

UserAgent

Set the useragent.

If entered nothing the default useragent (Mozilla/5.0) is used.

Overwrite

If Overwrite is enabled, existing files are overwritten.

If not enabled, yt-download appends to partially downloaded file with the same name.

Download retries

Set the number of download retries.

Timeout

Timeout (seconds) is used as the value for the youtube-dl parameter --socket-timeout. timeout is also used as the value for the LWP::UserAgent option timeout when fetching the data required for the video download.

History

Logging

Enable info logging to a log file.

Channel history

If no arguments are passed to yt-download, the user can choose from the channels saved in the channel-history and the channel-sticky file.

Channel history sets the limit of the number of channels saved in the channel history file. Setting Channel history to 0 disables the channel history.

A channel can be made sticky. Channels made sticky don't count regarding the Channel history limit. If a channel is made sticky, it gets also a new timestamp.

When added to the channel history channels get the return value of time() as a timestamp. If the limit is reached, the channel with the oldest timestamp is removed first.

The supported extractors are YouTube and Vimeo.

Channel sort

Sort the channels from the history file by name or by timestamp.

Appearance

Max info width

Set the maximum width of video info output.

Digits for "k/s"

Set the number of digits allocated for the "kilobyte per seconds" template.

Sort order

If set to "YES", the latest videos from a channel/list are on top of the list menu else they are at the end of the menu.

REQUIREMENTS

Perl version

Requires Perl version 5.10.0 or greater.

youtube-dl

youtube-dl is required.

Encoding layer

For a correct output it is required an appropriate encoding layer for STDOUT matching the terminal's character set.

Monospaced font

It is required a terminal that uses a monospaced font which supports the printed characters.

CREDITS

App::YTDL uses youtube-dl to get the data required for the video download.

Thanks to the Perl-Community.de and the people form stackoverflow for the help.

AUTHOR

Kuerbis <cuer2s@gmail.com>

LICENSE AND COPYRIGHT

Copyright (C) 2013-2015 Kuerbis.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For details, see the full text of the licenses in the file LICENSE.