Skip to content

Commit f7d4854

Browse files
[Pladform] Fix redirection to external player (yt-dlp#2550)
Authored by: KiberInfinity
1 parent 403be2e commit f7d4854

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

yt_dlp/extractor/pladform.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ class PladformIE(InfoExtractor):
2828
(?P<id>\d+)
2929
'''
3030
_TESTS = [{
31+
'url': 'http://out.pladform.ru/player?pl=18079&type=html5&videoid=100231282',
32+
'info_dict': {
33+
'id': '6216d548e755edae6e8280667d774791',
34+
'ext': 'mp4',
35+
'timestamp': 1406117012,
36+
'title': 'Гарик Мартиросян и Гарик Харламов - Кастинг на концерт ко Дню милиции',
37+
'age_limit': 0,
38+
'upload_date': '20140723',
39+
'thumbnail': str,
40+
'view_count': int,
41+
'description': str,
42+
'category': list,
43+
'uploader_id': '12082',
44+
'uploader': 'Comedy Club',
45+
'duration': 367,
46+
},
47+
'expected_warnings': ['HTTP Error 404: Not Found']
48+
}, {
3149
'url': 'https://out.pladform.ru/player?pl=64471&videoid=3777899&vk_puid15=0&vk_puid34=0',
3250
'md5': '53362fac3a27352da20fa2803cc5cd6f',
3351
'info_dict': {
@@ -63,13 +81,19 @@ def _real_extract(self, url):
6381
'http://out.pladform.ru/getVideo', video_id, query={
6482
'pl': pl,
6583
'videoid': video_id,
66-
})
84+
}, fatal=False)
6785

6886
def fail(text):
6987
raise ExtractorError(
7088
'%s returned error: %s' % (self.IE_NAME, text),
7189
expected=True)
7290

91+
if not video:
92+
targetUrl = self._request_webpage(url, video_id, note='Resolving final URL').geturl()
93+
if targetUrl == url:
94+
raise ExtractorError('Can\'t parse page')
95+
return self.url_result(targetUrl)
96+
7397
if video.tag == 'error':
7498
fail(video.text)
7599

0 commit comments

Comments
 (0)