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

c-span videos - Error 403: Forbidden #2626

Closed
spvkgn opened this issue Mar 25, 2014 · 5 comments
Closed

c-span videos - Error 403: Forbidden #2626

spvkgn opened this issue Mar 25, 2014 · 5 comments
Labels
bug

Comments

@spvkgn
Copy link

@spvkgn spvkgn commented Mar 25, 2014

Please take a look into this issue with c-span videos.

youtube-dl -v http://www.c-span.org/video/?26640-1/boris-yeltsin-address-congress
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.c-span.org/video/?26640-1/boris-yeltsin-address-congress']
[debug] Encodings: locale 'UTF-8', fs 'UTF-8', out 'UTF-8', pref: 'UTF-8'
[debug] youtube-dl version 2014.03.25
[debug] Python version 2.7.3 - Linux-3.2.0-39-generic-i686-with-LinuxMint-13-maya
[debug] Proxy map: {}
[CSpan] 26640: Downloading webpage
[CSpan] 173494: Downloading JSON metadata
[CSpan] 173494: Downloading XML
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/home/pavel/apps/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 991, in process_info
    success = dl(filename, info_dict)
  File "/home/pavel/apps/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 967, in dl
    return fd.download(name, info)
  File "/home/pavel/apps/bin/youtube-dl/youtube_dl/downloader/common.py", line 290, in download
    return self.real_download(filename, info_dict)
  File "/home/pavel/apps/bin/youtube-dl/youtube_dl/downloader/http.py", line 52, in real_download
    data = self.ydl.urlopen(request)
  File "/home/pavel/apps/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1195, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
@jaimeMF jaimeMF added the bug label Mar 25, 2014
@zhaphod
Copy link

@zhaphod zhaphod commented Apr 3, 2014

Can you try again? It is working for me. If you get similar error try moving to the latest version and check again.

@phihag
Copy link
Contributor

@phihag phihag commented Apr 3, 2014

Yup, I used to be able to reproduce this, but now the download works just fine with 2014.04.04.

@spvkgn spvkgn closed this Apr 4, 2014
@spvkgn
Copy link
Author

@spvkgn spvkgn commented Apr 4, 2014

Thanks It works well now.

@stevecd
Copy link

@stevecd stevecd commented Apr 8, 2014

I'm still bumping into quite a few 403 forbiddens.

youtube-dl -v http://www.c-span.org/video/?318394-1/president-obama-women-economy
youtube-dl -v http://www.c-span.org/video/?301747-1/presidential-remarks-congressional-black-caucus
youtube-dl -v http://www.c-span.org/video/?291730-1/presidential-remarks-house-republican-conference

youtube-dl -v http://www.c-span.org/video/?297693-1/qa-former-president-george-w-bush
youtube-dl -v http://www.c-span.org/video/?300021-1/republican-leadership-conference-day-three

Haven't been able to identify what the difference is between urls that work and urls that don't.
They all generate the same debug output:

youtube-dl -v http://www.c-span.org/video/?318394-1/president-obama-women-economy
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.c-span.org/video/?318394-1/president-obama-women-economy']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.04.07.4
[debug] Python version 2.7.4 - Linux-3.8.0-19-generic-x86_64-with-LinuxMint-15-olivia
[debug] Proxy map: {}
[CSpan] 318394: Downloading webpage
[CSpan] 341758: Downloading JSON metadata
[CSpan] 341758: Downloading XML
[download] Downloading playlist: President Obama on Women and the Economy
[CSpan] playlist President Obama on Women and the Economy: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1007, in process_info
    success = dl(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 983, in dl
    return fd.download(name, info)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/common.py", line 291, in download
    return self.real_download(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/http.py", line 54, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
@stevecd
Copy link

@stevecd stevecd commented Apr 9, 2014

Not a python developer myself, so can't quite submit a pull for this issue, but it seems like c-span only has a few videos available in the method this script currently uses, which seems like it sends a request with an android user-agent. Emulating android in chrome and going to these non-working url's shows an error saying "This video is not available for this device".

I'm able to get around this by emulating an Apple iPad 3 / 4 , but the new link is to an m3u8 playlist file which I feed to avconv. So I think you may have to change more than a few things in the relevant script to do something similar.

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