[Smotrim.ru] Source removed from supported? #25328

Open
opened 2026-02-21 13:45:29 -05:00 by deekerman · 13 comments
Owner

Originally created by @betterthanever2 on GitHub (Jun 21, 2022).

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.12.17
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[generic] 2426877: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 2426877: Downloading webpage
[generic] 2426877: Extracting information
ERROR: Unsupported URL: https://smotrim.ru/video/2426877
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\generic.py", line 3489, in _real_extract
youtube_dl.utils.UnsupportedError: Unsupported URL: https://smotrim.ru/video/2426877

Description

Just several days ago I was able to download vids from smotrim.ru (via generic extractor; example vid), but not anymore. Is this due to the change in their architecture, or is this some kind of ban on your side?

Originally created by @betterthanever2 on GitHub (Jun 21, 2022). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser. - Make sure that all URLs and arguments with special characters are properly quoted or escaped as explained in http://yt-dl.org/escape. - Search the bugtracker for similar issues: http://yt-dl.org/search-issues. DO NOT post duplicates. - Read bugs section in FAQ: http://yt-dl.org/reporting - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm reporting a broken site support issue - [x] I've verified that I'm running youtube-dl version **2021.12.17** - [x] I've checked that all provided URLs are alive and playable in a browser - [x] I've checked that all URLs and arguments with special characters are properly quoted or escaped - [x] I've searched the bugtracker for similar bug reports including closed ones - [x] I've read bugs section in FAQ ## Verbose log <!-- Provide the complete verbose output of youtube-dl that clearly demonstrates the problem. Add the `-v` flag to your command line you run youtube-dl with (`youtube-dl -v <your command line>`), copy the WHOLE output and insert it below. It should look similar to this: [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2021.12.17 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} <more lines> --> ``` [generic] 2426877: Requesting header WARNING: Falling back on generic information extractor. [generic] 2426877: Downloading webpage [generic] 2426877: Extracting information ERROR: Unsupported URL: https://smotrim.ru/video/2426877 Traceback (most recent call last): File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 815, in wrapper File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\YoutubeDL.py", line 836, in __extract_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\common.py", line 534, in extract File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpupik7c6w\build\youtube_dl\extractor\generic.py", line 3489, in _real_extract youtube_dl.utils.UnsupportedError: Unsupported URL: https://smotrim.ru/video/2426877 ``` ## Description <!-- Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible. If work on your issue requires account credentials please provide them or explain how one can obtain them. --> Just several days ago I was able to download vids from smotrim.ru (via generic extractor; [example vid](https://smotrim.ru/video/2426877)), but not anymore. Is this due to the change in their architecture, or is this some kind of ban on your side?
Author
Owner

@october262 commented on GitHub (Jun 21, 2022):

might want to try another video, the test link in your logs says source removed (taken down ??) when trying to play video.

@october262 commented on GitHub (Jun 21, 2022): might want to try another video, the test link in your logs says source removed (taken down ??) when trying to play video.
Author
Owner

@betterthanever2 commented on GitHub (Jun 21, 2022):

might want to try another video, the test link in your logs says source removed when trying to play video.

I don't know, this particular vid plays in my browser... Weird. When I look in the console, I see Uncaught TypeError: window.pl.data.user is null. Could that mean that they actually require user login?

@betterthanever2 commented on GitHub (Jun 21, 2022): > might want to try another video, the test link in your logs says source removed when trying to play video. I don't know, this particular vid plays in my browser... Weird. When I look in the console, I see `Uncaught TypeError: window.pl.data.user is null`. Could that mean that they actually require user login?
Author
Owner

@october262 commented on GitHub (Jun 21, 2022):

try the video again while logged in and using a cookies.txt file

@october262 commented on GitHub (Jun 21, 2022): try the video again while logged in and using a cookies.txt file
Author
Owner

@gamer191 commented on GitHub (Jun 21, 2022):

is this some kind of ban on your side?

Yeah, youtube-dl (which was last updated in December) includes a hidden virus in it that lets them modify your copy of the program, such as to block websites, without them even needing to release an update!

Just kidding, youtube-dl isn't Windows XP

Jokes aside, youtube-dl currently doesn't block Russian propaganda, and I honestly feel like Russia would rejoice if they did (because Russia's lies and propaganda would stop being so easy to archive). That is all just my opinion though, and I'm absolutely not an expert

@gamer191 commented on GitHub (Jun 21, 2022): > is this some kind of ban on your side? Yeah, youtube-dl (which was last updated in December) includes a hidden virus in it that lets them modify your copy of the program, such as to block websites, without them even needing to release an update! Just kidding, youtube-dl isn't [Windows XP](https://web.archive.org/web/20200219180230/http://slated.org/windows_by_stealth_the_updates_you_dont_want) Jokes aside, youtube-dl currently doesn't block Russian propaganda, and I honestly feel like Russia would rejoice if they did (because Russia's lies and propaganda would stop being so easy to archive). That is all just my opinion though, and I'm absolutely not an expert
Author
Owner

@betterthanever2 commented on GitHub (Jun 21, 2022):

Yeah, youtube-dl (which was last updated in December) includes a hidden virus in it that lets them modify your copy of the program, such as to block websites, without them even needing to release an update!

Yeah, I suppose it was a stupid assumption.

Jokes aside, youtube-dl currently doesn't block Russian propaganda, and I honestly feel like Russia would rejoice if they did (because Russia's lies and propaganda would stop being so easy to archive). That is all just my opinion though, and I'm absolutely not an expert

I agree 100%. Thanks for the info.

@betterthanever2 commented on GitHub (Jun 21, 2022): > Yeah, youtube-dl (which was last updated in December) includes a hidden virus in it that lets them modify your copy of the program, such as to block websites, without them even needing to release an update! Yeah, I suppose it was a stupid assumption. > Jokes aside, youtube-dl currently doesn't block Russian propaganda, and I honestly feel like Russia would rejoice if they did (because Russia's lies and propaganda would stop being so easy to archive). That is all just my opinion though, and I'm absolutely not an expert I agree 100%. Thanks for the info.
Author
Owner

@dirkf commented on GitHub (Jun 22, 2022):

Or perhaps there should be a bolshiy Translation Movement to show the rest of the world the nonsense that passes for news in today's Russia. Fortunately Putin Godwinned as his first move so there's no shame in others pointing out how he recapitulates Goebbels.

Anyhow smotrim.ru doesn't know about HTML syntax:

Error: The main element must not appear as a descendant of the main element.

From line 270, column 17; to line 270, column 51

          <main class="layout layout--video">↩     

Error: A document must not include more than one visible main element.

From line 270, column 17; to line 270, column 51

          <main class="layout layout--video">↩     

Apart from that it has nice ld+json that should be handled by the generic extractor, but (a) the ld+json extraction doesn't handle the embedUrl property (b) the URL there would need additional extraction to get player JSON from window.pl.data.dataUrl = '...'. In this case the link is //player.smotrim.ru/iframe/datavideo/id/2426877/sid/vh and the contents include this:

          "sources": {
            "m3u8": {
              "auto": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/vod_hls/definst/smil:vh/smil/002/582/836_d20220616020530.smil/playlist.m3u8?auth=mh&vid=2582836&uid=wKgcM2Ky+KW0HQx2yUfiAg=="
            },
            "http": {
              "234": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/low-wide/002/582/836.mp4?auth=mh&vid=2582836",
              "360": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/medium-wide/002/582/836.mp4?auth=mh&vid=2582836",
              "540": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/high-wide/002/582/836.mp4?auth=mh&vid=2582836",
              "720": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/hd-wide/002/582/836.mp4?auth=mh&vid=2582836",
              "1080": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/fhd-wide/002/582/836.mp4?auth=mh&vid=2582836"
            }
          }

