ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.96k stars 10.01k forks source link

Downloading a specific resolution gives error. #29348

Open bob2456436 opened 3 years ago

bob2456436 commented 3 years ago

Checklist

Question

Hello, I am using youtube-dlg. I am trying to download from Gaia.com. I can download 1080p which is default resolution but if I try to set it to download 720p it gives an error. Could you please tell me what I have to do to make it work?

Lesmiscore commented 3 years ago
  1. Paste a URL you've tried to download. YouTube usually provides 720p resolution when 1080p is available.
  2. Don't post issues about youtube-dlg here.
bob2456436 commented 3 years ago

Here is a link to a video: https://www.gaia.com/video/orion-origin-of-the-gods?fullplayer=preview Default resolution is 1080p. Which means that if download resolution is not specified it downloads the 1080p. If I specify to download 720p or any other resolution it fails and gives an error.

dirkf commented 3 years ago
$ youtube-dl -v -F 'https://www.gaia.com/video/orion-origin-of-the-gods?fullplayer=preview'
[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.gaia.com/video/orion-origin-of-the-gods?fullplayer=preview']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[Gaia] orion-origin-of-the-gods: Downloading JSON metadata
[Gaia] 203471: Downloading JSON metadata
[Gaia] 205230: Downloading JSON metadata
[Gaia] 205230: Downloading m3u8 information
[info] Available formats for 205230:
format code        extension  resolution note
audio-0-en__Main_  mp4        audio only [en] 
audio-1-en__Main_  mp4        audio only [en] 
audio-2-en__Main_  mp4        audio only [en] 
audio-3-en__Main_  mp4        audio only [en] 
319                mp4        320x180     319k , avc1.42000d, video only
554                mp4        640x360     554k , avc1.4d001e, video only
990                mp4        1024x576    990k , avc1.4d001f, video only
1828               mp4        1600x900   1828k , avc1.640028, video only
2720               mp4        1920x1080  2720k , avc1.640028, video only (best)
$

And the format 990 (eg) can be downloaded. Try asking for 576p instead of 720p: yt-dl can't download resolutions that aren't offered by the site: if that fails there is a bug in the GUI wrapper; report it in the appropriate place. The resolutions listed correspond to the pop-up menu accessible by the gear icon in the web player.

bob2456436 commented 3 years ago
$ youtube-dl -v -F 'https://www.gaia.com/video/orion-origin-of-the-gods?fullplayer=preview'
[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '-F', 'https://www.gaia.com/video/orion-origin-of-the-gods?fullplayer=preview']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[Gaia] orion-origin-of-the-gods: Downloading JSON metadata
[Gaia] 203471: Downloading JSON metadata
[Gaia] 205230: Downloading JSON metadata
[Gaia] 205230: Downloading m3u8 information
[info] Available formats for 205230:
format code        extension  resolution note
audio-0-en__Main_  mp4        audio only [en] 
audio-1-en__Main_  mp4        audio only [en] 
audio-2-en__Main_  mp4        audio only [en] 
audio-3-en__Main_  mp4        audio only [en] 
319                mp4        320x180     319k , avc1.42000d, video only
554                mp4        640x360     554k , avc1.4d001e, video only
990                mp4        1024x576    990k , avc1.4d001f, video only
1828               mp4        1600x900   1828k , avc1.640028, video only
2720               mp4        1920x1080  2720k , avc1.640028, video only (best)
$

And the format 990 (eg) can be downloaded. Try asking for 576p instead of 720p: yt-dl can't download resolutions that aren't offered by the site: if that fails there is a bug in the GUI wrapper; report it in the appropriate place. The resolutions listed correspond to the pop-up menu accessible by the gear icon in the web player.

Thank you for replying. I am aware this particular video does not have 720p. This one for example does have 720p: https://www.gaia.com/series/superhuman-the-invisible-made-visible?fullplayer=preview If I try to download it with with the GUI this is the command line: youtube-dl.exe --newline -u **** -i --all-subs -o "Z:\%(title)s.%(ext)s" -f 22 --ignore-config --hls-prefer-native "https://www.gaia.com/series/superhuman-the-invisible-made-visible?fullplayer=preview" As far as I understand the -f 22** determines the quality of the download. However that does not seem to correspond to the workings of the player of Gaia.com. Could you tell me what the number for the 720p is like you showed that the "990" is for the 576p? Would these numbers be the same in all videos on their site? And what would be the exact command that I have to add to the GUI/Options/Extra?

dirkf commented 3 years ago

The URL https://www.gaia.com/series/superhuman-the-invisible-made-visible?fullplayer=preview is not (yet) supported by the yt-dl Gaia extractor, although you could try the individual episodes. Apparently the /series/ pages work differently to the /video/ pages.

As you are using the GUI wrapper, you won't necessarily have read the Fine Manual, but it explains that the -F/--list-formats option lists the format IDs (like 999 or 22) and then you can use -f/--format to select one of them for download. Obviously there are other ways of using the tool.

bob2456436 commented 3 years ago

The URL https://www.gaia.com/series/superhuman-the-invisible-made-visible?fullplayer=preview is not (yet) supported by the yt-dl Gaia extractor, although you could try the individual episodes. Apparently the /series/ pages work differently to the /video pages.

As you are using the GUI wrapper, you won't necessarily have read the Fine Manual, but it explains that the -F/--list-formats option lists the format IDs (like 999 or 22) and then you can use -f/--format to select one of them for download. Obviously there are other ways of using the tool.

Thank you. I understand. It seems I dont need the /Series/ page since it just has trailers. The actual episodes are on the /Video/ page.

Instead of using the CMD with the yt-dl.exe to get the IDs I used an extension on my browser - Video DownloadHelper - it is unable to download the video however it is able to display the bitrate which I successfully used as an ID and was able to download smaller resolutions.

The one problem which I get is that when I add the command -f 990 it downloads the video but does not download an audio stream... If I download without the -f 990 it downloads the 1080p with an audio stream. Am I supposed to add an additional command to make it get the audio as well?

dirkf commented 3 years ago

If the format only contains video, you need to get yt-dl to send an audio format. The two will be merged by yt-dl postprocessing. Eg -f '990+bestaudio'.

You can select the download type by various characteristics and everything will happen automatically. Maybe what you want is to get the best quality at 720p or less, for which you can try -f 'bestvideo[height<=720]+bestaudio/best[height<=720]'; or the best quality at 720p or less, or another resolution if none: -f 'bestvideo[height<=720]+bestaudio/best[height<=720]/bestvideo+bestaudio/best'.

bob2456436 commented 3 years ago

Thank you genius man! God bless you! I used -f bestvideo[height<=720]+bestaudio and it got it. I dont even have to go through the hassle of finding the ID. One last question for you: Subtitles get downloaded as external file (which is how I want them) but they are in a .vtt format. I can convert them manually to .srt but it would be awesome if the program did that on its own. Is it possible?

dirkf commented 3 years ago

Definitely read the Fine Manual as linked above and read about --convert-subs. However I don't use subtitles much and can't help there.

bob2456436 commented 3 years ago

Yep! --convert-subs srt did it. Again, thank you sooooo much!!! Enjoy my uploads here if you ever feel like watching docus about conspiracy/aliens/spirituality: https://www.1337x.to/user/An0mal1/ Cheers bro!