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

[Chaturbate] Consider using the API #10359

Open
8 of 10 tasks
oifj34f34f opened this issue Jul 5, 2024 · 0 comments
Open
8 of 10 tasks

[Chaturbate] Consider using the API #10359

oifj34f34f opened this issue Jul 5, 2024 · 0 comments
Labels
NSFW site-enhancement Feature request for some website triage Untriaged issue

Comments

@oifj34f34f
Copy link

oifj34f34f commented Jul 5, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

No response

Example URLs

https://chaturbate.com/kira_censori/

Provide a description that is worded well enough to be understood

Currently yt-dlp loads the entire page to find the m3u8 stream URL, but another way is to use the API:

$ curl -X POST "https://chaturbate.com/get_edge_hls_url_ajax/" -H "X-Requested-With: XMLHttpRequest" -d "room_slug=kira_censori"
{
    "success": true,
    "url": "https://edge17-hel.live.mmcdn.com/live-hls/amlst:kira_censori-sd-203fe4e99b463f0b5013d75b7f491286d7f8cbdad109cef79db409bfc80e33d0_trns_h264/playlist.m3u8",
    "room_status": "public",
    "hidden_message": ""
}

This endpoint provides the same m3u8 stream URL that is embedded in HTML (specifically in window.initialRoomDossier). The advantage is that this is ~500 times smaller in size compared to downloading the entire HTML page and simplifies error handling.

Here is a rough sequence of actions:

if "success":
  - true:
    if "room_status":
      - "public":
        if "url":
          - [m3u8 stream url]
          - "": [room is geo-blocked]
      - something else: [room is private or offline]
  - false: [room doesn't exist]

All possible room_status values can be found here. Not sure what we need to tell the user in non-public cases, above is just an example.

Maybe someday I'll do a PR if I have time. What do you think about that?

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

No response

@oifj34f34f oifj34f34f added site-enhancement Feature request for some website triage Untriaged issue labels Jul 5, 2024
@garret1317 garret1317 added the NSFW label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NSFW site-enhancement Feature request for some website triage Untriaged issue
Projects
None yet
Development

No branches or pull requests

2 participants