mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-29 14:35:25 -04:00
Add HTTP client and timeout to improve performance
This commit is contained in:
parent
965a1b6602
commit
06fdac5fa3
3 changed files with 18 additions and 5 deletions
|
@ -111,7 +111,7 @@ func downloadFile(ctx context.Context, progressReporter ProgressReporter, client
|
|||
return nil
|
||||
}
|
||||
|
||||
func DownloadTitle(cancelCtx context.Context, titleID, outputDirectory string, doDecryption bool, progressReporter ProgressReporter, deleteEncryptedContents bool, logger *Logger) error {
|
||||
func DownloadTitle(cancelCtx context.Context, titleID, outputDirectory string, doDecryption bool, progressReporter ProgressReporter, deleteEncryptedContents bool, logger *Logger, client *http.Client) error {
|
||||
titleEntry := getTitleEntryFromTid(titleID)
|
||||
|
||||
progressReporter.SetTotalDownloaded(0)
|
||||
|
@ -128,7 +128,6 @@ func DownloadTitle(cancelCtx context.Context, titleID, outputDirectory string, d
|
|||
return err
|
||||
}
|
||||
|
||||
client := &http.Client{}
|
||||
tmdPath := filepath.Join(outputDir, "title.tmd")
|
||||
if err := downloadFile(cancelCtx, progressReporter, client, fmt.Sprintf("%s/%s", baseURL, "tmd"), tmdPath, true); err != nil {
|
||||
if progressReporter.Cancelled() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue