Replace --list-chapters and --list-formats with --info, include additional infos, update README, and some minor fixes and improvements

This commit is contained in:
ChaoticByte 2025-03-09 19:46:44 +01:00
parent 6bbc319d1b
commit 5d490de7f1
No known key found for this signature in database
4 changed files with 114 additions and 106 deletions

View file

@ -64,6 +64,8 @@ func (api *GtvApi) GetStreamEpisode(episode string) (StreamEpisode, error) {
// Title
json.Unmarshal(info_data, &ep)
ep.Title = strings.ToValidUTF8(ep.Title, "")
// Length
ep.Length = ep.Length * time.Second
// Sort Chapters, correct offset and set index
sort.Slice(ep.Chapters, func(i int, j int) bool {
return ep.Chapters[i].Offset < ep.Chapters[j].Offset
@ -194,7 +196,7 @@ func (api *GtvApi) DownloadEpisode(
// Handle Interrupts
<-interruptChan
keyboardInterrupt = true
yield(DownloadProgress{Progress: progress, Rate: actualRate, Retries: 0, Title: ep.Title})
yield(DownloadProgress{Aborted: true, Progress: progress, Rate: actualRate, Retries: 0, Title: ep.Title})
}()
for i, chunk := range chunklist.Chunks {
if i < nextChunk {