Skip to content

alanlviana/chess-downloader

Repository files navigation

ChessDownloader.net

ChessDownloader.NET is a library that lets you download games from Chess.com and Lichess.org. You can download games by username.

install

  • 📦 NuGet: dotnet add package ChessDownloader.NET (main package)

usage

ChessDownloader.NET exposes its functionality through two entries points - the ChessComDownloader and LichessDownloader classes. Create a instance of one of these classes and use the method GetGamesByUsernameAsync(string).

using ChessDownloader.NET.ChessCom;
using ChessDownloader.NET.Lichess;

// IChessDownloader chessDownloader = new LichessDownloader();
IChessDownloader chessDownloader = new ChessComDownloader();

var games = await chessDownloader.GetGamesByUsernameAsync("alanlviana", GetHandlerProcessMessage());

private Progress<ChessDownloaderProgress> GetHandlerProcessMessage()
{
    return new Progress<ChessDownloaderProgress>(progressValue => {
    if (progressValue.Undefined)
    {
        Console.WriteLine($"{progressValue.ProgressMessage}");
    } else {
        Console.WriteLine($"{progressValue.Position}/{progressValue.Total}% - {progressValue.ProgressMessage}");
    }
    });
}

About

A package to download games from chess.com and lichess.org

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages