Damianonymous / streamlink-plugins

91 stars 42 forks source link

the chaturbate plugin doesn't work anymore ,anyone can help? #33

Open NormanMises opened 1 year ago

NormanMises commented 1 year ago

the chaturbate plugin doesn't work anymore ,anyone can help? i would be very appreciate it!!!

odnar-dev commented 1 year ago

try this : https://raw.githubusercontent.com/community-plugins/streamlink-plugins/streamlink-2.2.0-(legacy)/plugins/chaturbate.py download this file and replace chaturbate.py with this

Quinss271 commented 1 year ago

try this : https://raw.githubusercontent.com/community-plugins/streamlink-plugins/streamlink-2.2.0-(legacy)/plugins/chaturbate.py download this file and replace chaturbate.py with this

If still not working looks like your ip banned, try another

NormanMises commented 1 year ago

@Quinss271 @odnar-dev Can you tell me what is the last version of streamlink that I can run? I am using streamlink 5.3.1. it shows the following error when running,

[warnings][streamlinkdeprecation] `streamlink.plugin.api.validate.text` is deprecated. Use `str` instead.
[warnings][streamlinkdeprecation] Resolved plugin chaturbate with deprecated can_handle_url API
[cli][info] Found matching plugin chaturbate for URL https://chaturbate.com/madeline_jackson/
error: Unable to open URL: https://chaturbate.com/api/chatvideocontext/madeline_jackson (HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/madeline_jackson (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000260F9DD2A50>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))))

but I am able to access and log into chaturbate from the web page normally.

NormanMises commented 1 year ago

Every time I open the chaturbate page, the Cloudflare screen always pops up asking to verify that I am a real person. Is this causing the recording to fail? Is there a way to fix it?

odnar-dev commented 1 year ago

yes Cloudflare may be blocking your IP, you can try using a VPN or proxy to change your IP

or try installing cloudscraper which bypass Cloudflare's anti-bot page. and using this version : https://raw.githubusercontent.com/community-plugins/streamlink-plugins/cloudscraper/plugins/chaturbate.py

NormanMises commented 1 year ago

yes Cloudflare may be blocking your IP, you can try using a VPN or proxy to change your IP

or try installing cloudscraper which bypass Cloudflare's anti-bot page. and using this version : https://raw.githubusercontent.com/community-plugins/streamlink-plugins/cloudscraper/plugins/chaturbate.py

I tried it but it shows the following error

