7
7
from ..utils import (
8
8
determine_ext ,
9
9
js_to_json ,
10
- url_or_none ,
11
10
)
12
11
13
12
@@ -17,14 +16,10 @@ class APAIE(InfoExtractor):
17
16
'url' : 'http://uvp.apa.at/embed/293f6d17-692a-44e3-9fd5-7b178f3a1029' ,
18
17
'md5' : '2b12292faeb0a7d930c778c7a5b4759b' ,
19
18
'info_dict' : {
20
- 'id' : 'jjv85FdZ ' ,
19
+ 'id' : '293f6d17-692a-44e3-9fd5-7b178f3a1029 ' ,
21
20
'ext' : 'mp4' ,
22
- 'title' : '"Blau ist mysteriös": Die Blue Man Group im Interview' ,
23
- 'description' : 'md5:d41d8cd98f00b204e9800998ecf8427e' ,
21
+ 'title' : '293f6d17-692a-44e3-9fd5-7b178f3a1029' ,
24
22
'thumbnail' : r're:^https?://.*\.jpg$' ,
25
- 'duration' : 254 ,
26
- 'timestamp' : 1519211149 ,
27
- 'upload_date' : '20180221' ,
28
23
},
29
24
}, {
30
25
'url' : 'https://uvp-apapublisher.sf.apa.at/embed/2f94e9e6-d945-4db2-9548-f9a41ebf7b78' ,
@@ -48,7 +43,7 @@ def _extract_urls(webpage):
48
43
def _real_extract (self , url ):
49
44
video_id = self ._match_id (url )
50
45
51
- webpage = self ._download_webpage (url , video_id )
46
+ webpage = self ._download_webpage ('https://uvp.apa.at/player/%s' % video_id , video_id )
52
47
53
48
jwplatform_id = self ._search_regex (
54
49
r'media[iI]d\s*:\s*["\'](?P<id>[a-zA-Z0-9]{8})' , webpage ,
@@ -59,18 +54,12 @@ def _real_extract(self, url):
59
54
'jwplatform:' + jwplatform_id , ie = 'JWPlatform' ,
60
55
video_id = video_id )
61
56
62
- sources = self ._parse_json (
63
- self ._search_regex (
64
- r'sources\s*=\s*(\[.+?\])\s*;' , webpage , 'sources' ),
65
- video_id , transform_source = js_to_json )
57
+ sources = self ._parse_json ("{" + self ._search_regex (
58
+ r'("hls"\s*:\s*"[^"]+"\s*,\s*"progressive"\s*:\s*"[^"]+")' , webpage , 'sources' )
59
+ + "}" , video_id , transform_source = js_to_json )
66
60
67
61
formats = []
68
- for source in sources :
69
- if not isinstance (source , dict ):
70
- continue
71
- source_url = url_or_none (source .get ('file' ))
72
- if not source_url :
73
- continue
62
+ for (format , source_url ) in sources .items ():
74
63
ext = determine_ext (source_url )
75
64
if ext == 'm3u8' :
76
65
formats .extend (self ._extract_m3u8_formats (
@@ -83,7 +72,7 @@ def _real_extract(self, url):
83
72
self ._sort_formats (formats )
84
73
85
74
thumbnail = self ._search_regex (
86
- r'image \s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1' , webpage ,
75
+ r'"poster" \s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1' , webpage ,
87
76
'thumbnail' , fatal = False , group = 'url' )
88
77
89
78
return {
0 commit comments