Youtube-dl

De Linuxmemo.

(Différences entre les versions)
(Choix du format)
(memo)
Ligne 23 : Ligne 23 :
Extraire une piste audio en MP3
Extraire une piste audio en MP3
  ffmpeg -i file.mkv -map 0:2 -acodec libmp3lame -ar 44100 -ac 2 -ab 192k file.mp3
  ffmpeg -i file.mkv -map 0:2 -acodec libmp3lame -ar 44100 -ac 2 -ab 192k file.mp3
 +
 +
==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.conf
 +
Then set a default download location in this file:
 +
--output "~/Desktop/%(title)s.%(ext)s"

Version du 3 mai 2019 à 16:59

https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl

Sommaire

Install

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

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
...

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"

memo

Extraire une piste audio en MP3

ffmpeg -i file.mkv -map 0:2 -acodec libmp3lame -ar 44100 -ac 2 -ab 192k file.mp3

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.conf

Then set a default download location in this file:

--output "~/Desktop/%(title)s.%(ext)s"
Outils personnels