yt-dlp icon indicating copy to clipboard operation
yt-dlp copied to clipboard

[Odnoklassniki/ok.ru] not all formats detected for some videos

Open sebma opened this issue 1 year ago • 2 comments

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • [X] I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

France

Provide a description that is worded well enough to be understood

Hi, Prior to playing a video with mpv --ytdl-format, I always chose among the SD formats listed by the command yt-dlp --no-config --list-formats https://ok.ru/video/4794078595693. But it does not work on this url.

Thanks a lot for this great tool and for all your work and help you have done so far :+1:

God bless you.

Provide verbose output that clearly demonstrates the problem

  • [X] Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • [ ] If using API, add 'verbose': True to YoutubeDL params instead
  • [X] Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', '--no-config', '-F', 'https://ok.ru/video/4794078595693']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] [392389b7d] (pip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.15.0-60-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.4.1-static (setts), ffprobe 4.4-1ppa1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2020.12.05, mutagen-1.45.1, secretstorage-2.3.1, sqlite3-2.6.0, websockets-10.0
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: [email protected], Current version: [email protected]
yt-dlp is up to date ([email protected])
[Odnoklassniki] Extracting URL: https://ok.ru/video/4794078595693
[Odnoklassniki] 4794078595693: Downloading desktop webpage
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 4794078595693:
ID EXT RESOLUTION │ PROTO │ VCODEC  ACODEC
───────────────────────────────────────────
hd mp4 unknown    │ https │ unknown unknown

sebma avatar Mar 05 '23 18:03 sebma

Is your problem that you are only being offered a format called hd with unknown resolution, possibly because that's the only available format?

Or that this format is not available using mpv --ytdl-format=hd ...? WFM, but I have no idea whether mpv is calling yt-dl or yt-dlp under the hood.

dirkf avatar Mar 05 '23 19:03 dirkf

There are other formats available in the website player that are not being extracted. This should fix:

diff --git a/yt_dlp/extractor/odnoklassniki.py b/yt_dlp/extractor/odnoklassniki.py
index 4b73eed37..8462e7573 100644
--- a/yt_dlp/extractor/odnoklassniki.py
+++ b/yt_dlp/extractor/odnoklassniki.py
@@ -367,12 +367,17 @@ def _extract_desktop(self, url):
             'format_id': f['name'],
         } for f in metadata['videos']]
 
-        m3u8_url = metadata.get('hlsManifestUrl')
+        m3u8_url = traverse_obj(metadata, 'hlsManifestUrl', 'ondemandHls')
         if m3u8_url:
             formats.extend(self._extract_m3u8_formats(
                 m3u8_url, video_id, 'mp4', 'm3u8_native',
                 m3u8_id='hls', fatal=False))
 
+        mpd_url = metadata.get('ondemandDash')
+        if mpd_url:
+            formats.extend(self._extract_mpd_formats(
+                mpd_url, video_id, mpd_id='dash', fatal=False))
+
         dash_manifest = metadata.get('metadataEmbedded')
         if dash_manifest:
             formats.extend(self._parse_mpd_formats(

bashonly avatar Mar 05 '23 19:03 bashonly

Duplicate of #4462

bashonly avatar Jun 02 '23 22:06 bashonly