Fixed requests

Removed test
sorted util imports
edited duration regex
This commit is contained in:
JChris246 2019-01-26 18:30:17 -04:00 committed by GitHub
parent 547471ead5
commit f0bc4aa39c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,15 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import (urljoin, parse_duration) from ..utils import (
parse_duration,
urljoin
)
class YourPornIE(InfoExtractor): class YourPornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?yourporn\.sexy/post/(?P<id>[^/?#&.]+)' _VALID_URL = r'https?://(?:www\.)?yourporn\.sexy/post/(?P<id>[^/?#&.]+)'
_TESTS = [{ _TEST = {
'url': 'https://yourporn.sexy/post/57ffcb2e1179b.html', 'url': 'https://yourporn.sexy/post/57ffcb2e1179b.html',
'md5': '6f8682b6464033d87acaa7a8ff0c092e', 'md5': '6f8682b6464033d87acaa7a8ff0c092e',
'info_dict': { 'info_dict': {
@ -16,19 +19,7 @@ class YourPornIE(InfoExtractor):
'thumbnail': r're:^https?://.*\.jpg$', 'thumbnail': r're:^https?://.*\.jpg$',
'age_limit': 18 'age_limit': 18
}, },
}, { }
'url': 'https://yourporn.sexy/post/5c2d2fde03bc5.html',
'md5': '3b2323fb429d3f559a11b3f22f4754af',
'info_dict': {
'id': '5c2d2fde03bc5',
'ext': 'mp4',
'title': 'Busty 7 - Nubile Films (2018) - Chanel Preston, '
'Crystal Swift, Jennifer Amton, Shay Evan',
'thumbnail': r're:^https?://.*\.jpg$',
'age_limit': 18,
'duration': 5403
}
}]
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
@ -47,7 +38,7 @@ class YourPornIE(InfoExtractor):
thumbnail = self._og_search_thumbnail(webpage) thumbnail = self._og_search_thumbnail(webpage)
duration = parse_duration(self._search_regex(r'Video Info -> duration:<b>([0-9:]+)</b>', duration = parse_duration(self._search_regex(r'duration:[^0-9]*([0-9:]+)',
webpage, 'duration', default=None)) webpage, 'duration', default=None))
return { return {
'id': video_id, 'id': video_id,