[cli][info] Found matching plugin chaturbate for URL https://chaturbate.com/cheryl_pride/
[plugins.chaturbate][info] using cloudscraper
Traceback (most recent call last):
  File "D:\Apps\Streamlink\pkgs\urllib3\connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\urllib3\util\connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "socket.py", line 962, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Apps\Streamlink\pkgs\urllib3\connectionpool.py", line 700, in urlopen
    self._prepare_proxy(conn)
  File "D:\Apps\Streamlink\pkgs\urllib3\connectionpool.py", line 996, in _prepare_proxy
    conn.connect()
  File "D:\Apps\Streamlink\pkgs\urllib3\connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\urllib3\connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000029ACBFA0910>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Apps\Streamlink\pkgs\requests\adapters.py", line 489, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\urllib3\connectionpool.py", line 787, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/cheryl_pride (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029ACBFA0910>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Apps\Streamlink\pkgs\streamlink\plugin\api\http_session.py", line 152, in request
    res = super().request(
          ^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\requests\adapters.py", line 559, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/cheryl_pride (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029ACBFA0910>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Apps\Streamlink\pkgs\streamlink\plugins\chaturbate.py", line 48, in _get_streams
    res = self.session.http.get(api_url, headers=headers, cookies=cookies)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\requests\sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\streamlink\plugin\api\http_session.py", line 171, in request
    raise err
 by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029ACBFA0910>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Apps\Streamlink\bin\streamlink.exe\__main__.py", line 18, in <module>
  File "D:\Apps\Streamlink\pkgs\streamlink_cli\main.py", line 927, in main
    handle_url()
  File "D:\Apps\Streamlink\pkgs\streamlink_cli\main.py", line 549, in handle_url
    streams = fetch_streams(plugin)
              ^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\streamlink_cli\main.py", line 443, in fetch_streams
    return plugin.streams(stream_types=args.stream_types,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\streamlink\plugin\plugin.py", line 427, in streams
    ostreams = list(ostreams)
               ^^^^^^^^^^^^^^
  File "D:\Apps\Streamlink\pkgs\streamlink\plugins\chaturbate.py", line 52, in _get_streams
    import cloudscraper
ModuleNotFoundError: No module named 'cloudscraper'

but I did pip install cloudscraper, and it can be imported

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cloudscraper
>>>
odnar-dev commented 1 year ago

streamlink builds for Windows come bundled with an embedded Python environment try :

pip install --target=D:\Apps\Streamlink\pkgs cloudscraper
NormanMises commented 1 year ago

streamlink builds for Windows come bundled with an embedded Python environment try :

pip install --target=D:\Apps\Streamlink\pkgs cloudscraper

thinks!it works! it shows this now

[cli][info] Found matching plugin chaturbate for URL https://chaturbate.com/hinatabroks/
[plugins.chaturbate][info] using cloudscraper
[plugins.chaturbate][info] Stream status: public
error: Unable to open URL: https://edge5-lax.live.mmcdn.com/live-hls/amlst:hinatabroks-sd-1159a47711f3a23f5355b16c509064ef09495410fc7348640ca2f43f20a7f339_trns_h264/playlist.m3u8 (HTTPSConnectionPool(host='edge5-lax.live.mmcdn.com', port=443): Max retries exceeded with url: /live-hls/amlst:hinatabroks-sd-1159a47711f3a23f5355b16c509064ef09495410fc7348640ca2f43f20a7f339_trns_h264/playlist.m3u8 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000025953E389D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))))

but I can open the m3u8 link using potplayer

odnar-dev commented 1 year ago

if you can post the entire command while using the --loglevel=debug parameter and try updating streamlink to the latest version

NormanMises commented 1 year ago

if you can post the entire command while using the --loglevel=debug parameter and try updating streamlink to the latest version

it shows this

streamlink --loglevel=debug https://chaturbate.com/delicious_couple_/
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.11.2
[cli][debug] Streamlink: 5.3.1
[cli][debug] Dependencies:
[cli][debug]  certifi: 2022.12.7
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 4.9.2
[cli][debug]  pycountry: 22.3.5
[cli][debug]  pycryptodome: 3.17
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.28.2
[cli][debug]  urllib3: 1.26.14
[cli][debug]  websocket-client: 1.5.1
[cli][debug] Arguments:
[cli][debug]  url=https://chaturbate.com/delicious_couple_/
[cli][debug]  --loglevel=debug
[cli][debug]  --player="D:\Apps\potplayer\PotPlayerMini64.exe"
[cli][debug]  --output=E:/records/Captures/{author}/{author} {time:%Y-%m-%d %H%M%S}.mkv
[cli][debug]  --ffmpeg-ffmpeg=D:\Apps\ffmpeg\bin\ffmpeg.exe
[cli][debug]  --http-proxy="http://127.0.0.1:12345"
[cli][debug]  --http-no-ssl-verify=True
[cli][info] Found matching plugin chaturbate for URL https://chaturbate.com/delicious_couple_/
[plugins.chaturbate][info] using cloudscraper
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000022A6ECE5C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/delicious_couple_ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A6ECE5C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

During handling of the above exception, another exception occurred:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/delicious_couple_ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A6ECE5C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')))

During handling of the above exception, another exception occurred:

streamlink.exceptions.PluginError: Unable to open URL: https://chaturbate.com/api/chatvideocontext/delicious_couple_ (HTTPSConnectionPool(host='chaturbate.com', port=443): Max retries exceeded with url: /api/chatvideocontext/delicious_couple_ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A6ECE5C10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))))

During handling of the above exception, another exception occurred:

cloudscraper.exceptions.CloudflareChallengeError: Detected a Cloudflare version 2 Captcha challenge, This feature is not available in the opensource (free) version.
netwet commented 1 year ago

im use streamlink 1.7.0 for chaturbate (copy all and save as chaturbate.py and copy to streamlink pulgins):

import re import uuid

from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.stream import HLSStream

API_HLS = "https://chaturbate.com/get_edge_hls_url_ajax/"

_url_re = re.compile(r"https?://(\w+.)?chaturbate.com/(?P\w+)")

_post_schema = validate.Schema( { "url": validate.text, "room_status": validate.text, "success": int } )

class Chaturbate(Plugin): @classmethod def can_handle_url(cls, url): return _url_re.match(url)

def _get_streams(self):
    match = _url_re.match(self.url)
    username = match.group("username")

    CSRFToken = str(uuid.uuid4().hex.upper()[0:32])

    headers = {
        "Content-Type": "application/x-www-form-urlencoded",
        "X-CSRFToken": CSRFToken,
        "X-Requested-With": "XMLHttpRequest",
        "Referer": self.url,
    }

    cookies = {
        "csrftoken": CSRFToken,
    }

    post_data = "room_slug={0}&bandwidth=high".format(username)

    res = self.session.http.post(API_HLS, headers=headers, cookies=cookies, data=post_data)
    data = self.session.http.json(res, schema=_post_schema)

    self.logger.info("Stream status: {0}".format(data["room_status"]))
    if (data["success"] is True and data["room_status"] == "public" and data["url"]):
        for s in HLSStream.parse_variant_playlist(self.session, data["url"]).items():
            yield s

plugin = Chaturbate

SmartHbdev commented 2 months ago

Works with streamlink v6


import uuid

from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream

API_HLS = "https://chaturbate.com/get_edge_hls_url_ajax/"

@pluginmatcher(re.compile(
    r"https?://(\w+\.)?chaturbate\.com/(?P<username>\w+)"
))
class Chaturbate(Plugin):

    def _get_streams(self):
        match = self.match
        username = match.group("username")

        CSRFToken = str(uuid.uuid4().hex.upper()[0:32])

        headers = {
            "Content-Type": "application/x-www-form-urlencoded",
            "X-CSRFToken": CSRFToken,
            "X-Requested-With": "XMLHttpRequest",
            "Referer": self.url,
        }

        cookies = {
            "csrftoken": CSRFToken,
        }

        post_data = f"room_slug={username}&bandwidth=high"

        res = self.session.http.post(API_HLS, headers=headers, cookies=cookies, data=post_data)
        data = self.session.http.json(res, schema=validate.Schema({
            "url": str,
            "room_status": str,
            "success": int
        }))

        self.logger.info(f"Stream status: {data['room_status']}")
        if data["success"] == 1 and data["room_status"] == "public" and data["url"]:
            streams = HLSStream.parse_variant_playlist(self.session, data["url"])
            if streams:
                return streams

__plugin__ = Chaturbate
newadventure079 commented 1 month ago

Works with streamlink v6

import uuid

from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream

API_HLS = "https://chaturbate.com/get_edge_hls_url_ajax/"

@pluginmatcher(re.compile(
    r"https?://(\w+\.)?chaturbate\.com/(?P<username>\w+)"
))
class Chaturbate(Plugin):

    def _get_streams(self):
        match = self.match
        username = match.group("username")

        CSRFToken = str(uuid.uuid4().hex.upper()[0:32])

        headers = {
            "Content-Type": "application/x-www-form-urlencoded",
            "X-CSRFToken": CSRFToken,
            "X-Requested-With": "XMLHttpRequest",
            "Referer": self.url,
        }

        cookies = {
            "csrftoken": CSRFToken,
        }

        post_data = f"room_slug={username}&bandwidth=high"

        res = self.session.http.post(API_HLS, headers=headers, cookies=cookies, data=post_data)
        data = self.session.http.json(res, schema=validate.Schema({
            "url": str,
            "room_status": str,
            "success": int
        }))

        self.logger.info(f"Stream status: {data['room_status']}")
        if data["success"] == 1 and data["room_status"] == "public" and data["url"]:
            streams = HLSStream.parse_variant_playlist(self.session, data["url"])
            if streams:
                return streams

__plugin__ = Chaturbate

Needs import re