improved subtitles
This commit is contained in:
@@ -50,6 +50,7 @@ type Media struct {
|
|||||||
type Subtitles struct {
|
type Subtitles struct {
|
||||||
Src string `json:"src"`
|
Src string `json:"src"`
|
||||||
FileName string `json:"filename"`
|
FileName string `json:"filename"`
|
||||||
|
Name string `json:"name"`
|
||||||
SrcLang string `json:"srclang"`
|
SrcLang string `json:"srclang"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ func DownloadSingle(url string, subtitleLang string, parentDirectory string) {
|
|||||||
fmt.Println("Fetching subtitles")
|
fmt.Println("Fetching subtitles")
|
||||||
|
|
||||||
for _, subtitle := range subtitles {
|
for _, subtitle := range subtitles {
|
||||||
if subtitle.SrcLang == subtitleLang {
|
if subtitle.SrcLang == subtitleLang || subtitle.Name == subtitleLang {
|
||||||
parentDirectory = filepath.Join(parentDirectory, name)
|
parentDirectory = filepath.Join(parentDirectory, name)
|
||||||
_ = os.Mkdir(parentDirectory, os.ModePerm) // dont care if directory fails to create
|
_ = os.Mkdir(parentDirectory, os.ModePerm) // dont care if directory fails to create
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user