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

Comedy Central fails with 400: bad request #3364

Closed
PinkPandaKatie opened this issue Jul 25, 2014 · 18 comments
Closed

Comedy Central fails with 400: bad request #3364

PinkPandaKatie opened this issue Jul 25, 2014 · 18 comments

Comments

@PinkPandaKatie
Copy link

@PinkPandaKatie PinkPandaKatie commented Jul 25, 2014

Both The Daily Show and Colbert Report are failing to download video data with 400: bad request:

http://thedailyshow.cc.com/full-episodes/3xkgk9/july-23--2014---george-takei
http://thecolbertreport.cc.com/full-episodes/y3i0t2/july-24--2014---elon-musk

The videos play in the online player, so their service is not down.

@phihag
Copy link
Contributor

@phihag phihag commented Jul 25, 2014

I can reproduce this problem. As a workaround, try adding -f rtmp-3500/rtmp2200 to your command-line to download via RTMP.

@ralfharing
Copy link
Contributor

@ralfharing ralfharing commented Jul 25, 2014

All the viacom sites (mtv, vh1) are failing because of the 400 error from the llnwd url.

@133794m3r
Copy link

@133794m3r 133794m3r commented Jul 25, 2014

this has been going on for 24hrs now or more as that's when I noticed it first.

@133794m3r
Copy link

@133794m3r 133794m3r commented Jul 26, 2014

also by the way, quite a few of the shows don't have the rtmp option on them, so it's an OK workaround sadly the newer shows don't have such a thing.

@philcanman
Copy link

@philcanman philcanman commented Jul 26, 2014

Still not working on southparkstudios

@133794m3r
Copy link

@133794m3r 133794m3r commented Jul 26, 2014

if that site doesn't have rtmp option then it won't work at all.

@philcanman
Copy link

@philcanman philcanman commented Jul 26, 2014

This site was working as of 7/22... Verbose output

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['http://southpark.cc.com/full-episodes/s07e01-im-a-l
ittle-bit-country', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2014.07.25.1
[debug] Python version 2.7.8 - Windows-7-6.1.7601-SP1
[debug] Proxy map: {}
[southpark.cc.com] s07e01-im-a-little-bit-country: Downloading webpage
[southpark.cc.com] 5fdf0526-ecfd-11e0-aca6-0026b9414f30: Downloading info
[southpark.cc.com] e6938328-ed00-11e0-aca6-0026b9414f30: Extracting information
[southpark.cc.com] e6938328-ed00-11e0-aca6-0026b9414f30: Downloading video urls
[southpark.cc.com] e693e0e8-ed00-11e0-aca6-0026b9414f30: Extracting information
[southpark.cc.com] e693e0e8-ed00-11e0-aca6-0026b9414f30: Downloading video urls
[southpark.cc.com] e69448f8-ed00-11e0-aca6-0026b9414f30: Extracting information
[southpark.cc.com] e69448f8-ed00-11e0-aca6-0026b9414f30: Downloading video urls
[debug] Invoking downloader on u'http://mtvnmobile.vo.llnwd.net/kip0/_pxn=1+_pxI
0=Ripod-h264+_pxL0=undefined+_pxM0=+_pxK=18639+_pxE=mp4/44620/mtvnorigin/gsp.com
edystor/com/sp/season-7/0701/acts/sp_0701_actHD_01_B_1280x720_1200.mp4'
ERROR: unable to download video data: HTTP Error 400: Bad Request
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 1022, in process_info
File "youtube_dl\YoutubeDL.pyo", line 998, in dl
File "youtube_dl\downloader\common.pyo", line 291, in download
File "youtube_dl\downloader\http.pyo", line 58, in real_download
File "youtube_dl\YoutubeDL.pyo", line 1231, in urlopen
File "urllib2.pyo", line 410, in open
File "urllib2.pyo", line 523, in http_response
File "urllib2.pyo", line 448, in error
File "urllib2.pyo", line 382, in _call_chain
File "urllib2.pyo", line 531, in http_error_default
HTTPError: HTTP Error 400: Bad Request

@the-dwarfer
Copy link

@the-dwarfer the-dwarfer commented Jul 27, 2014

Same issue with @midnight

@raindog469
Copy link

@raindog469 raindog469 commented Jul 28, 2014

Same problem, and in this case the RTMP workaround doesn't work (strangely, it did work on part 1 of the same video.)

$ time youtube-dl --verbose http://thecolbertreport.cc.com/videos/x9hnxr/vint-cerf-pt--2
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--no-mtime', '--verbose', 'http://thecolbertreport.cc.com/videos/x9hnxr/vint-cerf-pt--2']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.25.1
[debug] Python version 2.7.3 - Linux-3.2.0-60-generic-i686-with-Ubuntu-12.04-precise
[debug] Proxy map: {}
[ComedyCentralShows] vint-cerf-pt--2: Downloading webpage
[ComedyCentralShows] vint-cerf-pt--2: Downloading show index
[ComedyCentralShows] vint-cerf-pt--2: Downloading configuration for segment 1 / 1
[download] Downloading playlist: thecolbertreport Vint Cerf Pt. 2
[ComedyCentralShows] playlist thecolbertreport Vint Cerf Pt. 2: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
[debug] Invoking downloader on u'http://mtvnmobile.vo.llnwd.net/kip0/_pxn=1+_pxI0=Ripod-h264+_pxL0=undefined+_pxM0=+_pxK=18639+_pxE=mp4/44620/mtvnorigin/gsp.comedystor/com/colbert/season_10/episode_128/cr_10128_04_rev_512x288_750_m30.mp4'
ERROR: unable to download video data: HTTP Error 400: Bad Request
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/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 400: Bad Request

real 0m1.504s
user 0m0.728s
sys 0m0.056s

$ time youtube-dl -f rtmp-3500/rtmp2200 --verbose http://thecolbertreport.cc.com/videos/x9hnxr/vint-cerf-pt--2
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--no-mtime', '-f', 'rtmp-3500/rtmp2200', '--verbose', 'http://thecolbertreport.cc.com/videos/x9hnxr/vint-cerf-pt--2']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.25.1
[debug] Python version 2.7.3 - Linux-3.2.0-60-generic-i686-with-Ubuntu-12.04-precise
[debug] Proxy map: {}
[ComedyCentralShows] vint-cerf-pt--2: Downloading webpage
[ComedyCentralShows] vint-cerf-pt--2: Downloading show index
[ComedyCentralShows] vint-cerf-pt--2: Downloading configuration for segment 1 / 1
[download] Downloading playlist: thecolbertreport Vint Cerf Pt. 2
[ComedyCentralShows] playlist thecolbertreport Vint Cerf Pt. 2: Collected 1 video ids (downloading 1 of them)
[download] Downloading video #1 of 1
ERROR: requested format not available
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 527, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 645, in process_ie_result
extra_info=extra)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 564, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 822, in process_video_result
expected=True)
ExtractorError: requested format not available

