]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/thisav.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
7 from ..utils
import determine_ext
10 class ThisAVIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?thisav\.com/video/(?P<id>[0-9]+)/.*'
13 'url': 'http://www.thisav.com/video/47734/%98%26sup1%3B%83%9E%83%82---just-fit.html',
14 'md5': '0480f1ef3932d901f0e0e719f188f19b',
18 'title': '高樹マリア - Just fit',
20 'uploader_id': 'dj7970'
24 def _real_extract(self
, url
):
25 mobj
= re
.match(self
._VALID
_URL
, url
)
27 video_id
= mobj
.group('id')
28 webpage
= self
._download
_webpage
(url
, video_id
)
29 title
= self
._html
_search
_regex
(r
'<h1>([^<]*)</h1>', webpage
, 'title')
30 video_url
= self
._html
_search
_regex
(
31 r
"addVariable\('file','([^']+)'\);", webpage
, 'video url')
32 uploader
= self
._html
_search
_regex
(
33 r
': <a href="http://www.thisav.com/user/[0-9]+/(?:[^"]+)">([^<]+)</a>',
34 webpage
, 'uploader name', fatal
=False)
35 uploader_id
= self
._html
_search
_regex
(
36 r
': <a href="http://www.thisav.com/user/[0-9]+/([^"]+)">(?:[^<]+)</a>',
37 webpage
, 'uploader id', fatal
=False)
38 ext
= determine_ext(video_url
)
44 'uploader_id': uploader_id
,