]>
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 doc
= self
._download
_xml
(
29 info_url
, video_id
, note
=u
'Downloading info page')
30 title
= doc
.find('title').text
31 video_url
= doc
.find('filename').text
33 xml_bytes
= xml
.etree
.ElementTree
.tostring(doc
)
34 raise ExtractorError(u
'Cannot find video URL in document %r' %
36 thumbnail
= doc
.find('imageurl').text
37 duration_str
= doc
.find('duration').text
39 r
'^(?P<hours>[0-9]+):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9]{2}):(?P<ms>[0-9]*)$',
43 (int(m
.group('hours')) * 60 * 60) +
44 (int(m
.group('minutes')) * 60) +
45 (int(m
.group('seconds')))
54 'thumbnail': thumbnail
,