1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 07:56:49 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
mrscrapy
91bcfb2ad9
Merge 6a53f36713 into c5098961b0 2024-08-09 14:03:01 +07:00
dirkf
6a53f36713
Again 2023-02-03 01:49:09 +00:00
dirkf
a4b22a1526
Small update, force CI 2023-02-03 01:45:06 +00:00
“Mr
ac792c9399 Address comments 2022-10-26 22:13:36 +01:00
“Mr
ee4fcdefca Use a smaller video for tests 2022-10-25 20:14:18 +01:00
“Mr
f0897a7581 Fix string interpolation to support python2 2022-10-25 20:14:03 +01:00
Mr Scrapy
5ca7aa4286 Add Recurbate premium support 2022-10-22 18:12:55 +01:00
2 changed files with 47 additions and 0 deletions

View File

@ -1028,6 +1028,7 @@ from .rbgtum import (
) )
from .rbmaradio import RBMARadioIE from .rbmaradio import RBMARadioIE
from .rds import RDSIE from .rds import RDSIE
from .recurbate import RecurbateIE
from .redbulltv import ( from .redbulltv import (
RedBullTVIE, RedBullTVIE,
RedBullEmbedIE, RedBullEmbedIE,

View File

@ -0,0 +1,46 @@
# coding: utf-8
from __future__ import unicode_literals
from ..utils import (
ExtractorError,
merge_dicts,
update_url_query,
)
from .common import InfoExtractor
class RecurbateIE(InfoExtractor):
_VALID_URL = r'https?:\/\/(?:www\.)?recurbate\.com\/play\.php\?video=(?P<id>[0-9]+)'
_TEST = {
'url': 'https://recurbate.com/play.php?video=39161415',
'info_dict': {
'id': '39161415',
'ext': 'mp4',
'title': 'Performer zsnicole33 show on 2022-10-25 20_23, Chaturbate Archive Recurbate'
},
'skip': 'Free videos are available for a limited amount of time and for a single session.',
}
@staticmethod
def raise_login_required(msg="Login required: use --cookies to pass your browser's login cookie, or try again later"):
raise ExtractorError(msg, expected=True)
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
token = self._html_search_regex(r'data-token=(.+?")', webpage, 'play_button').strip('"')
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)
if 'shall_signin' in video_webpage[:20]:
self.raise_login_required()
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,
'title': title,
'description': self._og_search_description(webpage),
}, entries[0])