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.72k stars 10.07k forks source link

[CSPAN] 403 Error #3524

Closed anovicecodemonkey closed 8 years ago

anovicecodemonkey commented 10 years ago
$ youtube-dl --verbose http://www.c-span.org/video/?321005-1/news-conference-confidential-news-sources
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.c-span.org/video/?321005-1/news-conference-confidential-news-sources']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.08.10
[debug] Python version 3.4.1 - Linux-3.15.8-1-ARCH-x86_64-with-arch
[debug] Proxy map: {}
[CSpan] 321005: Downloading webpage
[CSpan] 360476: Downloading JSON metadata
[CSpan] 360476: Downloading XML
[download] Downloading playlist: Freedom of the Press
[CSpan] playlist Freedom of the Press: Collected 4 video ids (downloading 4 of them)
[download] Downloading video #1 of 4
[debug] Invoking downloader on 'http://d19cp144waw2mw.cloudfront.net/2014/08/14/20140814165918001_hd.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cDovL2QxOWNwMTQ0d2F3Mm13LmNsb3VkZnJvbnQubmV0LzIwMTQvMDgvMTQvMjAxNDA4MTQxNjU5MTgwMDFfaGQubXA0IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDA4MTM0MjE3fSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJcCI6IjUwLjIzLjExMy4yNDUifX19XX0_&Key-Pair-Id=APKAIHKVWBEAXX562G7Q&Signature=CrpkaGRhh4kQkz-oNz8j0b5SjtZsS0C9YHfqyeeJn-0cYFkbrF0RyXPIccBB~FQ-q5F5iaZvbGIjr~s07oPQ-tf6z4Gnn7wqP093-GLjLL77u7M8iI~SPkRyM--L8BOQIfT--gA8tFt5WnxzOyfoDNSyscHe--32dAd~oKZ8WnY_'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1022, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 998, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 291, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 58, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1231, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.4/urllib/request.py", line 461, in open
    response = meth(req, response)
  File "/usr/lib/python3.4/urllib/request.py", line 571, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.4/urllib/request.py", line 499, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.4/urllib/request.py", line 579, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
isez commented 10 years ago

One way I got around this was changing cspan.py in source.

The line in cspan.py I changed was info_url = 'http://c-spanvideo.org/videoLibrary/assets/player/ajax-player.php?os=android&html5=program&id='

I changed os=android to os=windows. This enabled the download, but on my distribution of Debian, I have an older and less complete ffmpeg, which gave me a playlist unknown format error. so I used this guide: http://www.e-rave.nl/installing-ffmpeg-on-debian-squeeze-and-newer to install ffmpeg from source. After getting it installed properly I can now download those videos that gave me 403 forbidden error.

remitamine commented 8 years ago

it's working with the latest version:

python2 __main__.py http://www.c-span.org/video/?321005-1/news-conference-confidential-news-sources
[CSpan] 321005: Downloading webpage
[CSpan] 360476: Downloading JSON metadata
[CSpan] 360476: Downloading XML
WARNING: ar subtitles not available for 360476
WARNING: arME subtitles not available for 360476
[info] Writing video subtitles to: Freedom of the Press-360476.en.dfxp
[download] Destination: Freedom of the Press-360476.mp4
[#29c53b 5.0MiB/589MiB(0%) CN:16 DL:187KiB ETA:53m5s]