Skip to content

First version of the cc-downloader library #16

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

First version of the cc-downloader library #16

wants to merge 7 commits into from

Conversation

pjox
Copy link
Member

@pjox pjox commented Jul 7, 2025

Description

This PR contains the first version of the cc-downloader library with some light documentation.

Breaking Changes

None

Notes & open questions

We need to discuss the API, this code makes cc-downloader usable as a library but setting the download options remains a bit convoluted. Here is an example on how to import and use the library:

use cc_downloader::{
    download::{DownloadOptions, download, download_paths},
    errors::DownloadError,
};

#[tokio::main]
async fn main() -> Result<(), DownloadError> {
    let options = DownloadOptions::new(
        "CC-MAIN-2025-18",
        "wet",
        "test-download/wet.paths.gz",
        "test-download/",
        10,
        1000,
        false,
        false,
        true,
    );
    download_paths(options.clone()).await?;
    download(options).await?;
    Ok(())
}

As you can see, the DownloadOptions struct contains far too many parameters, so maybe it would be a good idea to split this into multiple structures? All feedback is welcome. Also, once the API is stabilized, writing bindings should be easier.

@pjox pjox requested review from wumpus and thunderpoot July 7, 2025 10:48
@pjox pjox self-assigned this Jul 7, 2025
@pjox pjox added the enhancement New feature or request label Jul 7, 2025
@jenenglish
Copy link

@wumpus Just highlighting this is ready for review.

@wumpus
Copy link
Member

wumpus commented Jul 13, 2025

I don't know much about Rust library interfaces. Is there a reason why the DownloadOptions don't have names and are a list?

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

Successfully merging this pull request may close these issues.

3 participants