Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
/ AnimeDl Public archive

⚡️An API for downloading or streaming your favorite anime.

Notifications You must be signed in to change notification settings

jerry08/AnimeDl

Repository files navigation

AnimeDl

Version Downloads

AnimeDl scrapes animes from sites.



🌟STAR THIS REPOSITORY TO SUPPORT THE DEVELOPER AND ENCOURAGE THE DEVELOPMENT OF THE PROJECT!


Please do not attempt to upload AnimeDl or any of it's forks on Playstore or any other Android appstores on the internet. Doing so, may infringe their terms and conditions. This may result to legal action or immediate take-down of the app.

Official Discord Server

  • Available Anime sources:-
SITE STATUS DOWNLOADS
Gogo WORKING YES
Zoro WORKING YES

Install

  • 📦 NuGet: dotnet add package AnimeDl

Usage

AnimeDl exposes its functionality through a single entry point — the AnimeClient class. Create an instance of this class and use the provided operations to send requests.

Searching

You can execute a search query and get its results by calling Search(...) or SearchAsync(...):

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");

Anime

Retrieving anime metadata

To retrieve the metadata associated with an anime, execute a search query as mentioned above:

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");

var title = animes[0].Title;

//More anime details
var animeInfo = await client.GetAnimeInfoAsync(animes[0].Id);
var image = animeInfo.Image;
var summary = animeInfo.Summary;

Episodes

Retrieving anime episodes and episode metadata

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");
var episodes = await client.GetEpisodesAsync(animes[0].Id);

var description = episodes[0].Description;
var link = episodes[0].Link;

Video Servers

Retrieving an episode video servers

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");
var episodes = await client.GetEpisodesAsync(animes[0].Id);
var servers = await client.GetVideoServersAsync(episodes[0].Id);

Videos

Retrieving video and metadata

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");
var episodes = await client.GetEpisodesAsync(animes[0].Id);
var servers = await client.GetVideoServersAsync(episodes[0].Id);
var videos = await client.GetVideosAsync(servers[0]);

var videoUrl = videos[0].VideoUrl;
var headers = videos[0].Headers;
var resolution = videos[0].Resolution;
var format = videos[0].Format;

Retrieving aniskip metadata

using System.Linq;
using AnimeDl.Anilist;

var client = new AnilistClient();

var searchResults = await client.SearchAsync("ANIME", search: "chainsaw man");
var animes = searchResults?.Results.Where(x => x.IdMal is not null).ToList();
var media = await client.GetMediaDetailsAsync(animes![0]);

var episodeNum = 1;
var episodeDuration = 1524981 / 1000;

var timeskips = await client.Aniskip.GetAsync(media!.IdMal!.Value, episodeNum, episodeDuration);

var skipType = timeskips?[0].SkipType;
var startTime = timeskips?[0].Interval.StartTime;
var endTime = timeskips?[0].Interval.EndTime;

Downloading videos

using AnimeDl;
using AnimeDl.Scrapers;

var client = new AnimeClient(AnimeSites.GogoAnime);

var animes = await client.SearchAsync("naruto");
var episodes = await client.GetEpisodesAsync(animes[0].Id);
var servers = await client.GetVideoServersAsync(episodes[0].Id);
var videos = await client.GetVideosAsync(servers[0]);

//NB: Video format must be `Container`
await client.DownloadAsync(videos[0].VideoUrl, videos[0].Headers, fileName);

//Donwloading other formats
var metadataResources = await client.GetHlsStreamMetadatasAsync(videos[0].VideoUrl, videos[0].Headers);
var stream = await metadataResources[0].Stream;

await client.DownloadTsAsync(stream, videos[0].Headers, fileName);
//Or
await client.DownloadAllTsThenMergeAsync(stream, videos[0].Headers, fileName, maxParallelDownloads: 10);
//The method above will be faster