Crunchy-Downloader/CRD/Utils/Structs/Crunchyroll/Playback.cs
Elwador c5660a87e7 - Added **fallback for hardsub** to use **no-hardsub video** if enabled
- Added **video/audio toggle for endpoints** to control which media type is used from each endpoint
- **Updated packages** to the latest versions
- **Updated Android phone token**
2025-12-01 11:47:30 +01:00

100 lines
2.5 KiB
C#

using System.Collections.Generic;
using CRD.Downloader.Crunchyroll;
using Newtonsoft.Json;
namespace CRD.Utils.Structs.Crunchyroll;
public class PlaybackData{
public int Total{ get; set; }
public Dictionary<string, StreamDetails>? Data{ get; set; }
public PlaybackMeta? Meta{ get; set; }
}
public class StreamDetails{
[JsonProperty("hardsub_locale")]
public Locale? HardsubLocale{ get; set; }
public List<UrlWithAuth> Url{ get; set; }
[JsonProperty("hardsub_lang")]
public required LanguageItem HardsubLang{ get; set; }
public bool IsHardsubbed{ get; set; }
[JsonProperty("audio_lang")]
public string? AudioLang{ get; set; }
public string? Type{ get; set; }
}
public class UrlWithAuth{
public CrAuth? CrAuth{ get; set; }
public bool Video{ get; set; }
public bool Audio{ get; set; }
public string? Url{ get; set; }
}
public class StreamDetailsPop{
public Locale? HardsubLocale{ get; set; }
public List<UrlWithAuth> Url{ get; set; }
public required LanguageItem HardsubLang{ get; set; }
public bool IsHardsubbed{ get; set; }
public required LanguageItem AudioLang{ get; set; }
public string? Type{ get; set; }
public string? Format{ get; set; }
}
public class PlaybackMeta{
[JsonProperty("media_id")]
public string? MediaId{ get; set; }
public Subtitles? Subtitles{ get; set; }
public List<string>? Bifs{ get; set; }
public List<PlaybackVersion>? Versions{ get; set; }
[JsonProperty("audio_locale")]
public LanguageItem AudioLocale{ get; set; }
[JsonProperty("closed_captions")]
public Subtitles? ClosedCaptions{ get; set; }
public Dictionary<string, Caption>? Captions{ get; set; }
public string? Token{ get; set; }
}
public class SubtitleInfo{
public string? Format{ get; set; }
public Locale? Locale{ get; set; }
public string? Url{ get; set; }
}
public class CrunchyStreams : Dictionary<string, StreamDetails>;
public class Subtitles : Dictionary<string, SubtitleInfo>;
public class PlaybackVersion{
[JsonProperty("audio_locale")]
public Locale AudioLocale{ get; set; } // Assuming Locale is defined elsewhere
public string? Guid{ get; set; }
[JsonProperty("is_premium_only")]
public bool IsPremiumOnly{ get; set; }
[JsonProperty("media_guid")]
public string? MediaGuid{ get; set; }
public bool Original{ get; set; }
[JsonProperty("season_guid")]
public string? SeasonGuid{ get; set; }
public string? Variant{ get; set; }
}