3 from .common
import InfoExtractor
13 class ArnesIE(InfoExtractor
):
14 IE_NAME
= 'video.arnes.si'
15 IE_DESC
= 'Arnes Video'
16 _VALID_URL
= r
'https?://video\.arnes\.si/(?:[a-z]{2}/)?(?:watch|embed|api/(?:asset|public/video))/(?P<id>[0-9a-zA-Z]{12})'
18 'url': 'https://video.arnes.si/watch/a1qrWTOQfVoU?t=10',
19 'md5': '4d0f4d0a03571b33e1efac25fd4a065d',
23 'title': 'Linearna neodvisnost, definicija',
24 'description': 'Linearna neodvisnost, definicija',
26 'creator': 'Polona Oblak',
27 'timestamp': 1585063725,
28 'upload_date': '20200324',
29 'channel': 'Polona Oblak',
30 'channel_id': 'q6pc04hw24cj',
31 'channel_url': 'https://video.arnes.si/?channel=q6pc04hw24cj',
34 'tags': ['linearna_algebra'],
38 'url': 'https://video.arnes.si/api/asset/s1YjnV7hadlC/play.mp4',
39 'only_matching': True,
41 'url': 'https://video.arnes.si/embed/s1YjnV7hadlC',
42 'only_matching': True,
44 'url': 'https://video.arnes.si/en/watch/s1YjnV7hadlC',
45 'only_matching': True,
47 'url': 'https://video.arnes.si/embed/s1YjnV7hadlC?t=123&hideRelated=1',
48 'only_matching': True,
50 'url': 'https://video.arnes.si/api/public/video/s1YjnV7hadlC',
51 'only_matching': True,
53 _BASE_URL
= 'https://video.arnes.si'
55 def _real_extract(self
, url
):
56 video_id
= self
._match
_id
(url
)
58 video
= self
._download
_json
(
59 self
._BASE
_URL
+ '/api/public/video/' + video_id
, video_id
)['data']
60 title
= video
['title']
63 for media
in (video
.get('media') or []):
64 media_url
= media
.get('url')
68 'url': self
._BASE
_URL
+ media_url
,
69 'format_id': remove_start(media
.get('format'), 'FORMAT_'),
70 'format_note': media
.get('formatTranslation'),
71 'width': int_or_none(media
.get('width')),
72 'height': int_or_none(media
.get('height')),
75 channel
= video
.get('channel') or {}
76 channel_id
= channel
.get('url')
77 thumbnail
= video
.get('thumbnailUrl')
83 'thumbnail': self
._BASE
_URL
+ thumbnail
,
84 'description': video
.get('description'),
85 'license': video
.get('license'),
86 'creator': video
.get('author'),
87 'timestamp': parse_iso8601(video
.get('creationTime')),
88 'channel': channel
.get('name'),
89 'channel_id': channel_id
,
90 'channel_url': format_field(channel_id
, None, f
'{self._BASE_URL}/?channel=%s'),
91 'duration': float_or_none(video
.get('duration'), 1000),
92 'view_count': int_or_none(video
.get('views')),
93 'tags': video
.get('hashtags'),
94 'start_time': int_or_none(urllib
.parse
.parse_qs(
95 urllib
.parse
.urlparse(url
).query
).get('t', [None])[0]),