feat: Add thunderExpert priority video url switch
This commit is contained in:
@ -146,6 +146,7 @@ func (x *ThunderExpert) Init(ctx context.Context, storage model.Storage) (err er
|
||||
PackageName: x.PackageName,
|
||||
UserAgent: x.UserAgent,
|
||||
DownloadUserAgent: x.DownloadUserAgent,
|
||||
UseVideoUrl: x.UseVideoUrl,
|
||||
},
|
||||
}
|
||||
|
||||
@ -209,6 +210,7 @@ func (x *ThunderExpert) Init(ctx context.Context, storage model.Storage) (err er
|
||||
}
|
||||
x.XunLeiCommon.UserAgent = x.UserAgent
|
||||
x.XunLeiCommon.DownloadUserAgent = x.DownloadUserAgent
|
||||
x.XunLeiCommon.UseVideoUrl = x.UseVideoUrl
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -252,6 +254,15 @@ func (xc *XunLeiCommon) Link(ctx context.Context, file model.Obj, args model.Lin
|
||||
},
|
||||
}
|
||||
|
||||
if xc.UseVideoUrl {
|
||||
for _, media := range lFile.Medias {
|
||||
if media.Link.URL != "" {
|
||||
link.URL = media.Link.URL
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
strs := regexp.MustCompile(`e=([0-9]*)`).FindStringSubmatch(lFile.WebContentLink)
|
||||
if len(strs) == 2 {
|
||||
|
Reference in New Issue
Block a user