Télécharger des vidéos ou bandes sons
Youtube-dl permet de télécharger des vidéos, ou uniquement la bande son, ou encore la vidéo sans le son (en fonction des plates-formes). Contrairement à son nom, il ne s’arrête pas à youtube, il est multi-sites (youtube, Dailymotion, Vimeo, Wat-TV, Arte…) alors pourquoi un tel nom? Il s’agit certainement d’un projet qui à l’origine visait youtube mais comme beaucoup d’applications libres, les contributeurs l’ont fait évoluer… La magie du logiciel libre!
Pourquoi utiliser une telle application? Si vous avez un débit trop bas et qu’il vous est impossible de regarder le moindre clip en streaming, même en basse qualité, cela peut être une solution pour vous… Votre beau-frère a fait une vidéo de votre anniversaire avec un fond musical que vous n’appréciez pas et vous souhaitez récupérer que la vidéo sans le son, il a aussi fait un discours et vous souhaitez récupérer la bande son sans la vidéo…
Bref! plein de possibilités (en fonction des plates-formes).
ATTENTION: ici, pas question de faire l’apologie du “piratage”, il s’agit de palier aux problèmes de basse connexion que peuvent rencontrer certains ainsi qu’aux problèmes de conception des plates-formes vidéos et leurs lecteurs flash.
Installation (je suis Ubuntu, un simple…
sudo apt-get install youtube-dl
Ou si vous souhaitez la dernière version:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-dl
Les exemples ci-dessous ne laissent pas préjuger de mes goûts, j’ai pris les liens au hasard, juste à titre d’exemple.
Utilisation rapide youtube-dl:
– Il suffit de coller l’url de la vidéo juste après youtube-dl en laissant un espace pour télécharger une vidéo.
$ youtube-dl https://www.youtube.com/watch?v=e-ORhEE9VVg
– pour la bande son, mettre l’option « -x »
$ youtube-dl -x https://www.youtube.com/watch?v=e-ORhEE9VVg
Dans ces deux exemples on ne choisit pas la qualité téléchargée souvent la plus basse par défaut.
En fin de cet article solution pour Dedian Jessie
Utilisation pour les plus exigeants:
– Youtube: Voir les qualités proposées pour une vidéo donnée, utiliser l’option « -F » (en majuscule)
$ youtube-dl -F https://www.youtube.com/watch?v=e-ORhEE9VVg
#----Ci-dessous le résultat de la commade----
#----Ca vaut pour les exemples plus bas----
[youtube] e-ORhEE9VVg: Downloading webpage
[youtube] e-ORhEE9VVg: Extracting video information
[youtube] e-ORhEE9VVg: Downloading js player en_US-vflsXGZP2
[youtube] e-ORhEE9VVg: Downloading DASH manifest
[info] Available formats for e-ORhEE9VVg:
format code extension resolution note
171 webm audio only DASH audio , audio@128k (worst)
140 m4a audio only DASH audio , audio@128k
139 m4a audio only DASH audio 49k , audio@ 48k (22050Hz), 1.57MiB
140 m4a audio only DASH audio 129k , audio@128k (44100Hz), 4.17MiB
171 webm audio only DASH audio 136k , audio@128k (44100Hz), 3.95MiB
172 webm audio only DASH audio 208k , audio@256k (44100Hz), 5.94MiB
141 m4a audio only DASH audio 255k , audio@256k (44100Hz), 8.28MiB
160 mp4 144p DASH video , video only
278 webm 256x144 DASH video 108k , webm container, VP9, 12fps, video only, 2.41MiB
160 mp4 256x144 DASH video 121k , 12fps, video only, 3.38MiB
242 webm 240p DASH video , video only
133 mp4 240p DASH video , video only
242 webm 426x240 DASH video 234k , 24fps, video only, 4.37MiB
133 mp4 426x240 DASH video 256k , 24fps, video only, 7.63MiB
243 webm 360p DASH video , video only
134 mp4 360p DASH video , video only
243 webm 640x360 DASH video 409k , 24fps, video only, 7.80MiB
134 mp4 640x360 DASH video 381k , 24fps, video only, 7.82MiB
244 webm 480p DASH video , video only
135 mp4 480p DASH video , video only\r\n244 webm 854x480 DASH video 640k , 24fps, video only, 12.30MiB
135 mp4 854x480 DASH video 742k , 24fps, video only, 15.84MiB
247 webm 720p DASH video , video only
136 mp4 720p DASH video , video only
247 webm 1280x720 DASH video 1148k , 24fps, video only, 22.81MiB
136 mp4 1280x720 DASH video 1299k , 24fps, video only, 30.59MiB
248 webm 1080p DASH video , video only
137 mp4 1080p DASH video , video only
248 webm 1920x1080 DASH video 2271k , 24fps, video only, 40.15MiB
137 mp4 1920x1080 DASH video 2593k , 24fps, video only, 58.56MiB
17 3gp 176x144
36 3gp 320x240
5 flv 400x240
43 webm 640x360
18 mp4 640x360
22 mp4 1280x720 (best)
Téléchager la qualité qui vous intéresse avec l’option « -f » (en minuxcule).
Imaginons que vous souhaitez que la bande son échantillée à 255k vous utilisirez l’option « -f 141 »
Vous ne souhaitez que la vidéo sans le son avec au format 1920×1080 « -f 248 »
Vous souhaitez la vidéo avec le son à la meilleur qualité proposée « -f 22 »
Exemple :
$ youtube-dl -f 22 https://www.youtube.com/watch?v=e-ORhEE9VVg
– Pour Dailymotion, c’est le même principe
$ youtube-dl -F http://www.dailymotion.com/video/x20w1rz_iggy-azalea-black-widow-ft-rita-ora-official-video_music
[dailymotion] x20w1rz: Downloading webpage
[dailymotion] x20w1rz: Extracting information
[dailymotion] x20w1rz: Downloading embed page
[info] Available formats for x20w1rz:
format code extension resolution note
ld mp4 320x240 (worst)
standard mp4 512x384
hq mp4 848x480
hd mp4 1280x720
hd180 mp4 1920x1080 (best)
Si par exemple on souhaite la meilleure version :
$ youtube-dl -f hd180 http://www.dailymotion.com/video/x20w1rz_iggy-azalea-black-widow-ft-rita-ora-official-video_music
– Sur Vimeo
$ youtube-dl -F http://vimeo.com/1084537
[vimeo] 1084537: Downloading webpage
[vimeo] 1084537: Extracting information
[vimeo] 1084537: Downloading webpage
[info] Available formats for 1084537:
format code extension resolution note
h264-mobile mp4 480x272 (worst)
vp6-sd flv 504x284
vp6-hd flv 1280x720
vp8-hd flv 1280x720 (best)
$ youtube-dl -f vp8-hd youtube-dl -F http://vimeo.com/1084537
– Pour Wat-TV
$ youtube-dl -F http://www.wat.tv/video/votez-pour-faire-briller-talents-74vt3_74crj_.html
[wat.tv] votez-pour-faire-briller-talents: Downloading webpage
[wat.tv] 11985159: Downloading JSON metadata
[wat.tv] 11985159: Downloading server time
[wat.tv] 11985159: Downloding SD video URL
[wat.tv] 11985159: Downloading server time
[wat.tv] 11985159: Downloding HD video URL
[info] Available formats for 11985159:
format code extension resolution note
Mobile mp4 unknown (worst)
SD mp4 unknown
HD mp4 unknown (best)
$ youtube-dl -f [code (ici Mobile, SD ou HD)] [url]
– Et il en va de même pour Arte (si vous avez la rediffusion sur votre box, c’est mieux et moins long de visionner ce que vous souhaitez).
$ youtube-dl -F http://www.arte.tv/guide/fr/043395-000/tom-sawyer
[arte.tv:+7] 043395-000: Downloading webpage
[arte.tv:+7] 043395-000: Downloading JSON metadata
[info] Available formats for 043395-000_PLUS7-F:
format code extension resolution note
HLS_SQ_2 m3u8 640x360 VOA, Version allemande 2200k (worst)
HLS_SQ_1 m3u8 640x360 VF-STF, VF 2200k
HLS_SQ_4 m3u8 640x360 VFAUD, Audiodesc. 2200K
RTMP_LQ_2 flv 320x200 VOA, Version allemande 300k
RTMP_MQ_2 flv 720x406 VOA, Version allemande 800k
RTMP_EQ_2 flv 720x406 VOA, Version allemande 1500k
RTMP_SQ_2 flv 1280x720 VOA, Version allemande 2200k
RTMP_LQ_1 flv 320x200 VF-STF, VF 300k
RTMP_LQ_4 flv 320x200 VFAUD, Audiodesc. 300k
RTMP_MQ_1 flv 720x406 VF-STF, VF 800k
RTMP_MQ_4 flv 720x406 VFAUD, Audiodesc. 800K
RTMP_EQ_1 flv 720x406 VF-STF, VF 1500k
RTMP_EQ_4 flv 720x406 VFAUD, Audiodesc. 1500K
RTMP_SQ_1 flv 1280x720 VF-STF, VF 2200k
RTMP_SQ_4 flv 1280x720 VFAUD, Audiodesc. 2200k
HTTP_MP4_MQ_2 mp4 720x406 VOA, Version allemande 800k
HTTP_MP4_EQ_2 mp4 720x406 VOA, Version allemande 1500k
HTTP_MP4_SQ_2 mp4 1280x720 VOA, Version allemande 2200k
HTTP_MP4_MQ_1 mp4 720x406 VF-STF, VF 800k
HTTP_MP4_MQ_4 mp4 720x406 VFAUD, Audiodesc. 800k
HTTP_MP4_EQ_1 mp4 720x406 VF-STF, VF 1500k
HTTP_MP4_EQ_4 mp4 720x406 VFAUD, Audiodesc. 1500K
HTTP_MP4_SQ_1 mp4 1280x720 VF-STF, VF 2200k
HTTP_MP4_SQ_4 mp4 1280x720 VFAUD, Audiodesc. 2200k (best)
$ youtube-dl -f HTTP_MP4_SQ_4 http://www.arte.tv/guide/fr/043395-000/tom-sawyer
Un ami Jld m’a rapporté un soucis sous Debian Jessie, avec le message d’erreur suivant:
youtube-dl https://www.youtube.com/watch?v=e-ORhEE9VVg
[youtube] Setting langage
[youtube] e-ORhEE9VVg: Downloading webpage
[youtube] e-ORhEE9VVg: Downloading video info webpage
[youtube] e-ORhEE9VVg: Extracting video information
[youtube] e-ORhEE9VVg: Encrypted signatures detected.
[youtube] e-ORhEE9VVg: Downloading js player vflw4H1P-
ERROR: Signature extraction failed: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 479, in _decrypt_signature
(…)
Sa solution :
Téléchargé la version 2014.12.01-1 disponible sur le dépôt de la version instable (Sid) et installé par
# dpkg -i youtube-dl_2014.12.01-1_all.deb
Pour en savoir plus:
$ man youtube-dl