Youtube-dl

De Linuxmemo.

(Différences entre les versions)
(memo)
(memo)
Ligne 21 : Ligne 21 :
==memo==
==memo==
-
Extraire une piste audio en MP3
+
  ./youtube-dl -x --audio-format flac
-
  ffmpeg -i file.mkv -map 0:2 -acodec libmp3lame -ar 44100 -ac 2 -ab 192k file.mp3
+
==Destination==
==Destination==

Version du 16 janvier 2020 à 14:50

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

./youtube-dl -x --audio-format flac

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