]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/moniker.py
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
10 compat_urllib_request
,
14 class MonikerIE(InfoExtractor
):
15 IE_DESC
= 'allmyvideos.net and vidspot.net'
16 _VALID_URL
= r
'https?://(?:www\.)?(?:allmyvideos|vidspot)\.net/(?P<id>[a-zA-Z0-9_-]+)'
19 'url': 'http://allmyvideos.net/jih3nce3x6wn',
20 'md5': '710883dee1bfc370ecf9fa6a89307c88',
24 'title': 'youtube-dl test video',
27 'url': 'http://vidspot.net/l2ngsmhs8ci5',
28 'md5': '710883dee1bfc370ecf9fa6a89307c88',
32 'title': 'youtube-dl test video',
35 'url': 'https://www.vidspot.net/l2ngsmhs8ci5',
36 'only_matching': True,
39 def _real_extract(self
, url
):
40 video_id
= self
._match
_id
(url
)
41 orig_webpage
= self
._download
_webpage
(url
, video_id
)
43 fields
= re
.findall(r
'type="hidden" name="(.+?)"\s* value="?(.+?)">', orig_webpage
)
46 post
= compat_urllib_parse
.urlencode(data
)
48 b
'Content-Type': b
'application/x-www-form-urlencoded',
50 req
= compat_urllib_request
.Request(url
, post
, headers
)
51 webpage
= self
._download
_webpage
(
52 req
, video_id
, note
='Downloading video page ...')
54 title
= os
.path
.splitext(data
['fname'])[0]
56 # Could be several links with different quality
57 links
= re
.findall(r
'"file" : "?(.+?)",', webpage
)
58 # Assume the links are ordered in quality
62 } for i
, l
in enumerate(links
)]
63 self
._sort
_formats
(formats
)