lay295 / TwitchDownloader

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

Unable to download clips #895

Closed PriscillAAH closed 9 months ago

PriscillAAH commented 9 months ago

Checklist

Edition

Windows GUI Application

Describe your issue here

Was able to download clips the other day but had to reinstall program and now this is happening.

I have tried multiple times to download clips and keep getting this error:

ERROR: System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $[0].data.clip.videoQualities[0].frameRate | LineNumber: 0 | BytePositionInLine: 527. ---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int32. at System.Text.Json.ThrowHelper.ThrowFormatException(NumericType numericType) at System.Text.Json.Utf8JsonReader.GetInt32() at System.Text.Json.Serialization.Converters.Int32Converter.ReadNumberWithCustomHandling(Utf8JsonReader& reader, JsonNumberHandling handling, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, JsonTypeInfo jsonTypeInfo, ReadStack& state) at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.ReadFromStreamAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken) at System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsyncCore[T](HttpContent content, Encoding sourceEncoding, JsonSerializerOptions options, CancellationToken cancellationToken) at TwitchDownloaderCore.TwitchHelper.GetClipLinks(String clipId) at TwitchDownloaderWPF.PageClipDownload.GetClipInfo()

Add any related files or extra information here

No response

ScrubN commented 9 months ago

Funny story, I ran into this myself and fixed it earlier today. Guess I'll release a new update with the fix.

PriscillAAH commented 9 months ago

@ScrubN thanks able to download now but for some reason files aren't downloading at 1080p? Keep getting random qualities even though I am selecting 1080p. Also it doesn't default to 1080p when I click get clip info and I have to uncheck encode metadata otherwise it gets stuck on encoding clip metadata.

ScrubN commented 9 months ago

Could you provide example links to clips where you experience the 1080p and metadata issues?

ScrubN commented 9 months ago

for some reason files aren't downloading at 1080p? Keep getting random qualities even though I am selecting 1080p

I have found the issue. Twitch changed how one of their API responses looks but I didn't catch it because I didn't know how it looked previously. I'll release a hotfix, but this API change also kinda broke the website so it'll probably change again soon. Source VOD Available clip qualities
image image
PriscillAAH commented 9 months ago

for some reason files aren't downloading at 1080p? Keep getting random qualities even though I am selecting 1080p

I have found the issue. Twitch changed how one of their API responses looks but I didn't catch it because I didn't know how it looked previously. I'll release a hotfix, but this API change also kinda broke the website so it'll probably change again soon.

Source VOD Available clip qualities image image

yeah apparently for vods/streams the qualities are normal 1080 at the top down, but for clips Twitch is randomizing the quality list saw some comments on a reddit thread about it.