Fixed extractor and added duration
Fixed video_url added duration to info dict
This commit is contained in:
parent
435e382423
commit
fb106c2091
@ -27,17 +27,29 @@ class YourPornIE(InfoExtractor):
|
||||
self._search_regex(
|
||||
r'data-vnfo=(["\'])(?P<data>{.+?})\1', webpage, 'data info',
|
||||
group='data'),
|
||||
video_id)[video_id]).replace('/cdn/', '/cdn3/')
|
||||
video_id)[video_id]).replace('/cdn/', '/cdn4/')
|
||||
|
||||
title = (self._search_regex(
|
||||
r'<[^>]+\bclass=["\']PostEditTA[^>]+>([^<]+)', webpage, 'title',
|
||||
default=None) or self._og_search_description(webpage)).strip()
|
||||
if '#' in title:
|
||||
title = title[0:title.index('#')].strip()
|
||||
thumbnail = self._og_search_thumbnail(webpage)
|
||||
durationraw = self._search_regex(r'Video Info -> duration:<b>([0-9:]+)</b>',
|
||||
webpage, 'duration')
|
||||
if len(durationraw.split(":")) == 3:
|
||||
duration = int((durationraw.split(":")[0])) * 3600 + \
|
||||
int((durationraw.split(":")[1])) * 60 + int((durationraw.split(":")[2]))
|
||||
elif len(durationraw.split(":")) == 2:
|
||||
duration = int((durationraw.split(":")[0])) * 60 + int((durationraw.split(":")[1]))
|
||||
else:
|
||||
duration = int((durationraw.split(":")[1]))
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'url': video_url,
|
||||
'title': title,
|
||||
'duration': duration,
|
||||
'thumbnail': thumbnail,
|
||||
'age_limit': 18
|
||||
}
|
||||
|
BIN
youtube_dl/extractor/yourporn.pyc
Normal file
BIN
youtube_dl/extractor/yourporn.pyc
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user