mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-04-28 20:23:01 +00:00
- Added **fallback for sync failures** [#407](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/407) - Added **history setting** to remove non-existent series/episodes on refresh [#420](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/420) - Added **movies to history** - Added **queue persistence** - Changed **download item state handling** - Changed **download item removal processing** - Made small changes to **font detection** - Changed **rate limit error handling** - Fixed issue where **files were not always cleaned up** for removed downloads - Fixed **crash when the queue list was modified** - Fixed **changelog parsing** not handling versions like `vX.X.X.X`, which caused changes to be re-added on every restart
98 lines
2.5 KiB
C#
98 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace CRD.Utils.Structs.Crunchyroll;
|
|
|
|
public class StreamError{
|
|
[JsonPropertyName("error")]
|
|
public string? Error{ get; set; }
|
|
|
|
[JsonPropertyName("activeStreams")]
|
|
public List<ActiveStream> ActiveStreams{ get; set; } = new ();
|
|
|
|
public static StreamError? FromJson(string json){
|
|
try{
|
|
return Helpers.Deserialize<StreamError>(json,null);
|
|
} catch (Exception e){
|
|
Console.Error.WriteLine(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public bool IsTooManyActiveStreamsError(){
|
|
return Error is "TOO_MANY_ACTIVE_STREAMS" or "TOO_MANY_CONCURRENT_STREAMS";
|
|
}
|
|
|
|
public bool IsRateLimitError(){
|
|
return Error?.Contains("4294") == true;
|
|
}
|
|
}
|
|
|
|
public class ActiveStream{
|
|
[JsonPropertyName("deviceSubtype")]
|
|
public string DeviceSubtype{ get; set; }
|
|
|
|
[JsonPropertyName("accountId")]
|
|
public string AccountId{ get; set; }
|
|
|
|
[JsonPropertyName("deviceType")]
|
|
public string DeviceType{ get; set; }
|
|
|
|
[JsonPropertyName("subscription")]
|
|
public string Subscription{ get; set; }
|
|
|
|
[JsonPropertyName("maxKeepAliveSeconds")]
|
|
public int MaxKeepAliveSeconds{ get; set; }
|
|
|
|
[JsonPropertyName("ttl")]
|
|
public int Ttl{ get; set; }
|
|
|
|
[JsonPropertyName("episodeIdentity")]
|
|
public string EpisodeIdentity{ get; set; }
|
|
|
|
[JsonPropertyName("tabId")]
|
|
public string TabId{ get; set; }
|
|
|
|
[JsonPropertyName("country")]
|
|
public string Country{ get; set; }
|
|
|
|
[JsonPropertyName("clientId")]
|
|
public string ClientId{ get; set; }
|
|
|
|
[JsonPropertyName("active")]
|
|
public bool Active{ get; set; }
|
|
|
|
[JsonPropertyName("deviceId")]
|
|
public string DeviceId{ get; set; }
|
|
|
|
[JsonPropertyName("token")]
|
|
public string Token{ get; set; }
|
|
|
|
[JsonPropertyName("assetId")]
|
|
public string AssetId{ get; set; }
|
|
|
|
[JsonPropertyName("sessionType")]
|
|
public string SessionType{ get; set; }
|
|
|
|
[JsonPropertyName("contentId")]
|
|
public string ContentId{ get; set; }
|
|
|
|
[JsonPropertyName("usesStreamLimits")]
|
|
public bool UsesStreamLimits{ get; set; }
|
|
|
|
[JsonPropertyName("playbackType")]
|
|
public string PlaybackType{ get; set; }
|
|
|
|
[JsonPropertyName("pk")]
|
|
public string Pk{ get; set; }
|
|
|
|
[JsonPropertyName("id")]
|
|
public string Id{ get; set; }
|
|
|
|
[JsonPropertyName("createdTimestamp")]
|
|
public long CreatedTimestamp{ get; set; }
|
|
|
|
[JsonPropertyName("lastKeepAliveTimestamp")]
|
|
public long LastKeepAliveTimestamp{ get; set; }
|
|
}
|