Commons:YouTube files/Downloading/fr

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
This page is a translated version of a page Commons:YouTube files/Downloading and the translation is 6% complete. Changes to the translation template, respectively the source language can be submitted through Commons:YouTube files/Downloading and have to be approved by a translation administrator.

This article describes how you can download videos and subtitles from YouTube.

If you are downloading a video from your own YouTube account, you can try following the instructions here: "Download your own YouTube videos"

Software, tools or scripts

yt-dlp

yt-dlp (download page) is an open-source tool available as package in many GNU/Linux distributions, as well as macOS and Windows. However, yt-dlp does not offer a graphical user interface. Command line example:

yt-dlp -o "%(title)s-%(id)s.%(ext)s" --continue --retries 4 --write-info-json --write-description --all-subs --ignore-errors -f bestvideo+bestaudio --recode-video webm URL

If the video has a WebM encoded version published (as according to youtube-dl -F URL, you can use the following to download the highest quality WebM version:

yt-dlp -f bestvideo[ext=webm]+bestaudio[ext=webm]/best[ext=webm] URL

If you wish to download the video only without audio (for example, to avoid unnecessary freely licensed background music or unnecessary commentary), you can adjust the example commands provided above as follows:

yt-dlp -o "%(title)s-%(id)s.%(ext)s" --continue --retries 4 --write-info-json --write-description --all-subs --ignore-errors -f bestvideo --recode-video webm URL

yt-dlp -f bestvideo[ext=webm] URL

JDownloader

JDownloader allows downloading all videos from a specific account (useful for large numbers of videos) and specific formats, but is partly proprietary.

Youtube Subtitle Downloader

If the YouTube video has subtitles, Youtube Subtitle Downloader can be used to download them in SRT format. This is an userscript, you need to install Greasemonkey, Tampermonkey or Violentmonkey browser extension before using the userscript.

Website / Web app

You can search "youtube downloader" or "download youtube video" on Google to find websites / web apps that allow you to enter a YouTube video URL and get download links in many video formats.

To download substitles, You can search "youtube subtitle download".

Note that these sites could track what you are trying to get, but should be less risky than "unknown code from unknown 3rd party" browser extensions.

Here is a popular Firefox addon for downloading Youtube videos that has been around for years:

Conversion

Files not available in WebM have to be converted into WebM or Ogg Theora. See: Help:Converting video. If a file from youtube uses VP9 video, but vorbis audio, it can be converted using ffmpeg (or avconv) using a command like:

avconv -i inputfile.webm -acodec copy -vcodec libvpx out.webm

If you can get the (typically best) MP4 dash video, you might also want the M4A audio, to mux and transcode both into OGV or WebM, example:

ffmpeg -i input.mp4 -i input.m4a -f ogg -c:v libtheora -q:v 9 -c:a libvorbis -q:a 6 output.ogv

WebM

In May 2010, Google introduced the free WebM video encoding format, and many videos from YouTube are available under this format. As of November 2012, Wikimedia Commons accepts WebM uploads. If videos are available in .webm format on YouTube, they may not need to be converted to a different format before uploading them to Commons. However, often the VP9 video streams from youtube do not have audio, and need to be recombined with an audio stream before being uploaded to Commons.

Command line

Moving to Commons with youtube2mediawiki

If the YouTube video is available in the WebM format and you are comfortable with running Python scripts on your machine, one possibility is to use youtube2mediawiki:

  1. Download and install python 2.7
  2. Download youtube2mediawiki (e.g. as ZIP-file)
  3. Extract the archive and use the command line to start the python script.

Voir aussi

Comment obtenir de l'aide