]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/clipfish.py
3 import xml
.etree
.ElementTree
5 from .common
import InfoExtractor
8 class ClipfishIE(InfoExtractor
):
11 _VALID_URL
= r
'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id>[0-9]+)/'
13 u
'url': u
'http://www.clipfish.de/special/supertalent/video/4028320/supertalent-2013-ivana-opacak-singt-nobodys-perfect/',
14 u
'file': u
'4028320.f4v',
15 u
'md5': u
'5e38bda8c329fbfb42be0386a3f5a382',
17 u
'title': u
'Supertalent 2013: Ivana Opacak singt Nobody\'s Perfect',
22 def _real_extract(self
, url
):
23 mobj
= re
.match(self
._VALID
_URL
, url
)
24 video_id
= mobj
.group(1)
26 info_url
= ('http://www.clipfish.de/devxml/videoinfo/%s?ts=%d' %
27 (video_id
, int(time
.time())))
28 info_xml
= self
._download
_webpage
(
29 info_url
, video_id
, note
=u
'Downloading info page')
30 doc
= xml
.etree
.ElementTree
.fromstring(info_xml
)
31 title
= doc
.find('title').text
32 video_url
= doc
.find('filename').text
33 thumbnail
= doc
.find('imageurl').text
34 duration_str
= doc
.find('duration').text
36 r
'^(?P<hours>[0-9]+):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9]{2}):(?P<ms>[0-9]*)$',
40 (int(m
.group('hours')) * 60 * 60) +
41 (int(m
.group('minutes')) * 60) +
42 (int(m
.group('seconds')))
51 'thumbnail': thumbnail
,