lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.54k stars 260 forks source link

System.text.json.jsonexception: '<' is an invalid start of a value #965

Open taimi7364 opened 5 months ago

taimi7364 commented 5 months ago

Checklist

Edition

Windows GUI Application

Describe your issue here

When trying to download kick chat from a VOD (I download the full stream chat so no cropping) for example https://kick.com/video/6701079e-017d-4e75-a283-6b642f018e60, it throws an error like one of these: error kick error kick error2 kick error3

Latest picture pops up the most. Also I have static ip if that matters.

Downloading JSON files from kick dot com works some days and doesn't work for somedays/multiple days. Somedays using phones internet to download chats it works fine. I download the full stream chat so no cropping.

I have build from the latest kick branch v1.54.0. But I had to delete one line of code because it didn't build properly. Could this be the problem?

I have tried to clear the temp files in twitchdownloader, but it didn't help.

Add any related files or extra information here

No response

ScrubN commented 5 months ago

If I had to guess I would say your IP is being rate limited, and it seems we aren't checking our kick responses to ensure they are actually valid JSON responses.

How many chat download threads are you using? I've had good success with only 4, but I know it is very slow that way.

ScrubN commented 5 months ago

But I had to delete one line of code because it didn't build properly. Could this be the problem?

Also, which line of code would this be? It builds just fine on my machine

ScrubN commented 5 months ago

How many chat download threads are you using? I've had good success with only 4, but I know it is very slow that way.

I left a download running in the background and a while I managed to reproduce with just 4 threads. The response is a bad gateway error formatted as an HTML page. I guess I could add a check for <!DOCTYPE html> and freeze all downloads for a minute? image

taimi7364 commented 5 months ago

Also, which line of code would this be?

Ok so I tried to build the kick branch today and now it builds fine with only this error: Z:\kickdownloader\TwitchDownloader-kick-support\TwitchDownloader-kick-support\TwitchDownloaderCore\VideoPlatforms\Kick\ Downloaders\KickChatDownloader.cs(272,17): warning CS0162: Unreachable code detected [Z:\kickdownloader\TwitchDownloade r-kick-support\TwitchDownloader-kick-support\TwitchDownloaderCore\TwitchDownloaderCore.csproj]

Before it had some errors but I don't remember what exactly.

How many chat download threads are you using?

If you mean connections I use 20. If you mean maximum thread bandwidth I have it unselected.

I guess I could add a check for !DOCTYPE html and freeze all downloads for a minute?

Yeah I think stopping the download for a 60 second would be fine.

edit: I tried with phones internet with 4 connections and it downloaded the json file without errors.