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

fix for brightcove extractor #2132

Closed
lindi2 opened this issue Jan 10, 2014 · 1 comment
Closed

fix for brightcove extractor #2132

lindi2 opened this issue Jan 10, 2014 · 1 comment
Labels
bug

Comments

@lindi2
Copy link

@lindi2 lindi2 commented Jan 10, 2014

python -m youtube_dl http://www.nature.com/news/video-fish-leaps-to-catch-birds-on-the-wing-1.14496

starts working with the following patch:

diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py
index 4ba3f7c..869b0a1 100644
--- a/youtube_dl/extractor/brightcove.py
+++ b/youtube_dl/extractor/brightcove.py
@@ -86,7 +86,7 @@ class BrightcoveIE(InfoExtractor):

         object_doc = xml.etree.ElementTree.fromstring(object_str)
         assert 'BrightcoveExperience' in object_doc.attrib['class']
-        params = {'flashID': object_doc.attrib['id'],
+        params = {
                   'playerID': find_xpath_attr(object_doc, './param', 'name', 'playerID').attrib['value'],
                   }
         def find_param(name):

I don't unfortunately have time to submit a proper patch but thought that this might still be useful. In case somebody is googling for this the original failure message is

$ youtube-dl http://www.nature.com/news/video-fish-leaps-to-catch-birds-on-the-wing-1.14496
WARNING: Falling back on generic information extractor.
[generic] video-fish-leaps-to-catch-birds-on-the-wing-1.14496: Downloading webpage
[generic] video-fish-leaps-to-catch-birds-on-the-wing-1.14496: Extracting information
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 9, in <module>
    load_entry_point('youtube-dl==2013.12.04', 'console_scripts', 'youtube-dl')()
  File "/usr/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 726, in main
    _real_main(argv)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 716, in _real_main
    retcode = ydl.download(all_urls)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 806, in download
    self.extract_info(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 429, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 131, in extract
    return self._real_extract(url)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/generic.py", line 176, in _real_extract
    bc_url = BrightcoveIE._extract_brightcove_url(webpage)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/brightcove.py", line 106, in _extract_brightcove_url
    return cls._build_brighcove_url(m_brightcove.group())
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/brightcove.py", line 75, in _build_brighcove_url
    params = {'flashID': object_doc.attrib['id'],
KeyError: 'id'

@jaimeMF jaimeMF closed this in db22af3 Jan 10, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 10, 2014

Thanks for the report and specially for looking into a fix for the problem!

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