[cleanup] Misc (#8968)
[yt-dlp.git] / yt_dlp / extractor / kicker.py
bloba2c7dd4e835e9e699e4cade6bfbb4530fbd14605
1 from .common import InfoExtractor
2 from .dailymotion import DailymotionIE
5 class KickerIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)kicker\.(?:de)/(?P<id>[\w-]+)/video'
7 _TESTS = [{
8 'url': 'https://www.kicker.de/pogba-dembel-co-die-top-11-der-abloesefreien-spieler-905049/video',
9 'info_dict': {
10 'id': 'km04mrK0DrRAVxy2GcA',
11 'title': 'md5:b91d145bac5745ac58d5479d8347a875',
12 'ext': 'mp4',
13 'duration': 350,
14 'description': 'md5:a5a3dd77dbb6550dbfb997be100b9998',
15 'uploader_id': 'x2dfupo',
16 'timestamp': 1654677626,
17 'like_count': int,
18 'uploader': 'kicker.de',
19 'view_count': int,
20 'age_limit': 0,
21 'thumbnail': r're:https://s\d+\.dmcdn\.net/v/T-x741YeYAx8aSZ0Z/x1080',
22 'tags': ['published', 'category.InternationalSoccer'],
23 'upload_date': '20220608'
25 }, {
26 'url': 'https://www.kicker.de/ex-unioner-in-der-bezirksliga-felix-kroos-vereinschallenge-in-pankow-902825/video',
27 'info_dict': {
28 'id': 'k2omNsJKdZ3TxwxYSFJ',
29 'title': 'md5:72ec24d7f84b8436fe1e89d198152adf',
30 'ext': 'mp4',
31 'uploader_id': 'x2dfupo',
32 'duration': 331,
33 'timestamp': 1652966015,
34 'thumbnail': r're:https?://s\d+\.dmcdn\.net/v/TxU4Z1YYCmtisTbMq/x1080',
35 'tags': ['FELIX KROOS', 'EINFACH MAL LUPPEN', 'KROOS', 'FSV FORTUNA PANKOW', 'published', 'category.Amateurs', 'marketingpreset.Spreekick'],
36 'age_limit': 0,
37 'view_count': int,
38 'upload_date': '20220519',
39 'uploader': 'kicker.de',
40 'description': 'md5:0c2060c899a91c8bf40f578f78c5846f',
41 'like_count': int,
45 def _real_extract(self, url):
46 video_slug = self._match_id(url)
48 webpage = self._download_webpage(url, video_slug)
49 dailymotion_video_id = self._search_regex(
50 r'data-dmprivateid\s*=\s*[\'"](?P<video_id>\w+)', webpage,
51 'video id', group='video_id')
53 return self.url_result(
54 f'https://www.dailymotion.com/video/{dailymotion_video_id}',
55 ie=DailymotionIE, video_title=self._html_extract_title(webpage))