]>
Commit | Line | Data |
---|---|---|
ff3f1a62 S |
1 | from .common import InfoExtractor |
2 | from .nexx import NexxIE | |
c84eae4f S |
3 | from ..utils import ( |
4 | int_or_none, | |
4b302826 | 5 | str_or_none, |
c84eae4f | 6 | ) |
690404a6 | 7 | |
b3187433 | 8 | |
4b302826 | 9 | class FunkIE(InfoExtractor): |
2be56f22 | 10 | _VALID_URL = r'https?://(?:www\.|origin\.)?funk\.net/(?:channel|playlist)/[^/]+/(?P<display_id>[0-9a-z-]+)-(?P<id>\d+)' |
690404a6 | 11 | _TESTS = [{ |
4b302826 RA |
12 | 'url': 'https://www.funk.net/channel/ba-793/die-lustigsten-instrumente-aus-dem-internet-teil-2-1155821', |
13 | 'md5': '8dd9d9ab59b4aa4173b3197f2ea48e81', | |
ff3f1a62 | 14 | 'info_dict': { |
690404a6 | 15 | 'id': '1155821', |
ff3f1a62 | 16 | 'ext': 'mp4', |
690404a6 S |
17 | 'title': 'Die LUSTIGSTEN INSTRUMENTE aus dem Internet - Teil 2', |
18 | 'description': 'md5:a691d0413ef4835588c5b03ded670c1f', | |
19 | 'timestamp': 1514507395, | |
20 | 'upload_date': '20171229', | |
ff3f1a62 | 21 | }, |
4b302826 | 22 | |
ff3f1a62 | 23 | }, { |
4b302826 | 24 | 'url': 'https://www.funk.net/playlist/neuesteVideos/kameras-auf-dem-fusion-festival-1618699', |
ff3f1a62 S |
25 | 'only_matching': True, |
26 | }] | |
27 | ||
28 | def _real_extract(self, url): | |
5ad28e7f | 29 | display_id, nexx_id = self._match_valid_url(url).groups() |
4b302826 RA |
30 | video = self._download_json( |
31 | 'https://www.funk.net/api/v4.0/videos/' + nexx_id, nexx_id) | |
32 | return { | |
33 | '_type': 'url_transparent', | |
34 | 'url': 'nexx:741:' + nexx_id, | |
35 | 'ie_key': NexxIE.ie_key(), | |
36 | 'id': nexx_id, | |
37 | 'title': video.get('title'), | |
38 | 'description': video.get('description'), | |
39 | 'duration': int_or_none(video.get('duration')), | |
40 | 'channel_id': str_or_none(video.get('channelId')), | |
41 | 'display_id': display_id, | |
42 | 'tags': video.get('tags'), | |
43 | 'thumbnail': video.get('imageUrlLandscape'), | |
44 | } |