Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloader stops at 3900/ #212

Open
ThunderousLeft opened this issue Jan 9, 2024 · 4 comments
Open

Downloader stops at 3900/ #212

ThunderousLeft opened this issue Jan 9, 2024 · 4 comments

Comments

@ThunderousLeft
Copy link

No error produced - the downloader simply stopped downloading when it hit 3900/4600+ files, then stopped downloading when it hit 1252/1975 files, and consistently doesnt grab those last 700 downloads.

I was hoping to get your help to understand what is going on here

@ThunderousLeft
Copy link
Author

image

@DavidArchibald
Copy link

The problem is this snippet:
https://github.com/AlexCSDev/UniversalDownloaderPlatform/blob/8eec8693944f5db4eb36e265f102dfe0889600e0/UniversalDownloaderPlatform.Engine/DownloadManager.cs#L91-L104

When a DownloadException happens OnFileDownloaded is still called (with a flag saying it failed) but any other error doesn't call OnFileDownloaded which is used for the counting. It seems you have roughly 700 errors which explains the undercounting.

@RisaDev
Copy link

RisaDev commented Apr 11, 2024

That shouldn't be the case because any error other than DownloadException is not being handled anywhere and supposed to crash the application from what I can see.

@DavidArchibald
Copy link

Yeah I forgot that handling other errors was something I added in a fork so that solved it for me in that case.

The undercounting is still going to apply here though:
https://github.com/AlexCSDev/UniversalDownloaderPlatform/blob/8eec8693944f5db4eb36e265f102dfe0889600e0/UniversalDownloaderPlatform.Engine/DownloadManager.cs#L56-L66

It returns (ending the task) when it's not a valid url or it's a blacklisted URL without calling OnFileDownloaded either which means it never reaches the same event I was referring to last time:

private static void UniversalDownloaderOnFileDownloaded(object sender, FileDownloadedEventArgs e)
{
_filesDownloaded++;
if (e.Success)
_logger.Info($"Downloaded {_filesDownloaded}/{e.TotalFiles}: {e.Url}");
else
_logger.Error($"Failed to download {e.Url}: {e.ErrorMessage}");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants