diff options
author | KiberInfinity <kiberinfinity@gmail.com> | 2022-01-31 20:37:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 00:07:07 +0530 |
commit | b8b3f4562a95a3c6b3b47544d1a5e8390a5650fa (patch) | |
tree | c7be977525ffd3e0104fcb653c0c136696dac4c5 | |
parent | 1c6f480160199d88b8e3d278befe6eec099b619d (diff) | |
download | hypervideo-pre-b8b3f4562a95a3c6b3b47544d1a5e8390a5650fa.tar.lz hypervideo-pre-b8b3f4562a95a3c6b3b47544d1a5e8390a5650fa.tar.xz hypervideo-pre-b8b3f4562a95a3c6b3b47544d1a5e8390a5650fa.zip |
[Odnoklassniki] Improve embedded players extraction (#2549)
Authored by: KiberInfinity
-rw-r--r-- | yt_dlp/extractor/odnoklassniki.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/yt_dlp/extractor/odnoklassniki.py b/yt_dlp/extractor/odnoklassniki.py index 42f210a9b..293f1aa60 100644 --- a/yt_dlp/extractor/odnoklassniki.py +++ b/yt_dlp/extractor/odnoklassniki.py @@ -35,6 +35,38 @@ class OdnoklassnikiIE(InfoExtractor): (?P<id>[\d-]+) ''' _TESTS = [{ + 'note': 'Coub embedded', + 'url': 'http://ok.ru/video/1484130554189', + 'info_dict': { + 'id': '1keok9', + 'ext': 'mp4', + 'timestamp': 1545580896, + 'view_count': int, + 'thumbnail': 'https://coub-anubis-a.akamaized.net/coub_storage/coub/simple/cw_image/c5ac87553bd/608e806a1239c210ab692/1545580913_00026.jpg', + 'title': 'Народная забава', + 'uploader': 'Nevata', + 'upload_date': '20181223', + 'age_limit': 0, + 'uploader_id': 'nevata.s', + 'like_count': int, + 'duration': 8.08, + 'repost_count': int, + }, + }, { + 'note': 'vk.com embedded', + 'url': 'https://ok.ru/video/3568183087575', + 'info_dict': { + 'id': '-165101755_456243749', + 'ext': 'mp4', + 'uploader_id': '-165101755', + 'duration': 132, + 'timestamp': 1642869935, + 'upload_date': '20220122', + 'thumbnail': str, + 'title': str, + 'uploader': str, + }, + }, { # metadata in JSON 'url': 'http://ok.ru/video/20079905452', 'md5': '0b62089b479e06681abaaca9d204f152', @@ -171,6 +203,10 @@ class OdnoklassnikiIE(InfoExtractor): webpage, 'player', group='player')), video_id) + # embedded external player + if player.get('isExternalPlayer') and player.get('url'): + return self.url_result(player['url']) + flashvars = player['flashvars'] metadata = flashvars.get('metadata') @@ -226,6 +262,14 @@ class OdnoklassnikiIE(InfoExtractor): 'start_time': start_time, } + # pladform + if provider == 'OPEN_GRAPH': + info.update({ + '_type': 'url_transparent', + 'url': movie['contentId'], + }) + return info + if provider == 'USER_YOUTUBE': info.update({ '_type': 'url_transparent', |