Together with the ld+json metadata, that's all that's needed for extraction.

As to why the generic extraction no longer works, presumably the site code was changed.

@dirkf commented on GitHub (Jun 22, 2022): Or perhaps there should be a [bolshiy Translation Movement](https://www.economist.com/china/2022/05/19/a-new-twitter-account-shows-how-the-chinese-communist-party-stirs-up-ultra-nationalism) to show the rest of the world the nonsense that passes for news in today's Russia. Fortunately Putin [Godwin](https://en.wikipedia.org/wiki/Godwin%27s_law)ned as his first move so there's no shame in others pointing out how he recapitulates Goebbels. Anyhow smotrim.ru doesn't know about HTML syntax: ``` Error: The main element must not appear as a descendant of the main element. From line 270, column 17; to line 270, column 51 <main class="layout layout--video">↩ Error: A document must not include more than one visible main element. From line 270, column 17; to line 270, column 51 <main class="layout layout--video">↩ ``` Apart from that it has nice ld+json that should be handled by the generic extractor, but (a) the ld+json extraction doesn't handle the `embedUrl` property (b) the URL there would need additional extraction to get player JSON from `window.pl.data.dataUrl = '...'`. In this case the link is //player.smotrim.ru/iframe/datavideo/id/2426877/sid/vh and the contents include this: ```json "sources": { "m3u8": { "auto": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/vod_hls/definst/smil:vh/smil/002/582/836_d20220616020530.smil/playlist.m3u8?auth=mh&vid=2582836&uid=wKgcM2Ky+KW0HQx2yUfiAg==" }, "http": { "234": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/low-wide/002/582/836.mp4?auth=mh&vid=2582836", "360": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/medium-wide/002/582/836.mp4?auth=mh&vid=2582836", "540": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/high-wide/002/582/836.mp4?auth=mh&vid=2582836", "720": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/hd-wide/002/582/836.mp4?auth=mh&vid=2582836", "1080": "https://cdn-v.rtr-vesti.ru/_cdn_auth/secure/v/vh/mp4/fhd-wide/002/582/836.mp4?auth=mh&vid=2582836" } } ``` Together with the ld+json metadata, that's all that's needed for extraction. As to why the generic extraction no longer works, presumably the site code was changed.
Author
Owner

@betterthanever2 commented on GitHub (Jun 22, 2022):

Or perhaps there should be a bolshiy Translation Movement to show the rest of the world the nonsense that passes for news in today's Russia.

Wow. Thank you. Didn't know about this. I guess, what I'm doing then could be called a 'small translation movement'. BTW, if anybody would like to help me turn into the great one, let me know.

As for tech details you provided, they are curious, but could I use those links to download vids? I don't think Youtube-dl accepts direct links.

@betterthanever2 commented on GitHub (Jun 22, 2022): > Or perhaps there should be a [bolshiy Translation Movement](https://www.economist.com/china/2022/05/19/a-new-twitter-account-shows-how-the-chinese-communist-party-stirs-up-ultra-nationalism) to show the rest of the world the nonsense that passes for news in today's Russia. Wow. Thank you. Didn't know about this. I guess, [what I'm doing](https://shoomow.info/wp-admin/post.php?post=144&action=edit) then could be called a 'small translation movement'. BTW, if anybody would like to help me turn into the great one, let me know. As for tech details you provided, they are curious, but could I use those links to download vids? I don't think Youtube-dl accepts direct links.
Author
Owner

@dirkf commented on GitHub (Jun 22, 2022):

I'm getting 504 Gateway Time-out for the media links that I quoted, even with Referer set and various plausible UAs, and also in the browser, but that may be a UK privilege. yt-dl should be able to analyse the m3u8 link and download a selected stream.

The link to your site is your owner's link, but eg Russia To Europe Is Like Chechnya to Russia -- how true.

@dirkf commented on GitHub (Jun 22, 2022): I'm getting 504 Gateway Time-out for the media links that I quoted, even with `Referer` set and various plausible UAs, and also in the browser, but that may be a UK privilege. yt-dl should be able to analyse the m3u8 link and download a selected stream. The link to your site is your owner's link, but eg [Russia To Europe Is Like Chechnya to Russia](https://shoomow.info/?p=1370&lang=en) -- how true.
Author
Owner

@betterthanever2 commented on GitHub (Jun 22, 2022):

The link to your site is your owner's link

I see what you mean. Am I a moron or what? :D Here's the public view link.
Thanks for working on the issue!

@betterthanever2 commented on GitHub (Jun 22, 2022): > The link to your site is your owner's link I see what you mean. Am I a moron or what? :D Here's the [public view link](https://shoomow.info/?p=144&lang=en). Thanks for working on the issue!
Author
Owner

@gamer191 commented on GitHub (Jun 22, 2022):

Wow. Thank you. Didn't know about this. I guess, what I'm doing then could be called a 'small translation movement'.

I owe you an apology, because I initially assumed that you were a pro-Putin conspiracy theorist (which is why my original message was rude and sarcastic). Sorry

@gamer191 commented on GitHub (Jun 22, 2022): > Wow. Thank you. Didn't know about this. I guess, [what I'm doing](https://shoomow.info/wp-admin/post.php?post=144&action=edit) then could be called a 'small translation movement'. I owe you an apology, because I initially assumed that you were a pro-Putin conspiracy theorist (which is why my original message was rude and sarcastic). Sorry
Author
Owner

@betterthanever2 commented on GitHub (Jun 22, 2022):

I owe you an apology, because I initially assumed that you were a pro-Putin conspiracy theorist (which is why my original message was rude and sarcastic). Sorry

All is cool :) And just so you know: what you think is rude is actually childplay in comparison with what these people say in their endless ramblings. The definition of toxic, they are.

@betterthanever2 commented on GitHub (Jun 22, 2022): > I owe you an apology, because I initially assumed that you were a pro-Putin conspiracy theorist (which is why my original message was rude and sarcastic). Sorry All is cool :) And just so you know: what you think is rude is actually childplay in comparison with what these people say in their endless ramblings. The definition of toxic, they are.
Author
Owner

@kvk-2015 commented on GitHub (Jul 2, 2022):

Just add |smotrim\.ru in _VALID_URL and two more places in rutv.py. May be right solution.

@kvk-2015 commented on GitHub (Jul 2, 2022): Just add |smotrim\\.ru in _VALID_URL and two more places in rutv.py. May be right solution.
Author
Owner

@dirkf commented on GitHub (Jul 3, 2022):

Indeed. From the UK player.rutv.ru is not responding, but player.smotrim.ru is fine:

--- old/youtube_dl/extractor/rutv.py
+++ new/youtube_dl/extractor/rutv.py
@@ -15,11 +15,12 @@ class RUTVIE(InfoExtractor):
     IE_DESC = 'RUTV.RU'
     _VALID_URL = r'''(?x)
                     https?://
-                        (?:test)?player\.(?:rutv\.ru|vgtrk\.com)/
+                        (?:(?:test)?player\.)?(?:rutv\.ru|vgtrk\.com|smotrim\.ru)/
                         (?P<path>
                             flash\d+v/container\.swf\?id=|
                             iframe/(?P<type>swf|video|live)/id/|
-                            index/iframe/cast_id/
+                            index/iframe/cast_id/|
+                            (?<=smotrim\.ru/)video/
                         )
                         (?P<id>\d+)
                     '''
@@ -52,6 +53,7 @@ class RUTVIE(InfoExtractor):
                 # m3u8 download
                 'skip_download': True,
             },
+            'skip': 'Not found -- 1113: Видео недоступно для просмотра (404)',
         },
         {
             'url': 'http://player.rutv.ru/iframe/swf/id/766888/sid/hitech/?acc_video_id=4000',
@@ -97,6 +99,7 @@ class RUTVIE(InfoExtractor):
                 'id': '21',
                 'ext': 'mp4',
                 'title': 're:^Россия 24. Прямой эфир [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
+                'description': 'Прямой эфир информационного телеканала "Россия 24". Новости, интервью, репортажи 24 часа в сутки.',
                 'is_live': True,
             },
             'params': {
@@ -108,6 +111,19 @@ class RUTVIE(InfoExtractor):
             'url': 'https://testplayer.vgtrk.com/iframe/live/id/19201/showZoomBtn/false/isPlay/true/',
             'only_matching': True,
         },