real 0m2.040s
user 0m0.716s
sys 0m0.052s

@ghost
Copy link

@ghost ghost commented Aug 2, 2014

Anyone got anything new on this? The RTMP workaround helps a little, but at least for me it always stops downloading at 99.8 or 99.9% of each segment, so it's far from ideal.

@karlQY
Copy link

@karlQY karlQY commented Aug 2, 2014

@MatrixAgent The workaround works really nice for me. Do you really need the 0.1%? Do you recognize video content missing? The only thing which annoyed me, was the near endless length of time, when you wanted to fast-forward while watching the downloaded MP4 with VLC player, due to the corrupted file. Additional workaround: just copy the video and audio stream from your download and save it to a new MP4 container with FFmpeg:

ffmpeg -i download.mp4 -c:v copy -c:a copy verynice.mp4

Takes about 1 second conversion time per 1 minute of original video and of course without any loss in quality.

@ghost
Copy link

@ghost ghost commented Aug 2, 2014

I'm always copying the videostreams into a new file where all segments are in one place, I have a script that takes a URL and spits out the full episode – but due to the 0.01% missing problem I've had several cases of segments not downloading at all, or timeouting. It's not reliable and I can't automate it properly, that is the problem. When I always have to do some manual work for each episode, I might as well not download it but just turn on the proxy (I'm outside the US and with the latest change they also started blocking us again, it seems) and watch it in the browser. I just like downloading much better than using their shitty flash player. (I do realize it is a "first world problem".)

@pishposhmcgee
Copy link
Contributor

@pishposhmcgee pishposhmcgee commented Aug 3, 2014

Not sure if this helps, but the mediagen feed which youtube-dl uses allows for several options which may be helpful. For example, attempting to download the July 23 episode, youtube-dl (like the flash player) queries http://thecolbertreport.cc.com/feeds/mediagen/?uri=mgid:arc:episode:colbertnation.cc.com:dc4c312c-731e-44cb-bb08-8eb335861181&device={device}, from which it receives rtmp urls.

Several other options are available which may or may not be helpful. For example, leaving off the "device={device}" query parameter and adding "acceptMethods=hls" will provide Apple-style hls/m3u8 targets, while adding "acceptMethods=pd" will provide a downloadable file URI (though, notably, only at 512x288/750kbps). Unfortunately, I am currently unable to download the hls/m3u8 videos (either with curl or avconv) as all of the endpoints (after parsing the m3u8 manifests) result in "403 Access Denied" errors.

@master131
Copy link

@master131 master131 commented Aug 21, 2014

@pishposhmcgee To workaround the 403 error when attempting to download the various m3u8 manifests for the different qualities, crypt.key and segment.ts files, you must use the original cookie that is sent from the [Akamai] server when the master.m3u8 is obtained (this is the src URL provided by the mediagen). I have been able to download from various sites which use MTV services through ffmpeg on Windows by using the cookie.

@pishposhmcgee
Copy link
Contributor

@pishposhmcgee pishposhmcgee commented Oct 9, 2014

Out of curiosity, and because I cannot seem to find it in the documentation, is there a flag in avconv (perhaps similar to that in ffmpeg) to use a cookie, say one saved by curl --cookie-jar ...

@master131
Copy link

@master131 master131 commented Oct 10, 2014

I have not personally used avconv before but looking around on the internet, you can set a custom HTTP header with the 'headers' parameter. There you could probably add the cookies.

https://libav.org/avconv.html#http

I tried using the Windows build for avconv but it didn't work because of missing depedencies. However, this is how I got it to work using ffmpeg:

ffmpeg -i "<url from src tag in XML>" -headers "Cookie: <cookie value here>" "<output path>"

From what I can tell, the parameters for avconv should be similar or identical.

I have had another attempt at this but it seems that cookies are no longer used like that. It works fine with no cookies set. For example when I try to use curl with the m3u8 URL or even try loading the link directly into my browser, no errors appear. If you run into any videos that still behave like this, let me know which ones.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 14, 2014

Thanks to @RealDeviil and @pascalbrax, the mp4 urls will work again in the next version of youtube-dl.
Thanks for the report.

@phihag
Copy link
Contributor

@phihag phihag commented Nov 20, 2014

Fixed in youtube-dl 2014.11.20. See our FAQ if you have problems updating.

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