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
132.29k stars 10.03k forks source link

[brightcove] 'programmedContent' is None #7345

Open pmer opened 9 years ago

pmer commented 9 years ago
$ python -m youtube_dl --verbose 'http://www.11alive.com/videos/news/local/2015/10/27/74703190/'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'http://www.11alive.com/videos/news/local/2015/10/27/74703190/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.11.02
[debug] Git HEAD: a230068
[debug] Python version 2.7.10 - Darwin-15.0.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.8.1, ffprobe 2.8.1
[debug] Proxy map: {}
[generic] 74703190: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 74703190: Downloading webpage
[generic] 74703190: Extracting information
[generic] Brightcove video detected.
[download] Downloading playlist: VIDEO: All Three Angles of Spring Valley Incident
[generic] playlist VIDEO: All Three Angles of Spring Valley Incident: Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
[Brightcove] 4582511272001: Downloading webpage
[Brightcove] 4582511272001: Extracting information
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/pdm/Source/youtube-dl/youtube_dl/__main__.py", line 19, in <module>
    youtube_dl.main()
  File "youtube_dl/__init__.py", line 410, in main
    _real_main(argv)
  File "youtube_dl/__init__.py", line 400, in _real_main
    retcode = ydl.download(all_urls)
  File "youtube_dl/YoutubeDL.py", line 1666, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "youtube_dl/YoutubeDL.py", line 672, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "youtube_dl/YoutubeDL.py", line 833, in process_ie_result
    extra_info=extra)
  File "youtube_dl/YoutubeDL.py", line 725, in process_ie_result
    extra_info=extra_info)
  File "youtube_dl/YoutubeDL.py", line 661, in extract_info
    ie_result = ie.extract(url)
  File "youtube_dl/extractor/common.py", line 290, in extract
    return self._real_extract(url)
  File "youtube_dl/extractor/brightcove.py", line 237, in _real_extract
    videoPlayer[0], query_str, query, referer=referer)
  File "youtube_dl/extractor/brightcove.py", line 266, in _get_video_info
    video_info = info['programmedContent']['videoPlayer']['mediaDTO']
TypeError: 'NoneType' object has no attribute '__getitem__'
pmer commented 9 years ago

The Brightcove URL extractor looks at the <meta> tag at the top of the page and finds the URL

http://c.brightcove.com/services/viewer/htmlFederated?isVid=1&isUI=1&playerID=2857340256001&autoStart=true&%40videoPlayer=4582511272001

That page is downloaded and its info extracted but it's missing a programmedContent section, which we need.

Fortunately, If we change the videoPlayer parameter in the above URL from 4582511272001 to ref%3A74703190 (where 74703190 is the basename of the URL given on the command line) then we get a valid programmedContent object.

pmer commented 9 years ago

Possible duplicate of https://github.com/rg3/youtube-dl/issues/3139