+        {
+            'url': 'https://smotrim.ru/video/2426877',
+            'info_dict': {
+                'id': '2426877',
+                'ext': 'mp4',
+                'title': 'Вечер с Владимиром Соловьевым. Украина, Запад и политические кидалы. Эфир от 15.06.2022',
+                'description': 'md5:cf87249921fe6877ab439cf6d41c730f',
+            },
+            'params': {
+                # m3u8 download
+                'skip_download': True,
+            },
+        },
     ]
 
     @classmethod
@@ -127,24 +143,25 @@ class RUTVIE(InfoExtractor):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
         video_path = mobj.group('path')
+        player = 'http://player.smotrim.ru'
 
-        if re.match(r'flash\d+v', video_path):
-            video_type = 'video'
-        elif video_path.startswith('iframe'):
+        if video_path.startswith('iframe'):
             video_type = mobj.group('type')
             if video_type == 'swf':
                 video_type = 'video'
         elif video_path.startswith('index/iframe/cast_id'):
             video_type = 'live'
+        else:
+            video_type = 'video'
 
         is_live = video_type == 'live'
 
         json_data = self._download_json(
-            'http://player.rutv.ru/iframe/data%s/id/%s' % ('live' if is_live else 'video', video_id),
+            '%s/iframe/data%s/id/%s' % (player, 'live' if is_live else 'video', video_id),
             video_id, 'Downloading JSON')
 
