mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-24 19:22:06 +00:00
Address comments
This commit is contained in:
parent
ee4fcdefca
commit
ac792c9399
1 changed files with 18 additions and 8 deletions
|
@ -1,6 +1,12 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
merge_dicts,
|
||||||
|
update_url_query,
|
||||||
|
)
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +19,7 @@ class RecurbateIE(InfoExtractor):
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Performer zsnicole33 show on 2022-10-25 20_23, Chaturbate Archive – Recurbate'
|
'title': 'Performer zsnicole33 show on 2022-10-25 20_23, Chaturbate Archive – Recurbate'
|
||||||
},
|
},
|
||||||
'skip': 'Requires premium subscription cookie session',
|
'skip': 'Free videos are available for a limited amount of time and for a single session.',
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -21,14 +27,18 @@ class RecurbateIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
||||||
token = self._html_search_regex(r'data-token=(.+?")', webpage, 'play_button').strip("\"")
|
token = self._html_search_regex(r'data-token=(.+?")', webpage, 'play_button').strip('"')
|
||||||
get_url = "https://recurbate.com/api/get.php?video={}&token={}".format(video_id, token)
|
get_url = update_url_query('https://recurbate.com/api/get.php', {'video': video_id, 'token': token})
|
||||||
video_webpage = self._download_webpage(get_url, video_id)
|
video_webpage = self._download_webpage(get_url, video_id)
|
||||||
real_url = self._html_search_regex(r'<source src=(.+?) type=\"video\/mp4\"', video_webpage, 'mp4video').strip("\"")
|
if 'shall_signin' in video_webpage[:20]:
|
||||||
|
raise ExtractorError(
|
||||||
return {
|
"Login required: use --cookies to pass your browser's login cookie, or try again later",
|
||||||
|
expected=True)
|
||||||
|
entries = self._parse_html5_media_entries(get_url, video_webpage, video_id)
|
||||||
|
if not entries:
|
||||||
|
raise ExtractorError('No media links found')
|
||||||
|
return merge_dicts({
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': self._og_search_description(webpage),
|
'description': self._og_search_description(webpage),
|
||||||
'url': real_url,
|
}, entries[0])
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue