Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requested format not available, but it is #21740

Closed
nikooo777 opened this issue Jul 11, 2019 · 6 comments
Closed

Requested format not available, but it is #21740

nikooo777 opened this issue Jul 11, 2019 · 6 comments
Labels

Comments

@nikooo777
Copy link

@nikooo777 nikooo777 commented Jul 11, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

I went through related issues, through the examples, through the whole documentation and yet I can't find an answer as to why this isn't working.

The video I want to download has the following formats:

$ youtube-dl https://www.youtube.com/watch?v=SWymfnI1SHI -F
[youtube] SWymfnI1SHI: Downloading webpage                                                                                                                                                                                                                                                                                                                                                          
[youtube] SWymfnI1SHI: Downloading video info webpage                                                                                                                                                                                                                                                                                                                                               
[youtube] SWymfnI1SHI: Downloading MPD manifest                                                                                                                                                                                                                                                                                                                                                     
[info] Available formats for SWymfnI1SHI:                                                                                                                                                                                                                                                                                                                                                           
format code  extension  resolution note                                                                                                                                                                                                                                                                                                                                                             
139          m4a        audio only DASH audio   49k , m4a_dash container, mp4a.40.5@ 48k (22050Hz)                                                                                                                                                                                                                                                                                                  
140          m4a        audio only DASH audio  130k , m4a_dash container, mp4a.40.2@128k (44100Hz)                                                                                                                                                                                                                                                                                                  
278          webm       256x144    DASH video   95k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
160          mp4        256x144    DASH video  108k , mp4_dash container, avc1.4d400b, 30fps, video only                                                                                                                                                                                                                                                                                            
242          webm       426x240    DASH video  220k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
133          mp4        426x240    DASH video  242k , mp4_dash container, avc1.4d400c, 30fps, video only                                                                                                                                                                                                                                                                                            
134          mp4        640x360    DASH video  360k , mp4_dash container, avc1.4d401e, 30fps, video only                                                                                                                                                                                                                                                                                            
243          webm       640x360    DASH video  405k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
244          webm       854x480    DASH video  752k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
135          mp4        854x480    DASH video 1155k , mp4_dash container, avc1.4d4014, 30fps, video only                                                                                                                                                                                                                                                                                            
247          webm       1280x720   DASH video 1505k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
136          mp4        1280x720   DASH video 2310k , mp4_dash container, avc1.4d4016, 30fps, video only                                                                                                                                                                                                                                                                                            
137          mp4        1920x1080  DASH video 2358k , mp4_dash container, avc1.640028, 30fps, video only                                                                                                                                                                                                                                                                                            
248          webm       1920x1080  DASH video 2646k , webm_dash container, vp9, 30fps, video only                                                                                                                                                                                                                                                                                                   
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k, 10.34MiB (best) 

The following filter (that should download the best mp4 video less than 2GB and <=1080p):

youtube-dl https://www.youtube.com/watch?v=SWymfnI1SHI -f "(bestvideo[ext=mp4,height<=1080,filesize<2000M])+(bestaudio)" --merge-output-format mp4 -v

returns:

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=SWymfnI1SHI', u'-f', u'(bestvideo[ext=mp4,height<=1080,filesize<2000M])+(bestaudio)', u'--merge-output-format', u'mp4', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.06.27
[debug] Python version 2.7.15+ (CPython) - Linux-4.20.17-042017-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] SWymfnI1SHI: Downloading webpage
[youtube] SWymfnI1SHI: Downloading video info webpage
[youtube] {18} signature length 107, html5 player vflPG2SAp
[youtube] {137} signature length 103, html5 player vflPG2SAp
[youtube] {134} signature length 107, html5 player vflPG2SAp
[youtube] {140} signature length 103, html5 player vflPG2SAp
[youtube] SWymfnI1SHI: Downloading MPD manifest
ERROR: requested format not available
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 807, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 861, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1634, in process_video_result
    expected=True)
ExtractorError: requested format not available

while the following works:

$ youtube-dl https://www.youtube.com/watch?v=SWymfnI1SHI -f "137+140" --merge-output-format mp4 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=SWymfnI1SHI', u'-f', u'137+140', u'--merge-output-format', u'mp4', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.06.27
[debug] Python version 2.7.15+ (CPython) - Linux-4.20.17-042017-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] SWymfnI1SHI: Downloading webpage
[youtube] SWymfnI1SHI: Downloading video info webpage
[youtube] {18} signature length 107, html5 player vflPG2SAp
[youtube] {137} signature length 107, html5 player vflPG2SAp
[youtube] {134} signature length 107, html5 player vflPG2SAp
[youtube] {140} signature length 107, html5 player vflPG2SAp
[youtube] SWymfnI1SHI: Downloading MPD manifest
[debug] Invoking downloader on u'https://manifest.googlevideo.com/api/manifest/dash/expire/1562889698/ei/gnknXbbpConhhwaMyLOgCw/ip/46.126.78.23/id/496ca67e72354872/source/youtube/requiressl/yes/playback_host/r4---sn-1gieen7e.googlevideo.com/mm/31%2C26/mn/sn-1gieen7e%2Csn-4g5ednsd/ms/au%2Conr/mv/m/mvi/3/pl/16/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/1842500/mt/1562868021/fvip/4/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Citag/sig/ALgxI2wwQwIfZzdVJdv9QWzedHj-WHXIn68pQ9vEYw0ipBc7mJT3bwIgSocTN3uBT4Tal7Spugjiy8KNexZztOWnJCnT38SdJso%3D/lsparams/playback_host%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AHylml4wRQIgGnZ16fWmZL8oEU4qLoS2AY4dKGwF9FXEMHNGROn3PZ8CIQDMtmYPg9pTsOY4nah-dIiq84cf2XH-98CTJXMFO6MYXg%3D%3D'
[dashsegments] Total fragments: 46
[download] Destination: The Rachmaninoff Diet-SWymfnI1SHI.f137.mp4
[download] 100% of 49.28MiB in 00:32
[debug] Invoking downloader on u'https://manifest.googlevideo.com/api/manifest/dash/expire/1562889698/ei/gnknXbbpConhhwaMyLOgCw/ip/46.126.78.23/id/496ca67e72354872/source/youtube/requiressl/yes/playback_host/r4---sn-1gieen7e.googlevideo.com/mm/31%2C26/mn/sn-1gieen7e%2Csn-4g5ednsd/ms/au%2Conr/mv/m/mvi/3/pl/16/hfr/all/as/fmp4_audio_clear%2Cwebm_audio_clear%2Cwebm2_audio_clear%2Cfmp4_sd_hd_clear%2Cwebm2_sd_hd_clear/initcwndbps/1842500/mt/1562868021/fvip/4/itag/0/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cas%2Citag/sig/ALgxI2wwQwIfZzdVJdv9QWzedHj-WHXIn68pQ9vEYw0ipBc7mJT3bwIgSocTN3uBT4Tal7Spugjiy8KNexZztOWnJCnT38SdJso%3D/lsparams/playback_host%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps/lsig/AHylml4wRQIgGnZ16fWmZL8oEU4qLoS2AY4dKGwF9FXEMHNGROn3PZ8CIQDMtmYPg9pTsOY4nah-dIiq84cf2XH-98CTJXMFO6MYXg%3D%3D'
[dashsegments] Total fragments: 25
[download] Destination: The Rachmaninoff Diet-SWymfnI1SHI.f140.m4a
[download] 100% of 3.70MiB in 00:10
[ffmpeg] Merging formats into "The Rachmaninoff Diet-SWymfnI1SHI.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:The Rachmaninoff Diet-SWymfnI1SHI.f137.mp4' -i 'file:The Rachmaninoff Diet-SWymfnI1SHI.f140.m4a' -c copy -map '0:v:0' -map '1:a:0' 'file:The Rachmaninoff Diet-SWymfnI1SHI.temp.mp4'
Deleting original file The Rachmaninoff Diet-SWymfnI1SHI.f137.mp4 (pass -k to keep)
Deleting original file The Rachmaninoff Diet-SWymfnI1SHI.f140.m4a (pass -k to keep)

