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

Issue with downloading YouTube live stream #5545

Open
dundua opened this issue Apr 28, 2015 · 2 comments
Open

Issue with downloading YouTube live stream #5545

dundua opened this issue Apr 28, 2015 · 2 comments

Comments

@dundua
Copy link
Contributor

@dundua dundua commented Apr 28, 2015

I am trying to download a video that was originally part of a live stream but youtube-dl gives the error "ERROR: unable to download video data: HTTP Error 400: Bad Request". The specific video in question is https://www.youtube.com/watch?v=gTMnJNEWip4

The issue seems to be related to the format type since downloading the .3gp format type seems to work, but the mp4 dash do not. On the actual YouTube page, watching it with the mp4 dash formats work, so it seems to be an issue when obtaining the links.

Below is the output from my download script

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--ignore-errors', '--no-continue', '--no-overwrites', '--keep-video', '--no-post-overwrites', '--download-archive', 'archive.txt', '--write-description', '--write-info-json', '--write-annotations', '--write-thumbnail', '--all-subs', '--output', '%(uploader)s (%(uploader_id)s)/%(id)s/%(title)s - %(upload_date)s.%(ext)s', '-f', 'bestvideo+bestaudio/best', 'https://www.youtube.com/watch?v=gTMnJNEWip4']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.04.26
[debug] Python version 3.2.3 - Linux-3.8.13-bone47-armv7l-with-debian-7.4
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] gTMnJNEWip4: Downloading webpage
[youtube] gTMnJNEWip4: Extracting video information
WARNING: video doesn't have subtitles
[youtube] gTMnJNEWip4: Searching for annotations.
[youtube] gTMnJNEWip4: Downloading DASH manifest
[info] Video description is already present
[info] Video annotations are already present
[info] Video description metadata is already present
[youtube] gTMnJNEWip4: Thumbnail is already present
WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won't be merged
[debug] Invoking downloader on 'https://r9---sn-o097zne6.googlevideo.com/videoplayback/id/gTMnJNEWip4.1/itag/136/source/yt_live_broadcast/requiressl/yes/pmbypass/yes/gcr/us/playlist_type/CLEAN/ratebypass/yes/cmbypass/yes/mime/video%2Fmp4/live/1/gir/yes/signature/4E6CC3C889827CB8F5408B61C3214E911332A1C6.1E39BF49133E395D341567362CDAFCB91AA3730B/key/cms1/fexp/900720,903945,907263,924637,934954,936122,938028,9406013,9406631,9406705,9407115,9407433,9408093,9408142,9408347,9408705,9408807,9412491,943611,947233,948124,948703,948913,951703,952612,952637,952640,957201/sver/3/upn/ni-xyYIvMQY/ip/207.62.170.223/ipbits/0/expire/1430238687/sparams/cmbypass,expire,gcr,gir,id,ip,ipbits,itag,live,mime,mm,ms,mv,pl,playlist_type,pmbypass,ratebypass,requiressl,source/mm/32/ms/lv/mt/1430216757/mv/u/pl/17'
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 1408, in process_info
    partial_success = dl(fname, new_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1363, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 342, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 64, in real_download
    data = self.ydl.urlopen(request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1701, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.2/urllib/request.py", line 376, in open
    response = meth(req, response)
  File "/usr/lib/python3.2/urllib/request.py", line 488, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.2/urllib/request.py", line 414, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.2/urllib/request.py", line 348, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.2/urllib/request.py", line 496, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

And the formats available

root@beaglebone:~# youtube-dl -F gTMnJNEWip4 -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-F', 'gTMnJNEWip4', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.04.26
[debug] Python version 3.2.3 - Linux-3.8.13-bone47-armv7l-with-debian-7.4
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] gTMnJNEWip4: Downloading webpage
[youtube] gTMnJNEWip4: Extracting video information
[youtube] gTMnJNEWip4: Downloading DASH manifest
[info] Available formats for gTMnJNEWip4:
format code  extension  resolution note
140          m4a        audio only DASH audio  144k , m4a_dash container, aac  @128k (48000Hz)
141          m4a        audio only DASH audio  272k , m4a_dash container, aac  @256k (48000Hz)
160          mp4        256x144    DASH video  124k , 15fps, video only
133          mp4        426x240    DASH video  258k , 30fps, video only
134          mp4        640x360    DASH video  616k , 30fps, video only
135          mp4        854x480    DASH video 1116k , 30fps, video only
136          mp4        1280x720   DASH video 2216k , 30fps, video only
17           3gp        176x144
36           3gp        320x240    (best)
@lukeify
Copy link

@lukeify lukeify commented Apr 28, 2015

I'm also having the same issue, which I cannot resolve.

ERROR: unable to download video data: HTTP Error 400: Bad Request

A livestream is only available in 3gp, I want it in 1080p. Is there a workaround or fix for this issue?

Luke$ youtube-dl -F nBwAYT_ogj4 -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-F', u'nBwAYT_ogj4', u'-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.04.26
[debug] Python version 2.7.6 - Darwin-14.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.6.2, ffprobe 2.6.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] nBwAYT_ogj4: Downloading webpage
[youtube] nBwAYT_ogj4: Extracting video information
[youtube] nBwAYT_ogj4: Downloading DASH manifest
[info] Available formats for nBwAYT_ogj4:
format code  extension  resolution note
140          m4a        audio only DASH audio  144k , m4a_dash container, aac  @128k (48000Hz)
141          m4a        audio only DASH audio  272k , m4a_dash container, aac  @256k (48000Hz)
160          mp4        256x144    DASH video  124k , 15fps, video only
133          mp4        426x240    DASH video  258k , 30fps, video only
134          mp4        640x360    DASH video  616k , 30fps, video only
135          mp4        854x480    DASH video 1116k , 30fps, video only
136          mp4        1280x720   DASH video 2216k , 30fps, video only
137          mp4        1920x1080  DASH video 4141k , 30fps, video only
17           3gp        176x144    
36           3gp        320x240    (best)
@dundua
Copy link
Contributor Author

@dundua dundua commented Apr 29, 2015

Seems like YouTube had to process the video into additional formats. The new format list is shown below. Downloading the highest quality dash video seems to work.

root@beaglebone:~# youtube-dl -F gTMnJNEWip4 -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-F', 'gTMnJNEWip4', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.04.26
[debug] Python version 3.2.3 - Linux-3.8.13-bone47-armv7l-with-debian-7.4
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] gTMnJNEWip4: Downloading webpage
[youtube] gTMnJNEWip4: Extracting video information
[youtube] gTMnJNEWip4: Downloading DASH manifest
[info] Available formats for gTMnJNEWip4:
format code  extension  resolution note
140          m4a        audio only DASH audio  134k , m4a_dash container, aac  @128k (44100Hz), 82.05MiB
141          m4a        audio only DASH audio  260k , m4a_dash container, aac  @256k (44100Hz), 162.94MiB
160          mp4        256x144    DASH video  130k , 13fps, video only, 69.86MiB
133          mp4        426x240    DASH video  271k , 26fps, video only, 156.50MiB
134          mp4        640x360    DASH video  528k , 26fps, video only, 196.95MiB
135          mp4        854x480    DASH video 1038k , 26fps, video only, 418.88MiB
298          mp4        1280x720   DASH video 2548k , h264, 53fps, video only, 1.19GiB
17           3gp        176x144
36           3gp        320x240
5            flv        400x240
18           mp4        640x360
22           mp4        1280x720   (best)
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
3 participants
@lukeify @dundua and others
You can’t perform that action at this time.