Get torrent feeds from SubsPlease, nyaa.si, Erai-raws or a custom source.
Anime details are from Anilist.
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);
});
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
}
}