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

youtube-dl 'http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance' fails #6792

Closed
MBRosenthal opened this issue Sep 7, 2015 · 1 comment

Comments

@MBRosenthal
Copy link

@MBRosenthal MBRosenthal commented Sep 7, 2015

I'm trying to use youtube-dl, version 2015.09.03 under OS X 10.8.5 to download a video from CSpan, but instead of downloading the video, youtube-dl produces an error. CSpan is listed as one of the sites supported by youtube-dl (http://rg3.github.io/youtube-dl contains a link labeled "more sites" which points to http://rg3.github.io/youtube-dl/supportedsites.html. That page lists CSpan.) Here are the details:

I just downloaded and installed youtube-dl by doing the following:

I navigated to http://rg3.github.io/youtube-dl/download.html to download youtube-dl. That page says:

To install it right away for all UNIX users (Linux, OS X, etc.), type:

    sudo curl https://yt-dl.org/downloads/2015.09.03/youtube-dl -o /usr/local/bin/youtube-dl
    sudo chmod a+rx /usr/local/bin/youtube-dl

I ran those commands. I then verified that the latest version of youtube-dl is installed:

bash-3.2$ youtube-dl -U
youtube-dl is up-to-date (2015.09.03)

I then ran youtube-dl as follows:

youtube-dl 'http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance'

It complained:

[generic] lawrence-lessig-campaign-finance: Requesting header
WARNING: Falling back on generic information extractor.
[generic] lawrence-lessig-campaign-finance: Downloading webpage
[generic] lawrence-lessig-campaign-finance: Extracting information
ERROR: Unsupported URL: http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance

I reran youtube-dl with the --verbose flag. Below are the commands I ran and the output from those commands.

bash-3.2$ youtube-dl --verbose 'http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance']
[debug] Encodings: locale US-ASCII, fs utf-8, out US-ASCII, pref US-ASCII
[debug] youtube-dl version 2015.09.03
[debug] Python version 2.7.2 - Darwin-12.5.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[generic] lawrence-lessig-campaign-finance: Requesting header
WARNING: Falling back on generic information extractor.
[generic] lawrence-lessig-campaign-finance: Downloading webpage
[generic] lawrence-lessig-campaign-finance: Extracting information
ERROR: Unsupported URL: http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1222, in _real_extract
    doc = parse_xml(webpage)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1599, in parse_xml
    tree = xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1282, in XML
    parser.feed(text)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1624, in feed
    self._raiseerror(v)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1488, in _raiseerror
    raise err
ParseError: not well-formed (invalid token): line 19, column 37
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 655, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 287, in extract
    return self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1820, in _real_extract
    raise UnsupportedError(url)
UnsupportedError: Unsupported URL: http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance
@MBRosenthal
Copy link
Author

@MBRosenthal MBRosenthal commented Sep 7, 2015

I just discovered how to get it working. I'd given youtube-dl an argument that points to the video rather than the webpage that contains the video plus all of C-Span's additional content (header, footer, description, etc.) Apparently youtube-dl searches for a particular node in the HTML tree to find the link to the video. Since the page at the URL I initially gave it (http://www.c-span.org/video/standalone/?323622-1/lawrence-lessig-campaign-finance) doesn't contain that HTML, it couldn't find the link to the video. When I instead ran youtube-dl 'http://www.c-span.org/video/?323622-1/lawrence-lessig-campaign-finance', it downloaded without a problem. In case the difference in the URLs is not obvious, the former contains the string "standalone". The latter does not.

@MBRosenthal MBRosenthal closed this Sep 7, 2015
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.