mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-19 20:10:25 +00:00
[jpopsuki] More modernize
This commit is contained in:
parent
08d5230945
commit
01384d6e4b
@ -1,8 +1,6 @@
|
|||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
@ -30,8 +28,7 @@ class JpopsukiIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
video_id = mobj.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
@ -47,11 +44,9 @@ class JpopsukiIE(InfoExtractor):
|
|||||||
uploader_id = self._html_search_regex(
|
uploader_id = self._html_search_regex(
|
||||||
r'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
|
r'<li>from: <a href="/user/view/user/\S*?/uid/(\d*)',
|
||||||
webpage, 'video uploader_id', fatal=False)
|
webpage, 'video uploader_id', fatal=False)
|
||||||
upload_date = self._html_search_regex(
|
upload_date = unified_strdate(self._html_search_regex(
|
||||||
r'<li>uploaded: (.*?)</li>', webpage, 'video upload_date',
|
r'<li>uploaded: (.*?)</li>', webpage, 'video upload_date',
|
||||||
fatal=False)
|
fatal=False))
|
||||||
if upload_date is not None:
|
|
||||||
upload_date = unified_strdate(upload_date)
|
|
||||||
view_count_str = self._html_search_regex(
|
view_count_str = self._html_search_regex(
|
||||||
r'<li>Hits: ([0-9]+?)</li>', webpage, 'video view_count',
|
r'<li>Hits: ([0-9]+?)</li>', webpage, 'video view_count',
|
||||||
fatal=False)
|
fatal=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user