emgarten/NuGet.CatalogReader

Mirroring most downloaded nugets from nuget.org

Closed this issue · 4 comments

Hi, I'd like to use nugetmirror to download all nugets in nuget.org that have more than a configurable amount of downloads with their dependencies.
Is there any way to do this with the current CLI or with small changes to the existing code?

Currently the search endpoint is the only way to get the download count for a package, so you would need to list everything from search, then filter on download count. Right now nugetmirror only uses the registration blobs, it doesn't use search. It could be done but it wouldn't be a small change.

There is a proposal to expose the download counts in a file which would make this easier, but it isn't implemented yet. See: NuGet/NuGetGallery#3532

I see. And what about downloading all dependencies when downloading nugets?
Say when I download all packages from the last month, I'd like the cli to download their dependencies as well.

Dependencies can be found in the registration blobs and also the nuspec files. It shouldn't be difficult to expand the set of things you are downloading using those.

public Task<FileInfo> DownloadNuspecAsync(string outputDirectory)
{
return DownloadNuspecAsync(outputDirectory, DownloadMode.FailIfExists, CancellationToken.None);
}

public async Task<JObject> GetRegistrationIndexUriAsync()
{
return await GetRegistrationIndexUriAsync(CancellationToken.None);
}

cool, thanks