Fix verify download link logic, remove the setting

This commit is contained in:
Ben Sarmiento
2024-02-17 15:01:46 +01:00
parent b2067dfb81
commit b4b4ebbc49
5 changed files with 7 additions and 28 deletions

View File

@@ -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")
}