1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-09 07:47:24 +08:00

[sxyprn] Add new extractor (closes #21645)

This commit is contained in:
vdelta 2019-08-28 14:04:42 +02:00
parent f9549b30f8
commit a62b41a515
2 changed files with 8 additions and 11 deletions

View File

@ -1472,7 +1472,7 @@ from .younow import (
YouNowMomentIE,
)
from .youporn import YouPornIE
from .yourporn import YourPornIE
from .sxyprn import SxyPrnIE
from .yourupload import YourUploadIE
from .youtube import (
YoutubeIE,

View File

@ -6,10 +6,10 @@ from ..utils import (
)
class YourPornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:yourporn\.sexy|sxyprn\.com)/post/(?P<id>[^/?#&.]+)'
_TESTS = [{
'url': 'https://yourporn.sexy/post/57ffcb2e1179b.html',
class SxyPrnIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sxyprn\.com/post/(?P<id>[^/?#&.]+)'
_TEST = {
'url': 'https://sxyprn.com/post/57ffcb2e1179b.html',
'md5': '6f8682b6464033d87acaa7a8ff0c092e',
'info_dict': {
'id': '57ffcb2e1179b',
@ -21,11 +21,8 @@ class YourPornIE(InfoExtractor):
},
'params': {
'skip_download': True,
},
}, {
'url': 'https://sxyprn.com/post/57ffcb2e1179b.html',
'only_matching': True,
}]
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
@ -35,7 +32,7 @@ class YourPornIE(InfoExtractor):
url_parts = self._parse_json(self._search_regex(
r'data-vnfo=(["\'])(?P<data>{.+?})\1', webpage, 'data info', group='data'), video_id)[video_id].split("/")
aid = self._search_regex(r'data-aid=\'([a-z0-9]+)\'', webpage, 'aid')
aid = self._search_regex(r'data-aid=\'(.*?)\'', webpage, 'aid')
video_url = 'https://' + url_parts[2] + '.trafficdeposit.com/video/' + url_parts[3] + '/' + url_parts[
4] + '/' + url_parts[5] + '/' + aid + '/' + video_id + '.mp4'