TikTok-Live-Connector icon indicating copy to clipboard operation
TikTok-Live-Connector copied to clipboard

Failed to retrieve room_id from page source. Your IP or country might be blocked by TikTok.

Open iProGamer opened this issue 3 years ago • 18 comments

Even tiktok is not blocked in my country why?

iProGamer avatar Oct 03 '22 13:10 iProGamer

Can you access e.g. https://www.tiktok.com/@domehathunger/live in your browser? If yes, something is wrong with the library or your code. In this case please provide your code.

zerodytrash avatar Oct 03 '22 14:10 zerodytrash

Can you access e.g. https://www.tiktok.com/@domehathunger/live in your browser? If yes, something is wrong with the library or your code. In this case please provide your code.

Country: Italy I can access live from browser. This my code:

let ttConnection
let ttEvents = ['connected', 'disconnected', 'streamEnd', 'error', 'member', 'chat', 'gift', 'like', 'follow', 'share']
function connect(username){
    if (ttConnection != undefined && ttConnection.getState().isConnected){
        ttConnection.disconnect()
    }
    ttConnection = new WebcastPushConnection(username, {processInitialData: false})
    ttConnection.connect().then(state => {
        
    }).catch(err => {
        console.log(err)
    })
    ttEvents.forEach(e => {
        ttConnection.on(e, data => {
            if (data != undefined){
                data.event = e
                wss.broadcast(JSON.stringify(data))
            }
        })
    })
}

iProGamer avatar Oct 03 '22 15:10 iProGamer

problem from my code or library?

iProGamer avatar Oct 03 '22 18:10 iProGamer

so I just checked when access any live from my browser its included "og-url" and "roomId" but in tiktok-live-connector its not getting any of that!

iProGamer avatar Oct 07 '22 08:10 iProGamer

and that is whats causing the error

iProGamer avatar Oct 07 '22 08:10 iProGamer

its redirecting to the login page

iProGamer avatar Oct 07 '22 08:10 iProGamer

its redirecting me to login page, is there any alternative solution for this?

iProGamer avatar Oct 07 '22 09:10 iProGamer

so I just checked when access any live from my browser its included "og-url" and "roomId" but in tiktok-live-connector its not getting any of that!

Hello, I'm also Italian, try to use a proxy connected to a country outside of Italy, it should work.

g1ampy avatar Oct 09 '22 10:10 g1ampy

I´m also getting "Your IP or country might be blocked by TikTok", but I can watch lives in the browser so I don't think it is actually blocked. Something must have changed on TikTok side since yesterday the exact same code worked fine but today I´m seeing that error. The problem seems to be with the JS library only, the Python library works fine.

cesar-ioc avatar Oct 11 '22 17:10 cesar-ioc

yes try go incognito mode and open any live in tiktok you will see it will redirect you to login the page and that is exactly the problem, because the library is entering the live to get room id but its redirecting to login

iProGamer avatar Oct 11 '22 20:10 iProGamer

can confirm, TikTok redirects to https://www.tiktok.com/login?redirect_url=https%3A%2F%2Fwww.tiktok.com%2F%40ninogashi%2Flive&lang=en&enter_method=mandatory I tried it over IPs from several countries and it only occurs from Italy. Adding a SessionID should fix the problem.

zerodytrash avatar Oct 11 '22 21:10 zerodytrash

I have the same problem with the C# library, always connecting from Italy. Has anyone found a solution in any way?

ghostmaster75 avatar Jun 24 '23 22:06 ghostmaster75

can confirm, TikTok redirects to https://www.tiktok.com/login?redirect_url=https%3A%2F%2Fwww.tiktok.com%2F%40ninogashi%2Flive&lang=en&enter_method=mandatory I tried it over IPs from several countries and it only occurs from Italy. Adding a SessionID should fix the problem.

so i've add SessionID and working fine for a while, but after less or more than 10 minutes, the error just comback Error: Failed to retrieve room_id from page source. Your IP or country might be blocked by TikTok.

bakteribaik avatar Aug 05 '23 19:08 bakteribaik

Could this issue be caused because "tiktok.eulerstream.com" is rate limiting? And some reason "error code 429 - SignatureRateLimitReachedException" is not being given or displayed? While in development, I do need to restart the app multiple times. I noticed after X amount of times, this error shows up for X length of time.

as mentioned on https://github.com/isaackogan/TikTokLive/wiki/Signature-Server#what-rate-limits-exist

@zerodytrash @isaackogan

stevenjr1988 avatar Aug 07 '23 16:08 stevenjr1988

I have the same problem with the C# library, always connecting from Italy. Has anyone found a solution in any way?

Also I am looking for a solution

michelebissanti avatar Nov 02 '23 14:11 michelebissanti

I have the same problem with the C# library, always connecting from Italy. Has anyone found a solution in any way?

Also I am looking for a solution

in Italy we cannot see TikTok live broadcasts without being logged in (due to age restrictions) and since TikTok does not provide a login service in its API to then "connect" to the live broadcasts you can't do anything other than go through a vpn that allows you to connect.

ghostmaster75 avatar Nov 02 '23 14:11 ghostmaster75

I have the same problem with the C# library, always connecting from Italy. Has anyone found a solution in any way?

Also I am looking for a solution

in Italy we cannot see TikTok live broadcasts without being logged in (due to age restrictions) and since TikTok does not provide a login service in its API to then "connect" to the live broadcasts you can't do anything other than go through a vpn that allows you to connect.

Okay, thanks for the reply.

michelebissanti avatar Nov 02 '23 14:11 michelebissanti

If anyone else is searching for this issue, I found a workaround for the C# library, which might work with the other libraries. All I did was add ClientSettings with SkipRoomInfo=true.

ClientSettings settings = new ClientSettings();
settings.SkipRoomInfo = true;

Console.WriteLine("Enter a username");
TikTokLiveClient client = new TikTokLiveClient(Console.ReadLine(), "", settings);

egunde avatar Mar 11 '24 22:03 egunde