Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

ColMarek/atsumeru-core

Repository files navigation

Atsumeru Core

npm

Get torrent feeds from SubsPlease, nyaa.si, Erai-raws or a custom source.

Anime details are from Anilist.

Usage

yarn add atsumeru-core

// const { AtsumeruCore, NyaaSource, EraiSource } = require("atsumery-core")
import { AtsumeruCore, NyaaSource, EraiSource } from "atsumeru-core";

// The second parameter, a logger, is optional
const atsumeruCore = new AtsumeruCore("./sampleDataDir", (s) => {
  console.log(s);
});

// A custom rss feed url can be passed
// new NyaaSource();
// new EraiSource();

const subsPlease = new SubsPleaseSource();

atsumeruCore
  .getFeed(subsPlease)
  .then((res) => {
    res.forEach((r) => {
      console.log(`${r.animeTitle} - ${r.episode}`);
    });
  })
  .catch((e) => {
    console.log(e.message);
  });

Custom source

Extend the AbstractSource class.

export default class CustomSource extends AbstractSource {
  constructor() {
    super("https://rss.example.com");
  }

  async getData(): Promise<TorrentData[] | null> {
    const response = await axios.get(this.url);
    const res: any = await xmlStringToJson(response.data);
    // Map res to TorrentData
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published