HorribleSubsFetcher

Simple library which is able to search, fetch and parse the xdcc packlist of https://xdcc.horriblesubs.info/


Keywords
anime, fetcher, horrible, subs, horrible-subs, packlist, xdcc, download, parsing, parse
License
MIT
Install
Install-Package HorribleSubsFetcher -Version 1.0.1

Documentation

Horrible Subs Fetcher

forthebadge forthebadge

GitHub license Nuget GitHub last commit GitHub issues

This is a simple library which is able to search, fetch and parse the xdcc packlist of https://xdcc.horriblesubs.info/

Built with ❤︎ by Daniel Belz



Getting started

Fetching all bots

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
    var tokenSource = new CancellationTokenSource();

    var bots = await fetcher.FetchBotListAsync(tokenSource.Token);

    foreach (var bot in bots)
        Console.WriteLine(bot);

    Console.ReadLine();
}

Sample Solution

Fetching the packlist of a bot

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
    var tokenSource = new CancellationTokenSource();

    const string bot = "Ginpachi-Sensei";

    var packList = await fetcher.FetchBotPackListAsync(bot, tokenSource.Token);

    foreach (var item in packList)
        Console.WriteLine(item);

    Console.ReadLine();
}

Sample Solution

Fetching all packlists

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
    var tokenSource = new CancellationTokenSource();

    var packList = await fetcher.FetchPackListsAsync(tokenSource.Token);

    foreach (var item in packList)
        Console.WriteLine(item);

    Console.ReadLine();
}

Sample Solution

Finding packs of a bot

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
	var tokenSource = new CancellationTokenSource();

    var bot = "Ginpachi-Sensei";

    var packList = await fetcher.FindBotPacksAsync("Toradora", bot, tokenSource.Token);

    foreach (var item in packList)
        Console.WriteLine(item);

    Console.ReadLine();
}

Sample Solution

Finding packs

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
	var tokenSource = new CancellationTokenSource();

    var packList = await fetcher.FindPacksAsync("Toradora", tokenSource.Token);

    foreach (var item in packList)
        Console.WriteLine(item);

    Console.ReadLine();
}

Sample Solution

Pack ToString

The Pack class overrides the ToString() method. It returns a string which can be copy pasted in your favorite irc/xdcc client:

private static async Task Main()
{
    var httpClient = new HttpClient();

    var fetcher = new Fetcher(httpClient);
	var tokenSource = new CancellationTokenSource();

    var packList = await fetcher.FetchPackListsAsync(tokenSource.Token);

    foreach (var item in packList)
    {
        // returns: /msg $BOT$ xdcc send #$PACKNUMBER$
        Console.WriteLine(item);
    }

    Console.ReadLine();
}

Contributing

Contributions are always welcome!
Just send me a pull request and I will look at it. If you have more changes please create a issue to discuss it first.

License

This project is licensed under the MIT License - see the LICENSE.md file for details