aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/porn91.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-05-31 00:20:37 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-05-31 00:20:37 +0800
commita80601f8d9789e27c0a916e63d7192c3f398d5d5 (patch)
tree3c24288343385ac142e0fa2df2c67ed42504c004 /youtube_dl/extractor/porn91.py
parent1c2223875664f99325b73fe7765677db9b87e105 (diff)
downloadyoutube-dl-a80601f8d9789e27c0a916e63d7192c3f398d5d5.tar.xz
[porn91] Extract more info
Diffstat (limited to 'youtube_dl/extractor/porn91.py')
-rw-r--r--youtube_dl/extractor/porn91.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/youtube_dl/extractor/porn91.py b/youtube_dl/extractor/porn91.py
index 377ca2c77..ea1efc71b 100644
--- a/youtube_dl/extractor/porn91.py
+++ b/youtube_dl/extractor/porn91.py
@@ -3,6 +3,10 @@ from __future__ import unicode_literals
from ..compat import compat_urllib_parse
from .common import InfoExtractor
+from ..utils import (
+ parse_duration,
+ int_or_none,
+)
class Porn91IE(InfoExtractor):
@@ -15,7 +19,8 @@ class Porn91IE(InfoExtractor):
'info_dict': {
'id': '7e42283b4f5ab36da134',
'title': '18岁大一漂亮学妹,水嫩性感,再爽一次!',
- 'ext': 'mp4'
+ 'ext': 'mp4',
+ 'duration': 431,
}
}
@@ -46,8 +51,16 @@ class Porn91IE(InfoExtractor):
"get real video url")
video_url = self._search_regex(r'file=([^&]+)&', info_cn, 'url')
+ duration = parse_duration(self._search_regex(
+ r'时长:\s*</span>\s*(\d+:\d+)', webpage, 'duration', fatal=False))
+
+ comment_count = int_or_none(self._search_regex(
+ r'留言:\s*</span>\s*(\d+)', webpage, 'comment count', fatal=False))
+
return {
'id': video_id,
'title': title,
'url': video_url,
+ 'duration': duration,
+ 'comment_count': comment_count,
}