-        if json_data['errors']:
-            raise ExtractorError('%s said: %s' % (self.IE_NAME, json_data['errors']), expected=True)
+        if json_data.get('errors'):
+            raise ExtractorError('%s said: %s (%s)' % (self.IE_NAME, json_data['errors'], json_data.get('status', '-')), expected=True)
 
         playlist = json_data['data']['playlist']
         medialist = playlist['medialist']
@@ -153,7 +170,7 @@ class RUTVIE(InfoExtractor):
         if media['errors']:
             raise ExtractorError('%s said: %s' % (self.IE_NAME, media['errors']), expected=True)
 
-        view_count = playlist.get('count_views')
+        view_count = int_or_none(playlist.get('count_views'))
         priority_transport = playlist['priority_transport']
 
         thumbnail = media['picture']
@@ -176,8 +193,8 @@ class RUTVIE(InfoExtractor):
                         'url': mobj.group('url'),
                         'play_path': mobj.group('playpath'),
                         'app': mobj.group('app'),
-                        'page_url': 'http://player.rutv.ru',
-                        'player_url': 'http://player.rutv.ru/flash3v/osmf.swf?i=22',
+                        'page_url': player,
+                        'player_url': player + '/flash3v/osmf.swf?i=22',
                         'rtmp_live': True,
                         'ext': 'flv',
                         'vbr': str_to_int(quality),
