diff options
author | Jesús <heckyel@hyperbola.info> | 2022-02-05 10:48:13 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-02-05 10:48:13 -0500 |
commit | c4b763b19f54ed5dfc2fd408adb9ed74126f6740 (patch) | |
tree | 1bbf4450644370608f97bf6d4d7db818c5039f55 /yt_dlp/extractor/pladform.py | |
parent | 5aac4e0267e32d98eb68692afedafda3b41ea629 (diff) | |
parent | a3125791c7a5cdf2c8c025b99788bf686edd1a8a (diff) | |
download | hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.lz hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.tar.xz hypervideo-pre-c4b763b19f54ed5dfc2fd408adb9ed74126f6740.zip |
updated from upstream | 05/02/2022 at 10:48
Diffstat (limited to 'yt_dlp/extractor/pladform.py')
-rw-r--r-- | yt_dlp/extractor/pladform.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/yt_dlp/extractor/pladform.py b/yt_dlp/extractor/pladform.py index dc2030017..99ade85ec 100644 --- a/yt_dlp/extractor/pladform.py +++ b/yt_dlp/extractor/pladform.py @@ -28,6 +28,24 @@ class PladformIE(InfoExtractor): (?P<id>\d+) ''' _TESTS = [{ + 'url': 'http://out.pladform.ru/player?pl=18079&type=html5&videoid=100231282', + 'info_dict': { + 'id': '6216d548e755edae6e8280667d774791', + 'ext': 'mp4', + 'timestamp': 1406117012, + 'title': 'Гарик Мартиросян и Гарик Харламов - Кастинг на концерт ко Дню милиции', + 'age_limit': 0, + 'upload_date': '20140723', + 'thumbnail': str, + 'view_count': int, + 'description': str, + 'category': list, + 'uploader_id': '12082', + 'uploader': 'Comedy Club', + 'duration': 367, + }, + 'expected_warnings': ['HTTP Error 404: Not Found'] + }, { 'url': 'https://out.pladform.ru/player?pl=64471&videoid=3777899&vk_puid15=0&vk_puid34=0', 'md5': '53362fac3a27352da20fa2803cc5cd6f', 'info_dict': { @@ -63,13 +81,19 @@ class PladformIE(InfoExtractor): 'http://out.pladform.ru/getVideo', video_id, query={ 'pl': pl, 'videoid': video_id, - }) + }, fatal=False) def fail(text): raise ExtractorError( '%s returned error: %s' % (self.IE_NAME, text), expected=True) + if not video: + targetUrl = self._request_webpage(url, video_id, note='Resolving final URL').geturl() + if targetUrl == url: + raise ExtractorError('Can\'t parse page') + return self.url_result(targetUrl) + if video.tag == 'error': fail(video.text) |