]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/jpopsukitv.py
aad7825788a74bc8930d401a38fe41f7703803c6
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class JpopsukiIE(InfoExtractor
):
14 IE_NAME
= 'jpopsuki.tv'
15 _VALID_URL
= r
'https?://(?:www\.)?jpopsuki\.tv/video/(.*?)/(?P<id>\S+)'
18 'url': 'http://www.jpopsuki.tv/video/ayumi-hamasaki---evolution/00be659d23b0b40508169cdee4545771',
19 'md5': '88018c0c1a9b1387940e90ec9e7e198e',
20 'file': '00be659d23b0b40508169cdee4545771.mp4',
22 'id': '00be659d23b0b40508169cdee4545771',
23 'title': 'ayumi hamasaki - evolution',
24 'description': 'Release date: 2001.01.31\r\n浜崎あゆみ - evolution',
25 'thumbnail': 'http://www.jpopsuki.tv/cache/89722c74d2a2ebe58bcac65321c115b2.jpg',
26 'uploader': 'plama_chan',
28 'upload_date': '20121101'
32 def _real_extract(self
, url
):
33 mobj
= re
.match(self
._VALID
_URL
, url
)
34 video_id
= mobj
.group('id')
36 webpage
= self
._download
_webpage
(url
, video_id
)
38 video_url
= 'http://www.jpopsuki.tv' + self
._html
_search
_regex
(
39 r
'<source src="(.*?)" type', webpage
, 'video url')
41 video_title
= self
._og
_search
_title
(webpage
)
42 description
= self
._og
_search
_description
(webpage
)
43 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
44 uploader
= self
._html
_search
_regex
(
45 r
'<li>from: <a href="/user/view/user/(.*?)/uid/',
46 webpage
, 'video uploader', fatal
=False)
47 uploader_id
= self
._html
_search
_regex
(
48 r
'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
49 webpage
, 'video uploader_id', fatal
=False)
50 upload_date
= self
._html
_search
_regex
(
51 r
'<li>uploaded: (.*?)</li>', webpage
, 'video upload_date',
53 if upload_date
is not None:
54 upload_date
= unified_strdate(upload_date
)
55 view_count_str
= self
._html
_search
_regex
(
56 r
'<li>Hits: ([0-9]+?)</li>', webpage
, 'video view_count',
58 comment_count_str
= self
._html
_search
_regex
(
59 r
'<h2>([0-9]+?) comments</h2>', webpage
, 'video comment_count',
66 'description': description
,
67 'thumbnail': thumbnail
,
69 'uploader_id': uploader_id
,
70 'upload_date': upload_date
,
71 'view_count': int_or_none(view_count_str
),
72 'comment_count': int_or_none(comment_count_str
),