]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/clipfish.py
a5c3cb7c6253776062fb5834d0fe4c121dfb9c99
1 from __future__
import unicode_literals
5 import xml
.etree
.ElementTree
7 from .common
import InfoExtractor
14 class ClipfishIE(InfoExtractor
):
17 _VALID_URL
= r
'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id>[0-9]+)/'
19 'url': 'http://www.clipfish.de/special/game-trailer/video/3966754/fifa-14-e3-2013-trailer/',
20 'md5': '2521cd644e862936cf2e698206e47385',
24 'title': 'FIFA 14 - E3 2013 Trailer',
27 'skip': 'Blocked in the US'
30 def _real_extract(self
, url
):
31 mobj
= re
.match(self
._VALID
_URL
, url
)
32 video_id
= mobj
.group(1)
34 info_url
= ('http://www.clipfish.de/devxml/videoinfo/%s?ts=%d' %
35 (video_id
, int(time
.time())))
36 doc
= self
._download
_xml
(
37 info_url
, video_id
, note
='Downloading info page')
38 title
= doc
.find('title').text
39 video_url
= doc
.find('filename').text
41 xml_bytes
= xml
.etree
.ElementTree
.tostring(doc
)
42 raise ExtractorError('Cannot find video URL in document %r' %
44 thumbnail
= doc
.find('imageurl').text
45 duration
= parse_duration(doc
.find('duration').text
)
51 'thumbnail': thumbnail
,