@@ -28,6 +28,24 @@ class PladformIE(InfoExtractor):
28
28
(?P<id>\d+)
29
29
'''
30
30
_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
+ }, {
31
49
'url' : 'https://out.pladform.ru/player?pl=64471&videoid=3777899&vk_puid15=0&vk_puid34=0' ,
32
50
'md5' : '53362fac3a27352da20fa2803cc5cd6f' ,
33
51
'info_dict' : {
@@ -63,13 +81,19 @@ def _real_extract(self, url):
63
81
'http://out.pladform.ru/getVideo' , video_id , query = {
64
82
'pl' : pl ,
65
83
'videoid' : video_id ,
66
- })
84
+ }, fatal = False )
67
85
68
86
def fail (text ):
69
87
raise ExtractorError (
70
88
'%s returned error: %s' % (self .IE_NAME , text ),
71
89
expected = True )
72
90
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
+
73
97
if video .tag == 'error' :
74
98
fail (video .text )
75
99
0 commit comments