1 from .common
import InfoExtractor
4 compat_urllib_parse_urlparse
,
15 class ArnesIE(InfoExtractor
):
16 IE_NAME
= 'video.arnes.si'
17 IE_DESC
= 'Arnes Video'
18 _VALID_URL
= r
'https?://video\.arnes\.si/(?:[a-z]{2}/)?(?:watch|embed|api/(?:asset|public/video))/(?P<id>[0-9a-zA-Z]{12})'
20 'url': 'https://video.arnes.si/watch/a1qrWTOQfVoU?t=10',
21 'md5': '4d0f4d0a03571b33e1efac25fd4a065d',
25 'title': 'Linearna neodvisnost, definicija',
26 'description': 'Linearna neodvisnost, definicija',
28 'creator': 'Polona Oblak',
29 'timestamp': 1585063725,
30 'upload_date': '20200324',
31 'channel': 'Polona Oblak',
32 'channel_id': 'q6pc04hw24cj',
33 'channel_url': 'https://video.arnes.si/?channel=q6pc04hw24cj',
36 'tags': ['linearna_algebra'],
40 'url': 'https://video.arnes.si/api/asset/s1YjnV7hadlC/play.mp4',
41 'only_matching': True,
43 'url': 'https://video.arnes.si/embed/s1YjnV7hadlC',
44 'only_matching': True,
46 'url': 'https://video.arnes.si/en/watch/s1YjnV7hadlC',
47 'only_matching': True,
49 'url': 'https://video.arnes.si/embed/s1YjnV7hadlC?t=123&hideRelated=1',
50 'only_matching': True,
52 'url': 'https://video.arnes.si/api/public/video/s1YjnV7hadlC',
53 'only_matching': True,
55 _BASE_URL
= 'https://video.arnes.si'
57 def _real_extract(self
, url
):
58 video_id
= self
._match
_id
(url
)
60 video
= self
._download
_json
(
61 self
._BASE
_URL
+ '/api/public/video/' + video_id
, video_id
)['data']
62 title
= video
['title']
65 for media
in (video
.get('media') or []):
66 media_url
= media
.get('url')
70 'url': self
._BASE
_URL
+ media_url
,
71 'format_id': remove_start(media
.get('format'), 'FORMAT_'),
72 'format_note': media
.get('formatTranslation'),
73 'width': int_or_none(media
.get('width')),
74 'height': int_or_none(media
.get('height')),
76 self
._sort
_formats
(formats
)
78 channel
= video
.get('channel') or {}
79 channel_id
= channel
.get('url')
80 thumbnail
= video
.get('thumbnailUrl')
86 'thumbnail': self
._BASE
_URL
+ thumbnail
,
87 'description': video
.get('description'),
88 'license': video
.get('license'),
89 'creator': video
.get('author'),
90 'timestamp': parse_iso8601(video
.get('creationTime')),
91 'channel': channel
.get('name'),
92 'channel_id': channel_id
,
93 'channel_url': format_field(channel_id
, None, f
'{self._BASE_URL}/?channel=%s'),
94 'duration': float_or_none(video
.get('duration'), 1000),
95 'view_count': int_or_none(video
.get('views')),
96 'tags': video
.get('hashtags'),
97 'start_time': int_or_none(compat_parse_qs(
98 compat_urllib_parse_urlparse(url
).query
).get('t', [None])[0]),