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

pbs video downloads stopped working with "ERROR: m3u8 download detected but ffmpeg or avconv could not be found." #5683

Open
GrumpyOldTroll opened this issue May 12, 2015 · 0 comments

Comments

@GrumpyOldTroll
Copy link

@GrumpyOldTroll GrumpyOldTroll commented May 12, 2015

  1. Problem: Fetching pbs videos used to succeed (using a mp4 from alternate_encoding, which is still there), but started failing sometime in the last few months.
  2. Fix: Probably a better solution than what I tried would be to discover the downloaders for the available formats and give them a method that allows them to reject it without attempting the download, and walk backwards through the available formats and checking that method before selecting the last entry in available_formats as the preferred encoding.
  3. Proposed solution: I have a simpler hack patch, which removes all m3u8 files from the available_formats if ffmpeg is not available. This is not a good way to leave the knowledge inside the downloaders, but after this patch, the same command succeeds:
$ git diff --staged youtube_dl/YoutubeDL.py
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 4cf83c5..8633a6f 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -914,6 +914,9 @@ class YoutubeDL(object):
         if not available_formats:
             return None

+        if not FFmpegMergerPP(self).available:
+            available_formats = filter(lambda x: x.get(u'protocol') != u'm3u8', available_formats)
+
         if format_spec in ['best', 'worst', None]:
             format_idx = 0 if format_spec == 'worst' else -1
             audiovideo_formats = [
$
  1. Verbose output:

Here's the output of a sample run, demonstrating the problem (presumably must not have ffmpeg installed):

$ youtube-dl/youtube_dl/__main__.py --verbose http://video.pbs.org/video/2365472415/
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'http://video.pbs.org/video/2365472415/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.10
[debug] Git HEAD: c1c924a
[debug] Python version 2.7.6 - Darwin-14.3.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[PBS] 2365472415: Downloading JSON metadata
[PBS] 2365472415: Downloading recommended_encoding video url info
[PBS] 2365472415: Downloading m3u8 information
[PBS] 2365472415: Downloading alternate_encoding video url info
[debug] Invoking downloader on u'http://ga.video.cdn.pbs.org/videos/nova/c21a548f-9003-4a20-aebf-58865db2084c/181693/hd-mezzanine-16x9/069e992c_nova_4208_test_rez-16x9-hls-2500k.m3u8'
[download] Destination: Invisible Universe Revealed-2365472415.mp4
ERROR: m3u8 download detected but ffmpeg or avconv could not be found. Please install one.
  File "youtube-dl/youtube_dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "/private/tmp/youtube-dl/youtube_dl/__init__.py", line 399, in main
    _real_main(argv)
  File "/private/tmp/youtube-dl/youtube_dl/__init__.py", line 389, in _real_main
    retcode = ydl.download(all_urls)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 1483, in download
    res = self.extract_info(url)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 660, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 706, in process_ie_result
    return self.process_video_result(ie_result, download=download)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 1154, in process_video_result
    self.process_info(new_info)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 1416, in process_info
    success = dl(filename, info_dict)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 1358, in dl
    return fd.download(name, info)
  File "/private/tmp/youtube-dl/youtube_dl/downloader/common.py", line 342, in download
    return self.real_download(filename, info_dict)
  File "/private/tmp/youtube-dl/youtube_dl/downloader/hls.py", line 27, in real_download
    self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.')
  File "/private/tmp/youtube-dl/youtube_dl/downloader/common.py", line 155, in report_error
    self.ydl.report_error(*args, **kargs)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 527, in report_error
    self.trouble(error_message, tb)
  File "/private/tmp/youtube-dl/youtube_dl/YoutubeDL.py", line 489, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

I think that covers everything the guidelines asked for. Cheers. (edit: added markdown to get raw text to show up better)

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
1 participant
You can’t perform that action at this time.