Fix verify download link logic, remove the setting
This commit is contained in:
@@ -15,13 +15,15 @@ import (
|
||||
type RealDebrid struct {
|
||||
client *zurghttp.HTTPClient
|
||||
unrestrictClient *zurghttp.HTTPClient
|
||||
downloadClient *zurghttp.HTTPClient
|
||||
log *logutil.Logger
|
||||
}
|
||||
|
||||
func NewRealDebrid(client, unrestrictClient *zurghttp.HTTPClient, log *logutil.Logger) *RealDebrid {
|
||||
func NewRealDebrid(client, unrestrictClient, downloadClient *zurghttp.HTTPClient, log *logutil.Logger) *RealDebrid {
|
||||
return &RealDebrid{
|
||||
client: client,
|
||||
unrestrictClient: unrestrictClient,
|
||||
downloadClient: downloadClient,
|
||||
log: log,
|
||||
}
|
||||
}
|
||||
@@ -101,7 +103,7 @@ func (rd *RealDebrid) UnrestrictLink(link string, checkFirstByte bool) (*Downloa
|
||||
return nil, fmt.Errorf("undecodable response: %v", err)
|
||||
}
|
||||
|
||||
if checkFirstByte && !rd.client.CanFetchFirstByte(response.Download) {
|
||||
if checkFirstByte && !rd.downloadClient.CanFetchFirstByte(response.Download) {
|
||||
return nil, fmt.Errorf("can't fetch first byte")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user