Youtube-dl
De Linuxmemo.
Version du 28 janvier 2020 à 08:21 par Linuxmemo (discuter | contributions)
https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl
Sommaire |
[modifier] Install
git clone https://github.com/ytdl-org/youtube-dl.git youtube-dl.git sudo apt-get install python-dev python-pip sudo pip install youtube-dl ./youtube-dl/bin/youtube-dl
[modifier] Liste des formats dispo
youtube-dl -F "https://www.youtube.com/watch?v=xxxxxxxx" [youtube] xxxxxxxx: Downloading webpage [youtube] xxxxxxxx: Downloading video info webpage [info] Available formats for xxxxxxx: format code extension resolution note 249 webm audio only DASH audio 57k , opus @ 50k, 1.24MiB 250 webm audio only DASH audio 75k , opus @ 70k, 1.63MiB 140 m4a audio only DASH audio 127k , m4a_dash container, mp4a.40.2@128k, 2.93MiB ...
[modifier] Choix du format
youtube-dl -f 251 "https://www.youtube.com/watch?v=xxxxxxxx" youtube-dl -f best "https://www.youtube.com/watch?v=xxxxxxxx"
[modifier] Audio only
./youtube-dl -x --audio-format flac "https://www.youtube.com/watch?v=xxxxxxxx"
"--audio-format" Specify audio format: "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default; No effect without -x
./youtube-dl -a /home/user/ID-OnlyInFile.txt -x --audio-format mp3
[modifier] Destination
Use the -o option with youtube-dl to manually give a location for the downloaded files:
youtube-dl -o "~/Desktop/%(title)s.%(ext)s" 'youtube file url'
and of course substitute your actual url for 'youtube file url'. This example sends the completed download to your Desktop.
Create a configuration file for youtube-dl as follows:
touch ~/.config/youtube-dl/config
Then set a default download location in this file:
--output "~/Desktop/%(title)s.%(ext)s"
id (string): Video identifier title (string): Video title url (string): Video URL ext (string): Video filename extension alt_title (string): A secondary title of the video display_id (string): An alternative identifier for the video uploader (string): Full name of the video uploader license (string): License name the video is licensed under creator (string): The creator of the video release_date (string): The date (YYYYMMDD) when the video was released timestamp (numeric): UNIX timestamp of the moment the video became available upload_date (string): Video upload date (YYYYMMDD) uploader_id (string): Nickname or id of the video uploader channel (string): Full name of the channel the video is uploaded on channel_id (string): Id of the channel
Exemple : youtube-dl -o '%(title)s.%(ext)s' URL_DE_LA_VIDEO --restrict-filenames