mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add available function to check if episode streams are available
This commit is contained in:
parent
6c476df24e
commit
0ffae4ddda
3 changed files with 15 additions and 0 deletions
5
url.go
5
url.go
|
|
@ -49,6 +49,11 @@ func (c *Crunchyroll) ExtractEpisodesFromUrl(url string, audio ...LOCALE) ([]*Ep
|
|||
}
|
||||
|
||||
for _, episode := range episodes {
|
||||
// if no episode streams are available, calling episode.AudioLocale
|
||||
// will result in an unwanted error
|
||||
if !episode.Available() {
|
||||
continue
|
||||
}
|
||||
locale, err := episode.AudioLocale()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue