3 from .common
import InfoExtractor
11 class GaskrankIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?gaskrank\.tv/tv/(?P<categories>[^/]+)/(?P<id>[^/]+)\.htm'
14 'url': 'http://www.gaskrank.tv/tv/motorrad-fun/strike-einparken-durch-anfaenger-crash-mit-groesserem-flurschaden.htm',
15 'md5': '1ae88dbac97887d85ebd1157a95fc4f9',
19 'title': 'Strike! Einparken können nur Männer - Flurschaden hält sich in Grenzen *lol*',
20 'thumbnail': r
're:^https?://.*\.jpg$',
21 'categories': ['motorrad-fun'],
22 'display_id': 'strike-einparken-durch-anfaenger-crash-mit-groesserem-flurschaden',
23 'uploader_id': 'Bikefun',
24 'upload_date': '20170110',
27 'url': 'http://www.gaskrank.tv/tv/racing/isle-of-man-tt-2011-michael-du-15920.htm',
28 'md5': 'c33ee32c711bc6c8224bfcbe62b23095',
32 'title': 'Isle of Man - Michael Dunlop vs Guy Martin - schwindelig kucken',
33 'thumbnail': r
're:^https?://.*\.jpg$',
34 'categories': ['racing'],
35 'display_id': 'isle-of-man-tt-2011-michael-du-15920',
37 'upload_date': '20170523',
38 'uploader_url': 'www.iomtt.com',
42 def _real_extract(self
, url
):
43 display_id
= self
._match
_id
(url
)
45 webpage
= self
._download
_webpage
(url
, display_id
)
47 title
= self
._og
_search
_title
(
48 webpage
, default
=None) or self
._html
_search
_meta
(
49 'title', webpage
, fatal
=True)
51 categories
= [self
._match
_valid
_url
(url
).group('categories')]
54 r
'Video von:\s*(?P<uploader_id>[^|]*?)\s*\|\s*vom:\s*(?P<upload_date>[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9][0-9][0-9])',
57 uploader_id
= mobj
.groupdict().get('uploader_id')
58 upload_date
= unified_strdate(mobj
.groupdict().get('upload_date'))
60 uploader_url
= self
._search
_regex
(
61 r
'Homepage:\s*<[^>]*>(?P<uploader_url>[^<]*)',
62 webpage
, 'uploader_url', default
=None)
64 r
'/tv/tags/[^/]+/"\s*>(?P<tag>[^<]*?)<',
67 view_count
= self
._search
_regex
(
68 r
'class\s*=\s*"gkRight"(?:[^>]*>\s*<[^>]*)*icon-eye-open(?:[^>]*>\s*<[^>]*)*>\s*(?P<view_count>[0-9\.]*)',
69 webpage
, 'view_count', default
=None)
71 view_count
= int_or_none(view_count
.replace('.', ''))
73 average_rating
= self
._search
_regex
(
74 r
'itemprop\s*=\s*"ratingValue"[^>]*>\s*(?P<average_rating>[0-9,]+)',
75 webpage
, 'average_rating')
77 average_rating
= float_or_none(average_rating
.replace(',', '.'))
79 video_id
= self
._search
_regex
(
80 r
'https?://movies\.gaskrank\.tv/([^-]*?)(-[^\.]*)?\.mp4',
81 webpage
, 'video id', default
=display_id
)
83 entry
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0]
87 'categories': categories
,
88 'display_id': display_id
,
89 'uploader_id': uploader_id
,
90 'upload_date': upload_date
,
91 'uploader_url': uploader_url
,
93 'view_count': view_count
,
94 'average_rating': average_rating
,