bugfix when downloading films
This commit is contained in:
@@ -2,6 +2,7 @@ package downloader
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -152,8 +153,13 @@ func GetContentPageData(contentId string) *ContentPageData {
|
||||
|
||||
err = json.Unmarshal(bytes, &data)
|
||||
if err != nil {
|
||||
var unmarshalTypeError *json.UnmarshalTypeError
|
||||
if errors.As(err, &unmarshalTypeError) {
|
||||
data.Data.SeasonList = SeasonList{}
|
||||
} else {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
return &data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user