téléchager une playlist commplete depuisyt

On y discute de tout, ou presque...
Répondre
Avatar de l’utilisateur
piratebab
Site Admin
Site Admin
Messages : 4903
Inscription : 24 avr. 2016, 18:41
Localisation : sud ouest
Status : Hors-ligne

Bonjour,
pour charger une chanson depuis youtube, j'utilise youtube-del -x.
Mais je dois le faire chansons par chansons . je n'ai pas trouvé l'option pour charger toutes les chansons d'une playlist exemple:


Vous noterez que c'est la version "music" de youtube, je trouve la qualité sonore meilleure que sur la version "video" du site.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Salut !

Je n'utilise jamais de playlist, d'ailleurs il doit y en avoir de plusieurs types (pls, m3u, ...)
et comme je ne vais plus sur YT

Mon unique idée :

Code : Tout sélectionner

$ man youtube-dl | grep -i playlist
              Continue on download errors, for example to skip unavailable videos in a playlist
              Abort downloading of further videos (in the playlist or the command line) if an error occurs
       --flat-playlist
              Do not extract the videos of a playlist, only list them.
       --playlist-start NUMBER
              Playlist video to start at (default is 1)
       --playlist-end NUMBER
              Playlist video to end at (default is last)
       --playlist-items ITEM_SPEC
              Playlist  video  items to download.  Specify indices of the videos in the playlist separated by commas like: "-- playlist-items 1,2,5,8" if you want to download videos indexed 1, 2, 5, 8 in
              the playlist.  You can specify range: " --playlist-items 1-3,7,10-13", it will download the videos at index 1, 2, 3, 7, 10, 11, 12 and 13.
       --no-playlist
              Download only the video, if the URL refers to a video and a playlist.
       --yes-playlist
              Download the playlist, if the URL refers to a video and a playlist.
       --playlist-reverse
              Download playlist videos in reverse order
       --playlist-random
              Download playlist videos in random order
              Simulate, quiet but print JSON information for each command-line argument.  If the URL refers to a playlist, dump the whole playlist information in a single line.
       • playlist (string): Name or id of the playlist that contains the video
       • playlist_index (numeric): Index of the video in the playlist padded with leading zeros according to the total length of the playlist
       • playlist_id (string): Playlist identifier
       • playlist_title (string): Playlist title
       • playlist_uploader (string): Full name of the playlist uploader
       • playlist_uploader_id (string): Nickname or id of the playlist uploader
       Output templates can also contain arbitrary hierarchical path, e.g.  -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' which will result in downloading each video in a directory correspond‐
              # Download YouTube playlist videos in separate directory indexed by video order in a playlist
              $ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re
              # Download all playlists of YouTube channel/user keeping each playlist in separate directory:
              $ youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists
              $ youtube-dl -u user -p password -o '~/MyVideos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/java-tutorial/
   I'm getting an error Unable to extract OpenGraph title on YouTube playlists
       YouTube changed their playlist format in March 2014 and later on, so you'll need at least youtube-dl 2014.07.25 to download all YouTube videos.
   How do I download only new videos from a playlist?
       Use  download-archive feature.  With this feature you should initially download the complete playlist with --download-archive /path/to/download/archive/file.txt that will record identifiers of all
              youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re"
       will download the complete PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re playlist and create a file archive.txt.  Each subsequent run will only download new videos if any:
              youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re"
tout semble en rapport avec des playlistes enregistées sur YT
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Connais-tu la différence entre l'option -x que tu utilises
et
le format : -f 140

140 m4a audio only DASH audio , audio@128k

qui doit correspondre à bestaudio ?
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
piratebab
Site Admin
Site Admin
Messages : 4903
Inscription : 24 avr. 2016, 18:41
Localisation : sud ouest
Status : Hors-ligne

Je vais regarder si ce que j'ai sur youtube.music sont bien des playlist.
Je n'ai jamais utilisé l'option -f.
Je vais regarder de plus prêt, car je souhaite télécharger de la meilleure qualité possible (ce qui n'était pas mon besoin jusqu'a présent)
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

J'ai testé :

youtube-dl -f 140 -o './%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/channel/UCbp9qY ... /playlists

ça m'a bien téléchargé les 4 premiers des 7 fichiers audio de la liste puis :

ERROR: unable to download video data: HTTP Error 403: Forbidden


a mis fin au téléchargement ; ça doit-être inhérent à la liste choisie ???

Solution

J'ai repassé la même commande en supprimant /playlists terminal de l'URL
et ytdl 'a repris correctement le téléchargement.

Résultat 2 listes placées chacune dans son répertoire :

Code : Tout sélectionner

/tests/ytdl$ tree
.
├── Apophis 2029
│   ├── 1 - Echelle de Turin.m4a
│   ├── 2 - 99942 Apophis 2029.m4a
│   ├── 3 - i21254-09.m4a
│   ├── 4 - MN4.m4a
│   ├── 5 - Le feu du ciel.m4a
│   ├── 6 - Possible Impact.m4a
│   └── 7 -  2036.m4a
└── Dern Universe
    ├── 1 - De la note au cerveau.m4a
    ├── 2 - Echo_hello.m4a
    ├── 3 - Lamentations de la planete Terre.m4a
    └── 4 - Equations from the Pleiades.m4a

2 directories, 12 files
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
piratebab
Site Admin
Site Admin
Messages : 4903
Inscription : 24 avr. 2016, 18:41
Localisation : sud ouest
Status : Hors-ligne

Je ne peux pas tester en ce moment, j'ai des pb de connexion, je suis en litige avec Orange.
J'avais du mal utiliser l'option playlist lors de mes tests
Répondre