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.3k stars 10.03k forks source link

Generic format names for Odnoklassniki don't work #25461

Open malhonen opened 4 years ago

malhonen commented 4 years ago

Verbose log

youtube-dl https://ok.ru/video/311973053873 -f mobile -v

[debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'https://ok.ru/video/311973053873', u'-f', u'mobile', u'-v'] [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2020.05.29 [debug] Python version 2.7.17 (CPython) - Linux-4.15.0-101-generic-x86_64-with-Ubuntu-18.04-bionic [debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs 2.1.1, rtmpdump 2.4 [debug] Proxy map: {} [Odnoklassniki] 311973053873: Downloading webpage [Odnoklassniki] 311973053873: Downloading m3u8 information [debug] Invoking downloader on u'https://vd79.mycdn.me/?expires=1590921576014&srcIp=41.188.101.22&srcAg=CHROME&ms=185.16.245.75&type=4&sig=kUP9wv8VS0A&ct=0&urls=5.61.21.100&clientType=0&id=319081876145' ERROR: unable to download video data: HTTP Error 400: Bad Request Traceback (most recent call last): File "/home/miikku/bin/youtube-dl-new/youtube_dl/YoutubeDL.py", line 1926, in process_info success = dl(filename, info_dict) File "/home/miikku/bin/youtube-dl-new/youtube_dl/YoutubeDL.py", line 1865, in dl return fd.download(name, info) File "/home/miikku/bin/youtube-dl-new/youtube_dl/downloader/common.py", line 366, in download return self.real_download(filename, info_dict) File "/home/miikku/bin/youtube-dl-new/youtube_dl/downloader/http.py", line 341, in real_download establish_connection() File "/home/miikku/bin/youtube-dl-new/youtube_dl/downloader/http.py", line 109, in establish_connection ctx.data = self.ydl.urlopen(request) File "/home/miikku/bin/youtube-dl-new/youtube_dl/YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/usr/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) HTTPError: HTTP Error 400: Bad Request

Description

For each video, Odnoklassniki lists several formats when you pass the -F argument, as follows:

[Odnoklassniki] 311973053873: Downloading webpage [Odnoklassniki] 311973053873: Downloading m3u8 information [info] Available formats for 311973053873: format code extension resolution note mobile mp4 unknown
mpd-1 mp4 256x144 DASH video 118k , mp4_dash container, avc1.42C01E, 25fps, mp4a.40.2 (857761146Hz) hls-153 mp4 256x144 153k lowest mp4 unknown
mpd-2 mp4 426x238 DASH video 307k , mp4_dash container, avc1.42C01E, 25fps, mp4a.40.2 (857761146Hz) hls-358 mp4 426x238 358k low mp4 unknown
mpd-3 mp4 640x360 DASH video 652k , mp4_dash container, avc1.64001E, 25fps, mp4a.40.2 (857761146Hz) hls-731 mp4 640x360 731k sd mp4 unknown
mpd-4 mp4 852x478 DASH video 729k , mp4_dash container, avc1.64001E, 25fps, mp4a.40.2 (857761146Hz) hls-817 mp4 852x478 817k (best)

The numbering of the hls- formats is different for each video, whereas the names of the mpd- formats stay constant with up to 5 different levels. In addition, there are generic names "mobile, lowest, low, sd, hd" which are presumably supposed to be synonymous for one of the others. Downloading a video with a specified hls- or mpd- format works fine but the generic names produce a "HTTP 400 Bad request". This happens with all the videos I have tested recently, though I think earlier they used to work.

xibr commented 3 years ago

I have the same problem here but if I use youtube-dl -f full https://ok.ru/video/2277836262126 --external-downloader axel It works successfully. Or if i turn on vpn it works fine youtube-dl -f full https://ok.ru/video/2277836262126

in other format work fine, only happens with this format "mobile, lowest, low, sd, hd, full"

youtube-dl --verbose -f full https://ok.ru/video/2277836262126
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', '-f', 'full', 'https://ok.ru/video/2277836262126']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.12.29
[debug] Python version 3.8.5 (CPython) - Linux-5.4.0-58-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[Odnoklassniki] 2277836262126: Downloading webpage
[Odnoklassniki] 2277836262126: Downloading m3u8 information
[debug] Invoking downloader on 'https://vd334.mycdn.me/?expires=1609416540870&srcIp=5.36.128.247&srcAg=CHROME&ms=185.226.53.43&type=5&sig=q6CMfid47LI&ct=0&urls=185.226.52.59&clientType=0&id=1119688592110'
ERROR: unable to download video data: HTTP Error 400: Bad Request
Traceback (most recent call last):
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 1936, in process_info
    success = dl(filename, info_dict)
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 1875, in dl
    return fd.download(name, info)
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/downloader/http.py", line 351, in real_download
    establish_connection()
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/downloader/http.py", line 116, in establish_connection
    raise err
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/downloader/http.py", line 110, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/home/ibr/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2248, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
remitamine commented 3 years ago
youtube-dl -f mobile https://ok.ru/video/311973053873
[Odnoklassniki] 311973053873: Downloading webpage
[Odnoklassniki] 311973053873: Downloading m3u8 information
[download] Destination: Соловья не так просто увидеть близко! Наслаждайтесь! Это волшебно-311973053873.mp4
[download] 100% of 754.38KiB in 00:04
youtube-dl -f full https://ok.ru/video/2277836262126
[Odnoklassniki] 2277836262126: Downloading webpage
[Odnoklassniki] 2277836262126: Downloading m3u8 information
[download] Destination: #ЖИТЬ _ Новогодние чудеса (0+)-2277836262126.mp4
[download]   0.7% of 136.33MiB at 237.81KiB/s ETA 09:42