oliverjrose99 / Recordurbate

A Bot to automatically record Chaturbate live streams.
GNU General Public License v3.0
235 stars 77 forks source link

Not all names are downloaded #83

Open Stevecaboose opened 1 year ago

Stevecaboose commented 1 year ago

I have noticed that not everyone (tested with all of them online) will be downloaded in the list. Some will download some wont. Is there an explanation for this?

divenxx commented 1 year ago

is_online function only checks for the top 500 model only https://github.com/oliverjrose99/Recordurbate/blob/3c4ea62fcad3d1ec6ab9bc350d84cbb9403102a6/recordurbate/bot.py#L74

Stevecaboose commented 1 year ago

What's the reason behind that number?

divenxx commented 1 year ago

limitation from the API, it will be overloaded if we downloaded all the info of all the online models there are thousands and thousands of online models at a time

divenxx commented 1 year ago

i fixed this issue locally by using the old code for is_online function in bot.py

this is the code that works for me

    def is_online(self, username):
        url = "https://chaturbate.com/get_edge_hls_url_ajax/"
        headers = {"X-Requested-With": "XMLHttpRequest"}
        data = {"room_slug": username, "bandwidth": "high"}

        try:
            time.sleep(3)  # fix issue 30
            r = requests.post(url, headers=headers, data=data)
            if r.json()["room_status"] == "public":
                return True

            return False

        except Exception as e:
            self.logger.exception(e)
            return None
skybarberom commented 1 year ago

@divenxx that code works for me too. I will test for a while.