Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Recurbate.com] Add Recurbate premium support #31306

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,7 @@
)
from .rbmaradio import RBMARadioIE
from .rds import RDSIE
from .recurbate import RecurbateIE
from .redbulltv import (
RedBullTVIE,
RedBullEmbedIE,
Expand Down
34 changes: 34 additions & 0 deletions youtube_dl/extractor/recurbate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding: utf-8
from __future__ import unicode_literals

from .common import InfoExtractor

mrscrapy marked this conversation as resolved.
Show resolved Hide resolved

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': 'Requires premium subscription cookie session',
mrscrapy marked this conversation as resolved.
Show resolved Hide resolved
}

dirkf marked this conversation as resolved.
Show resolved Hide resolved
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("\"")
mrscrapy marked this conversation as resolved.
Show resolved Hide resolved
get_url = "https://recurbate.com/api/get.php?video={}&token={}".format(video_id, token)
video_webpage = self._download_webpage(get_url, video_id)
mrscrapy marked this conversation as resolved.
Show resolved Hide resolved
real_url = self._html_search_regex(r'<source src=(.+?) type=\"video\/mp4\"', video_webpage, 'mp4video').strip("\"")
mrscrapy marked this conversation as resolved.
Show resolved Hide resolved

return {
'id': video_id,
'title': title,
'description': self._og_search_description(webpage),
'url': real_url,
}