Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.96k stars 582 forks source link

ERROR: requested format not available for v.reddit.com links #288

Closed Tyde closed 4 years ago

Tyde commented 4 years ago

New issue

When I try to download a v.reddit.com link, I get an error: requested format not available

Your environment

Selfhosted version with the following config:

Please answer these questions when reporting a new issue:

What is your operating system (Windows, Linux, OSX, etc.)? Ubuntu 18.04 LTS What is your web server (Apache, IIS, etc.)? Apache What version of AllTube are you using? 2.30 How did you install AllTube (with Git or with a release package)? release package What version of PHP are you using? PHP 7.2.24 What version of Python are you using? python binary is 2.7 python3 binary is 3.6.9 What version of youtube-dl are you using? 2020.05.08 (as included in release) Do you get any PHP-related errors in your webserver's logs? no What is the content of your config/config.yml file?

---
# Path to your youtube-dl binary
youtubedl: vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py

# Path to your python binary
python: /usr/bin/python

# An array of parameters to pass to youtube-dl
params:
    - --no-warnings
    - --ignore-errors
    - --flat-playlist
    - --restrict-filenames
    - --no-playlist

# True to enable audio conversion
convert: true

# True to enable advanced conversion mode
convertAdvanced: true

# List of formats available in advanced conversion mode
convertAdvancedFormats: [mp3, avi, flv, wav]

# Path to your avconv or ffmpeg binary
avconv: /usr/bin/ffmpeg

# avconv/ffmpeg logging level.
avconvVerbosity: error

# Path to the directory that contains the phantomjs binary.
phantomjsDir: vendor/bin/

# True to disable URL rewriting
uglyUrls: false

# True to stream videos through server
# Set to "ask" if you want to allow it but not enable by default.
stream: false

# True to enable remux mode (merge best audio and best video)
remux: true

# MP3 bitrate when converting (in kbit/s)
audioBitrate: 128

# App name
appName: AllTube Download

# Generic formats supported by youtube-dl
genericFormats:
    best: Best
    bestvideo+bestaudio: Remux best video with best audio
    worst: Worst

# Enable debug mode.
debug: true

Please provide the URL of a video that causes the issue. https://www.reddit.com/r/holdmyredbull/comments/hb1mkm/canyoneering_this_massive_sierra_gorge/

Describe your issue

I do get the following error page: http://archive.is/MgwAm

I can see the issue arises in: callYoutubedl(array('--dump-single-json', 'https://www.reddit.com/r/holdmyredbull/comments/hb1mkm/canyoneering_this_massive_sierra_gorge/', '-f', 'best[protocol=https]/best[protocol=http]'))

If I try this command in my cmd on my development pc (windows) with youtube-dl.exe --dump-single-json https://www.reddit.com/r/holdmyredbull/comments/hb1mkm/canyoneering_this_massive_sierra_gorge/ -f best[protocol=https]/best[protocol=http] I do get the same error (ERROR: requested format not available).

If I leave out the -f best[protocol=https]/best[protocol=http] argument, I do get a correct json dump. So somehow this format argument isn't compatible with reddit links.

Rudloff commented 4 years ago

Thanks for the detailed report.

The best format does not work with Reddit because they don't provide any format that contains both video and audio. To work around that, I added a fallback on bestvideo.