any clues as to why this happens?

Thank you for your kind help.

Possibly related to #14814

@nikooo777 nikooo777 added the question label Jul 11, 2019
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 11, 2019

Invalid format selection syntax. There is no comma operator inside brackets.

@dstftw dstftw closed this Jul 11, 2019
@dstftw dstftw added the invalid label Jul 11, 2019
@nikooo777
Copy link
Author

@nikooo777 nikooo777 commented Jul 11, 2019

thank you for the fastest response ever, much appreciated. I understand commas are not valid inside brackets, is there another way to specify multiple conditions (mp4, less than 2GB and max 1080p)?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jul 11, 2019

Yes. See documentation.

@nikooo777
Copy link
Author

@nikooo777 nikooo777 commented Jul 11, 2019

Thanks,
I read the documentation all over again, line by line and I realized that filters are separated using their own brackets. I went ahead and corrected my example but I still end up with the same result. I really don't know what I'm doing wrong at this point:

$ youtube-dl https://www.youtube.com/watch?v=SWymfnI1SHI -f "bestvideo[ext=mp4][height<=1080][filesize<2000M]+bestaudio" --merge-output-format mp4 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=SWymfnI1SHI', u'-f', u'bestvideo[ext=mp4][height<=1080][filesize<2000M]+bestaudio', u'--merge-output-format', u'mp4', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.06.27
[debug] Python version 2.7.15+ (CPython) - Linux-4.20.17-042017-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] SWymfnI1SHI: Downloading webpage
[youtube] SWymfnI1SHI: Downloading video info webpage
[youtube] {18} signature length 107, html5 player vflPG2SAp
[youtube] {137} signature length 107, html5 player vflPG2SAp
[youtube] {134} signature length 107, html5 player vflPG2SAp
[youtube] {140} signature length 107, html5 player vflPG2SAp
[youtube] SWymfnI1SHI: Downloading MPD manifest
ERROR: requested format not available
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 807, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 861, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1634, in process_video_result
    expected=True)
ExtractorError: requested format not available

I also attempted using --match-filter (which I guess is not the right way to do it) and I didn't get any results either:

youtube-dl https://www.youtube.com/watch?v=SWymfnI1SHI --merge-output-format mp4 --match-filter "ext='mp4' & height<=1080 & filesize<2147483648" -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=SWymfnI1SHI', u'--merge-output-format', u'mp4', u'--match-filter', u"ext='mp4' & height<=1080 & filesize<2147483648", u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.06.27
[debug] Python version 2.7.15+ (CPython) - Linux-4.20.17-042017-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[youtube] SWymfnI1SHI: Downloading webpage
[youtube] SWymfnI1SHI: Downloading video info webpage
[youtube] {18} signature length 107, html5 player vflPG2SAp
[youtube] {137} signature length 107, html5 player vflPG2SAp
[youtube] {134} signature length 107, html5 player vflPG2SAp
[youtube] {140} signature length 107, html5 player vflPG2SAp
[youtube] SWymfnI1SHI: Downloading MPD manifest
[debug] Default format spec: bestvideo+bestaudio/best
[download] The Rachmaninoff Diet does not pass filter ext='mp4' & height<=1080 & filesize<2147483648, skipping ..

I know I might be very frustrating at this point, but would you mind giving me a pointer so that I can achieve what I'm trying to do?
Thank you and best regards

@remitamine
Copy link
Collaborator

@remitamine remitamine commented Jul 11, 2019

@nikooo777 filesize is not available for DASH formats:

Formats for which the value is not known are excluded unless you put a question mark (?) after the operator.

@nikooo777
Copy link
Author

@nikooo777 nikooo777 commented Jul 12, 2019

That was the culprit!
Thank you very much for your patience with me tonight.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.