Skip to content

Commit

Permalink
[yourporn] Fix extraction and extract duration (closes #18815, closes…
Browse files Browse the repository at this point in the history
… #18852)

change cdn to cdn4 for the video_url
  • Loading branch information
JChris246 authored and oleksis committed Apr 19, 2019
1 parent 6a02c55 commit f0592e9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions youtube_dl/extractor/yourporn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from __future__ import unicode_literals

from .common import InfoExtractor
from ..utils import urljoin
from ..utils import (
parse_duration,
urljoin
)


class YourPornIE(InfoExtractor):
Expand All @@ -27,17 +30,21 @@ def _real_extract(self, url):
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()

thumbnail = self._og_search_thumbnail(webpage)

duration = parse_duration(self._search_regex(r'duration:[^0-9]*([0-9:]+)',
webpage, 'duration', default=None))
return {
'id': video_id,
'url': video_url,
'title': title,
'duration': duration,
'thumbnail': thumbnail,
'age_limit': 18
}

0 comments on commit f0592e9

Please sign in to comment.