1 from .common
import InfoExtractor
8 class EUScreenIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?euscreen\.eu/item.html\?id=(?P<id>[^&?$/]+)'
12 'url': 'https://euscreen.eu/item.html?id=EUS_0EBCBF356BFC4E12A014023BA41BD98C',
14 'id': 'EUS_0EBCBF356BFC4E12A014023BA41BD98C',
16 'title': "L'effondrement du stade du Heysel",
17 'alt_title': 'Collapse of the Heysel Stadium',
19 'description': 'md5:f0ffffdfce6821139357a1b8359d6152',
20 'series': 'JA2 DERNIERE',
22 'uploader': 'INA / France',
23 'thumbnail': 'http://images3.noterik.com/domain/euscreenxl/user/eu_ina/video/EUS_0EBCBF356BFC4E12A014023BA41BD98C/image.jpg',
25 'params': {'skip_download': True},
28 _payload
= b
'<fsxml><screen><properties><screenId>-1</screenId></properties><capabilities id="1"><properties><platform>Win32</platform><appcodename>Mozilla</appcodename><appname>Netscape</appname><appversion>5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36</appversion><useragent>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36</useragent><cookiesenabled>true</cookiesenabled><screenwidth>784</screenwidth><screenheight>758</screenheight><orientation>undefined</orientation><smt_browserid>Sat, 07 Oct 2021 08:56:50 GMT</smt_browserid><smt_sessionid>1633769810758</smt_sessionid></properties></capabilities></screen></fsxml>'
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
32 args_for_js_request
= self
._download
_webpage
(
33 'https://euscreen.eu/lou/LouServlet/domain/euscreenxl/html5application/euscreenxlitem',
34 video_id
, data
=self
._payload
, query
={'actionlist': 'itempage', 'id': video_id
})
35 info_js
= self
._download
_webpage
(
36 'https://euscreen.eu/lou/LouServlet/domain/euscreenxl/html5application/euscreenxlitem',
37 video_id
, data
=args_for_js_request
.replace('screenid', 'screenId').encode())
38 video_json
= self
._parse
_json
(
39 self
._search
_regex
(r
'setVideo\(({.+})\)\(\$end\$\)put', info_js
, 'Video JSON'),
40 video_id
, transform_source
=js_to_json
)
41 meta_json
= self
._parse
_json
(
42 self
._search
_regex
(r
'setData\(({.+})\)\(\$end\$\)', info_js
, 'Metadata JSON'),
43 video_id
, transform_source
=js_to_json
)
46 } for source
in video_json
.get('sources', [])]
50 'title': meta_json
.get('originalTitle'),
51 'alt_title': meta_json
.get('title'),
52 'duration': parse_duration(meta_json
.get('duration')),
53 'description': '{}\n{}'.format(meta_json
.get('summaryOriginal', ''), meta_json
.get('summaryEnglish', '')),
54 'series': meta_json
.get('series') or meta_json
.get('seriesEnglish'),
55 'episode': meta_json
.get('episodeNumber'),
56 'uploader': meta_json
.get('provider'),
57 'thumbnail': meta_json
.get('screenshot') or video_json
.get('screenshot'),