@dirkf commented on GitHub (Jul 3, 2022): Indeed. From the UK `player.rutv.ru` is not responding, but `player.smotrim.ru` is fine: ```diff --- old/youtube_dl/extractor/rutv.py +++ new/youtube_dl/extractor/rutv.py @@ -15,11 +15,12 @@ class RUTVIE(InfoExtractor): IE_DESC = 'RUTV.RU' _VALID_URL = r'''(?x) https?:// - (?:test)?player\.(?:rutv\.ru|vgtrk\.com)/ + (?:(?:test)?player\.)?(?:rutv\.ru|vgtrk\.com|smotrim\.ru)/ (?P<path> flash\d+v/container\.swf\?id=| iframe/(?P<type>swf|video|live)/id/| - index/iframe/cast_id/ + index/iframe/cast_id/| + (?<=smotrim\.ru/)video/ ) (?P<id>\d+) ''' @@ -52,6 +53,7 @@ class RUTVIE(InfoExtractor): # m3u8 download 'skip_download': True, }, + 'skip': 'Not found -- 1113: Видео недоступно для просмотра (404)', }, { 'url': 'http://player.rutv.ru/iframe/swf/id/766888/sid/hitech/?acc_video_id=4000', @@ -97,6 +99,7 @@ class RUTVIE(InfoExtractor): 'id': '21', 'ext': 'mp4', 'title': 're:^Россия 24. Прямой эфир [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$', + 'description': 'Прямой эфир информационного телеканала "Россия 24". Новости, интервью, репортажи 24 часа в сутки.', 'is_live': True, }, 'params': { @@ -108,6 +111,19 @@ class RUTVIE(InfoExtractor): 'url': 'https://testplayer.vgtrk.com/iframe/live/id/19201/showZoomBtn/false/isPlay/true/', 'only_matching': True, }, + { + 'url': 'https://smotrim.ru/video/2426877', + 'info_dict': { + 'id': '2426877', + 'ext': 'mp4', + 'title': 'Вечер с Владимиром Соловьевым. Украина, Запад и политические кидалы. Эфир от 15.06.2022', + 'description': 'md5:cf87249921fe6877ab439cf6d41c730f', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, ] @classmethod @@ -127,24 +143,25 @@ class RUTVIE(InfoExtractor): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') video_path = mobj.group('path') + player = 'http://player.smotrim.ru' - if re.match(r'flash\d+v', video_path): - video_type = 'video' - elif video_path.startswith('iframe'): + if video_path.startswith('iframe'): video_type = mobj.group('type') if video_type == 'swf': video_type = 'video' elif video_path.startswith('index/iframe/cast_id'): video_type = 'live' + else: + video_type = 'video' is_live = video_type == 'live' json_data = self._download_json( - 'http://player.rutv.ru/iframe/data%s/id/%s' % ('live' if is_live else 'video', video_id), + '%s/iframe/data%s/id/%s' % (player, 'live' if is_live else 'video', video_id), video_id, 'Downloading JSON') - if json_data['errors']: - raise ExtractorError('%s said: %s' % (self.IE_NAME, json_data['errors']), expected=True) + if json_data.get('errors'): + raise ExtractorError('%s said: %s (%s)' % (self.IE_NAME, json_data['errors'], json_data.get('status', '-')), expected=True) playlist = json_data['data']['playlist'] medialist = playlist['medialist'] @@ -153,7 +170,7 @@ class RUTVIE(InfoExtractor): if media['errors']: raise ExtractorError('%s said: %s' % (self.IE_NAME, media['errors']), expected=True) - view_count = playlist.get('count_views') + view_count = int_or_none(playlist.get('count_views')) priority_transport = playlist['priority_transport'] thumbnail = media['picture'] @@ -176,8 +193,8 @@ class RUTVIE(InfoExtractor): 'url': mobj.group('url'), 'play_path': mobj.group('playpath'), 'app': mobj.group('app'), - 'page_url': 'http://player.rutv.ru', - 'player_url': 'http://player.rutv.ru/flash3v/osmf.swf?i=22', + 'page_url': player, + 'player_url': player + '/flash3v/osmf.swf?i=22', 'rtmp_live': True, 'ext': 'flv', 'vbr': str_to_int(quality), ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl-ytdl-org#25328
No description provided.