[peekvids] Use JSON-LD (#2784)

Authored by: schn0sch
This commit is contained in:
schn0sch 2022-02-16 10:32:24 +01:00 committed by GitHub
parent fc259cc249
commit e1f7f235bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import remove_end
class PeekVidsIE(InfoExtractor): class PeekVidsIE(InfoExtractor):
@ -13,11 +12,17 @@ class PeekVidsIE(InfoExtractor):
''' '''
_TESTS = [{ _TESTS = [{
'url': 'https://peekvids.com/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp/BSyLMbN0YCd', 'url': 'https://peekvids.com/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp/BSyLMbN0YCd',
'md5': '2ff6a357a9717dc9dc9894b51307e9a2', 'md5': 'a00940646c428e232407e3e62f0e8ef5',
'info_dict': { 'info_dict': {
'id': 'BSyLMbN0YCd', 'id': 'BSyLMbN0YCd',
'title': ' Dane Jones - Cute redhead with perfect tits with Mini Vamp, SEXYhub',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Dane Jones - Cute redhead with perfect tits with Mini Vamp', 'thumbnail': r're:^https?://.*\.jpg$',
'description': 'Watch Dane Jones - Cute redhead with perfect tits with Mini Vamp (7 min), uploaded by SEXYhub.com',
'timestamp': 1642579329,
'upload_date': '20220119',
'duration': 416,
'view_count': int,
'age_limit': 18, 'age_limit': 18,
}, },
}] }]
@ -40,46 +45,37 @@ def _real_extract(self, url):
formats = [{'url': url} for url in srcs.values()] formats = [{'url': url} for url in srcs.values()]
self._sort_formats(formats) self._sort_formats(formats)
title = remove_end(self._html_search_regex( info = self._search_json_ld(webpage, video_id, expected_type='VideoObject')
(r'<h1.*?>\s*(.+?)\s*</h1>', r'<title>\s*(.+?)\s*</title>'), info.update({
webpage, 'video title', default=None), ' - PeekVids')
return {
'id': video_id, 'id': video_id,
'title': title,
'age_limit': 18, 'age_limit': 18,
'formats': formats, 'formats': formats,
} })
return info
class PlayVidsIE(PeekVidsIE): class PlayVidsIE(PeekVidsIE):
_VALID_URL = r'https?://(?:www\.)?playvids\.com/(?:embed/|[^/]{2}/)?(?P<id>[^/?#]*)' _VALID_URL = r'https?://(?:www\.)?playvids\.com/(?:embed/|[^/]{2}/)?(?P<id>[^/?#]*)'
_TESTS = [{ _TESTS = [{
'url': 'https://www.playvids.com/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp', 'url': 'https://www.playvids.com/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp',
'md5': '2f12e50213dd65f142175da633c4564c', 'md5': 'cd7dfd8a2e815a45402369c76e3c1825',
'info_dict': { 'info_dict': {
'id': 'U3pBrYhsjXM', 'id': 'U3pBrYhsjXM',
'title': ' Dane Jones - Cute redhead with perfect tits with Mini Vamp, SEXYhub',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Dane Jones - Cute redhead with perfect tits with Mini Vamp', 'thumbnail': r're:^https?://.*\.jpg$',
'description': 'Watch Dane Jones - Cute redhead with perfect tits with Mini Vamp video in HD, uploaded by SEXYhub.com',
'timestamp': 1640435839,
'upload_date': '20211225',
'duration': 416,
'view_count': int,
'age_limit': 18, 'age_limit': 18,
}, },
}, { }, {
'url': 'https://www.playvids.com/es/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp', 'url': 'https://www.playvids.com/es/U3pBrYhsjXM/pc/dane-jones-cute-redhead-with-perfect-tits-with-mini-vamp',
'md5': '2f12e50213dd65f142175da633c4564c', 'only_matching': True,
'info_dict': {
'id': 'U3pBrYhsjXM',
'ext': 'mp4',
'title': 'Dane Jones - Cute redhead with perfect tits with Mini Vamp',
'age_limit': 18,
},
}, { }, {
'url': 'https://www.playvids.com/embed/U3pBrYhsjXM', 'url': 'https://www.playvids.com/embed/U3pBrYhsjXM',
'md5': '2f12e50213dd65f142175da633c4564c', 'only_matching': True,
'info_dict': {
'id': 'U3pBrYhsjXM',
'ext': 'mp4',
'title': 'U3pBrYhsjXM',
'age_limit': 18,
},
}] }]
_DOMAIN = 'www.playvids.com' _DOMAIN = 'www.playvids.com'