]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/allmyvideos.py
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
10 compat_urllib_request
,
14 class AllmyvideosIE(InfoExtractor
):
15 IE_NAME
= 'allmyvideos.net'
16 _VALID_URL
= r
'https?://allmyvideos\.net/(?P<id>[a-zA-Z0-9_-]+)'
19 'url': 'http://allmyvideos.net/jih3nce3x6wn',
20 'md5': '710883dee1bfc370ecf9fa6a89307c88',
24 'title': 'youtube-dl test video',
28 def _real_extract(self
, url
):
29 mobj
= re
.match(self
._VALID
_URL
, url
)
30 video_id
= mobj
.group('id')
32 orig_webpage
= self
._download
_webpage
(url
, video_id
)
33 fields
= re
.findall(r
'type="hidden" name="(.+?)"\s* value="?(.+?)">', orig_webpage
)
36 post
= compat_urllib_parse
.urlencode(data
)
38 b
'Content-Type': b
'application/x-www-form-urlencoded',
40 req
= compat_urllib_request
.Request(url
, post
, headers
)
41 webpage
= self
._download
_webpage
(
42 req
, video_id
, note
='Downloading video page ...')
44 title
= os
.path
.splitext(data
['fname'])[0]
46 #Could be several links with different quality
47 links
= re
.findall(r
'"file" : "?(.+?)",', webpage
)
48 # Assume the links are ordered in quality
52 } for i
, l
in enumerate(links
)]
53 self
._sort
_formats
(formats
)