lay295 / TwitchDownloader

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

Getting error with text file for chatrender: "is not a valid chat format." #643

Closed YousufSSyed closed 1 year ago

YousufSSyed commented 1 year ago

Checklist

Edition

Command Line Interface

Describe your issue here

I successfully downloaded a txt of a livestream chat with this command: ./TwitchDownloaderCLI chatdownload -E -u 1778287275 -o "QuickDevStream.txt", but got when trying to render it: ./TwitchDownloaderCLI chatrender --input QuickDevStream.txt --output QuickDevStreamChat.mp4:

Unhandled exception. System.AggregateException: One or more errors occurred. (QuickDevStream.txt is not a valid chat format)
 ---> System.NotSupportedException: QuickDevStream.txt is not a valid chat format
   at TwitchDownloaderCore.Chat.ChatJson.DeserializeAsync(String filePath, Boolean getComments, Boolean getEmbeds, CancellationToken cancellationToken)
   at TwitchDownloaderCore.Chat.ChatJson.DeserializeAsync(String filePath, Boolean getComments, Boolean getEmbeds, CancellationToken cancellationToken)
   at TwitchDownloaderCore.ChatRenderer.ParseJsonAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
   at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
   at System.Threading.Tasks.Task.Wait()
   at TwitchDownloaderCLI.Modes.RenderChat.Render(ChatRenderArgs inputOptions)
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at TwitchDownloaderCLI.Program.Main(String[] args)
fish: Job 1, './TwitchDownloaderCLI chatrende…' terminated by signal SIGABRT (Abort)
ScrubN commented 1 year ago

Chats must be downloaded in JSON in order to be rendered, raw text chats do not contain enough information to generate a chat render.

YousufSSyed commented 1 year ago

Chats must be downloaded in JSON in order to be rendered, raw text chats do not contain enough information to generate a chat render.

Can u elaborate on that?

ScrubN commented 1 year ago

Chats must be downloaded in JSON in order to be rendered, raw text chats do not contain enough information to generate a chat render.

Can u elaborate on that?

When declaring your download output, make the file extension .json. It will then download the chat as a JSON file that can be rendered.

./TwitchDownloaderCLI chatdownload -E -u 1778287275 -o "QuickDevStream.json"
YousufSSyed commented 1 year ago

No I meant why wouldn't it be possible to render a txt file into a video?

lay295 commented 1 year ago

No I meant why wouldn't it be possible to render a txt file into a video?

We wouldn't know what streamer we're rendering for. We wouldn't have direct links to emote images. We wouldn't have badges. We wouldn't be able to tell a sub or bit message from a regular one (although with the recent API changes this makes this point moot).

So, the main points would be that 1st party Twitch emotes would be pretty broken and no badges. It's certainly possible though. A little bit said in #629 as well.

YousufSSyed commented 1 year ago

@lay295 I'm pretty sure TwitchDownloader didn't support downloading chats as txt two years, why was it added? Also it shold be made a little clear in the chatrender documentation that .txt isn't supported.

"Renders a chat JSON as a video" isn't very clear, it should say instead "Only JSON chat files are supported for rendering video. .txt is not supported." It should be regular text instead of small text, I missed it when reading the documentation the 1st time.

nallcho14 commented 11 months ago

No I meant why wouldn't it be possible to render a txt file into a video?

We wouldn't know what streamer we're rendering for. We wouldn't have direct links to emote images. We wouldn't have badges. We wouldn't be able to tell a sub or bit message from a regular one (although with the recent API changes this makes this point moot).

So, the main points would be that 1st party Twitch emotes would be pretty broken and no badges. It's certainly possible though. A little bit said in #629 as well.

Can you tell me how to convert the txt to json even if it doesnt include the emotes, to someone who doesn't know how to code? So far I've used online converters to convert .log file that comes from chatterino into .txt into .json, but I get the error "'#' is an invalid start of a value. " Deleted the first line "# Start logging at 2023-10-18 12:58:11" and it says "ERROR: Value cannot be null. (Parameter 'source')"

YousufSSyed commented 11 months ago

@nallcho14 Have u tried reading the documentation?

ScrubN commented 11 months ago

Can you tell me how to convert the txt to json even if it doesnt include the emotes, to someone who doesn't know how to code? So far I've used online converters to convert .log file that comes from chatterino into .txt into .json, but I get the error "'#' is an invalid start of a value. " Deleted the first line "# Start logging at 2023-10-18 12:58:11" and it says "ERROR: Value cannot be null. (Parameter 'source')"

@nallcho14 Have u tried reading the documentation?

JSON is a syntax specification, not a data format specification. I'm not sure how an online JSON converter is supposed to work, but the odds of it being the exact data format that TwitchDownloader needs is basically 0.

I did have a WIP project for attempting to convert plaintext chat files to TDJSON, but I got a little busy and it got left behind. I supposed I could continue working on it, perhaps even make it a CLI tool initially to get it out faster.