Skip to content

Latest commit

 

History

History
565 lines (507 loc) · 18.1 KB

zoro.md

File metadata and controls

565 lines (507 loc) · 18.1 KB

Zoro

const zoro = new ANIME.Zoro();

Methods

search

Note: This method is a subclass of the BaseParser class. meaning it is available across most categories.

Parameters

Parameter Type Description
query string query to search for. (In this case, We're searching for Spy x Family)
zoro.search("spy x family").then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 3,
  results: [
    {
      id: 'spy-x-family-17977',
      title: 'Spy x Family',                           url: 'https://aniwatch.to/spy-x-family-17977?ref=search',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/88/bd/88bd17534dc4884f23027035d23d74e5/88bd17534dc4884f23027035d23d74e5.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'Spy x Family',
      nsfw: false,
      sub: 12,
      dub: 12,
      episodes: 12
    },
    {
      id: 'spy-x-family-part-2-18152',                title: 'Spy x Family, Part 2',
      url: 'https://aniwatch.to/spy-x-family-part-2-18152?ref=search',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/53/d2/53d283223e562b22a14023d8dc1e934d/53d283223e562b22a14023d8dc1e934d.jpg',
      type: 'TV',
      duration: '23m',                                 japaneseTitle: 'Spy x Family Part 2',
      nsfw: false,
      sub: 13,
      dub: 13,
      episodes: 13
    },
    {...}
    ...
  ]
}

fetchAnimeInfo

Parameters

Parameter Type Description
id string takes anime id as a parameter. (anime id can be found in the anime search results or anime info object)
zoro.fetchAnimeInfo("overlord-iv-18075").then(data => {
  console.log(data);
})

returns a promise which resolves into an anime info object (including the episodes and optionally MAL and Anilist ID ). (Promise<IAnimeInfo>)
output:

{
  id: 'overlord-iv-18075',
  title: 'Overlord IV',
  malID: 48895,
  alID: 133844,
  image: 'https://img.zorores.com/_r/300x400/100/ef/1d/ef1d1028cf6c177587805651b78282a6/ef1d1028cf6c177587805651b78282a6.jpg',
  description: 'Fourth season of Overlord',
  type: 'TV',
  url: 'https://zoro.to/overlord-iv-18075',
  totalEpisodes: 3,
  episodes: [
    {
      id: 'overlord-iv-18075$episode$92599',
      number: 1,
      title: 'Sorcerous Nation of Ainz Ooal Gown',
      isFiller: false,
      url: 'https://zoro.to/watch/overlord-iv-18075?ep=92599'
    },
    {
      id: 'overlord-iv-18075$episode$92769',
      number: 2,
      title: 'Re-Estize Kingdom',
      isFiller: false,
      url: 'https://zoro.to/watch/overlord-iv-18075?ep=92769'
    },
  ]
}

fetchEpisodeSources

Parameters

Parameter Type Description
episodeId string takes episode id as a parameter. (episode id can be found in the anime info object)

In this example, we're getting the sources for the first episode of Overlord IV.

zoro.fetchEpisodeSources("overlord-iv-18075$episode$92599").then(data => {
  console.log(data);
})

returns a promise which resolves into an array of episode sources. (Promise<ISource>)
output:

{
  headers: { Referer: 'https://rapid-cloud.ru/embed-6/hMN2fYuGi1E2?z=' },
  intro: {
    start: 0,
    end: 100
  }
  sources: [
    {
      url: 'https://c-an-ca3.betterstream.cc:2223/v2-hls-playback/584bca0a36f1cfe0153bc80d79d62f9171c193441d424b2804000153234bb744f6eb7197bd91842408660ab8516c67f5ad565acd0d18e9b565c6abf2b5c0e55879ca70bef239d78711bf0845ddb6005baf5a5e957a17efc7bb6f1b4f3a87fb3723cfc56a1330960ec99ce338d86d49211bc6e8c2830d50842034ed99335c654529d2b0ca1e19045357a6b01876ae12ea313473387cb8c5272b37c7ba8a2bbc3b185c0cc72517ee0237ce673914ac3e54/index-f1-v1-a1.m3u8',
      quality: '1080p',
      isM3U8: true
    },
    {
      url: 'https://c-an-ca3.betterstream.cc:2223/v2-hls-playback/584bca0a36f1cfe0153bc80d79d62f9171c193441d424b2804000153234bb744f6eb7197bd91842408660ab8516c67f5ad565acd0d18e9b565c6abf2b5c0e55879ca70bef239d78711bf0845ddb6005baf5a5e957a17efc7bb6f1b4f3a87fb3723cfc56a1330960ec99ce338d86d49211bc6e8c2830d50842034ed99335c654529d2b0ca1e19045357a6b01876ae12ea313473387cb8c5272b37c7ba8a2bbc3b185c0cc72517ee0237ce673914ac3e54/index-f2-v1-a1.m3u8',
      quality: '720p',
      isM3U8: true
    },
    {
      url: 'https://c-an-ca3.betterstream.cc:2223/v2-hls-playback/584bca0a36f1cfe0153bc80d79d62f9171c193441d424b2804000153234bb744f6eb7197bd91842408660ab8516c67f5ad565acd0d18e9b565c6abf2b5c0e55879ca70bef239d78711bf0845ddb6005baf5a5e957a17efc7bb6f1b4f3a87fb3723cfc56a1330960ec99ce338d86d49211bc6e8c2830d50842034ed99335c654529d2b0ca1e19045357a6b01876ae12ea313473387cb8c5272b37c7ba8a2bbc3b185c0cc72517ee0237ce673914ac3e54/index-f3-v1-a1.m3u8',
      quality: '360p',
      isM3U8: true
    }
  ],
  subtitles: [
    {
      url: 'https://cc.zorores.com/5f/b4/5fb4481163961694ef0dc661a1bf51d7/eng-2.vtt',
      lang: 'English'
    },
    {
      url: 'https://cc.zorores.com/5f/b4/5fb4481163961694ef0dc661a1bf51d7/por-3.vtt',
      lang: 'Portuguese - Portuguese(Brazil)'
    },
    {
      url: 'https://cc.zorores.com/5f/b4/5fb4481163961694ef0dc661a1bf51d7/rus-5.vtt',
      lang: 'Russian'
    },
    {
      url: 'https://cc.zorores.com/5f/b4/5fb4481163961694ef0dc661a1bf51d7/spa-4.vtt',
      lang: 'Spanish - Spanish(Latin_America)'
    },
    {
      url: 'https://preview.zorores.com/53/531eb74affebbec2613a6ba0883754f3/thumbnails/sprite.vtt',
      lang: 'Default (maybe)'
    }
  ]
}

fetchTopAiring

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchTopAiring().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{                                                        currentPage: 1,
  hasNextPage: true,
  totalPages: 9,
  results: [
    {
      id: 'one-piece-100',
      title: 'One Piece',
      url: 'https://aniwatch.to/one-piece-100',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/54/90/5490cb32786d4f7fef0f40d7266df532/5490cb32786d4f7fef0f40d7266df532.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'One Piece',
      nsfw: false,
      sub: 1089,
      dub: 1048,
      episodes: 0
    },
    {
      id: 'attack-on-titan-the-final-season-part-3-1839',
      title: 'Attack on Titan: The Final Season Part 3',
      url: 'https://aniwatch.to/attack-on-titan-the-final-season-part-3-18329',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/54/d3/54d3f59bcc7caf1539c701eb0a064ec9/54d3f59bcc7caf1539c701eb0a064ec9.png',
      type: 'TV',
      duration: '61m',
      japaneseTitle: 'Shingeki no Kyojin: The Final Season - Kanketsu-hen',
      nsfw: true,
      sub: 2,
      dub: 2,
      episodes: 0
    },
    {...}
    ...
  ]
}

fetchMostPopular

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchMostPopular().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{                                                        currentPage: 1,
  hasNextPage: true,
  totalPages: 50,
  results: [
    {
      id: 'one-piece-100',
      title: 'One Piece',
      url: 'https://aniwatch.to/one-piece-100',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/54/90/5490cb32786d4f7fef0f40d7266df532/5490cb32786d4f7fef0f40d7266df532.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'One Piece',
      nsfw: false,
      sub: 1089,
      dub: 1048,
      episodes: 0
    },
    {
      id: 'naruto-shippuden-355',
      title: 'Naruto: Shippuden',
      url: 'https://aniwatch.to/naruto-shippuden-355',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/9c/bc/9cbcf87f54194742e7686119089478f8/9cbcf87f54194742e7686119089478f8.jpg',
      type: 'TV',
      duration: '23m',
      japaneseTitle: 'Naruto: Shippuuden',
      nsfw: false,
      sub: 500,
      dub: 500,
      episodes: 500
    },
    {...}
    ...
  ]
}

fetchMostFavorite

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchMostFavorite().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 166,
  results: [
    {
      id: 'one-piece-100',
      title: 'One Piece',
      url: 'https://aniwatch.to/one-piece-100',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/54/90/5490cb32786d4f7fef0f40d7266df532/5490cb32786d4f7fef0f40d7266df532.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'One Piece',
      nsfw: false,
      sub: 1089,
      dub: 1048,
      episodes: 0
    },
    {
      id: 'chainsaw-man-17406',
      title: 'Chainsaw Man',
      url: 'https://aniwatch.to/chainsaw-man-17406',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/b3/da/b3da1326e07269ddd8d73475c5dabf2c/b3da1326e07269ddd8d73475c5dabf2c.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'Chainsaw Man',
      nsfw: true,
      sub: 12,
      dub: 12,
      episodes: 12
    },
    {...}
    ...
  ]
}

fetchLatestCompleted

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchLatestCompleted().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 162,
  results: [
    {
      id: 'love-flops-18173',
      title: 'Love Flops',
      url: 'https://aniwatch.to/love-flops-18173',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/8c/08/8c08b4fd12e27ac4e1dc4e72af8e9568/8c08b4fd12e27ac4e1dc4e72af8e9568.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'Renai Flops',
      nsfw: true,
      sub: 12,
      dub: 7,
      episodes: 12
    },
    {
      id: 'nurarihyon-no-mago-gekitou-dai-futsal-taikai-nuragumi-w-cup-5796',
      title: 'Nurarihyon no Mago: Gekitou Dai Futsal Taikai! Nuragumi W Cup!!',
      url: 'https://aniwatch.to/nurarihyon-no-mago-gekitou-dai-futsal-taikai-nuragumi-w-cup-5796',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/bd/72/bd722d8e64272fb484a7f48e75eb9716/bd722d8e64272fb484a7f48e75eb9716.jpg',
      type: 'Special',
      duration: '13m',
      japaneseTitle: 'Nurarihyon no Mago: Gekitou Dai Futsal Taikai! Nuragumi W Cup!!',
      nsfw: false,
      sub: 1,
      dub: 0,
      episodes: 0
    },
    {...}
    ...
  ]
}

fetchRecentlyUpdated

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchRecentlyUpdated().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 166,
  results: [
    {
      id: 'pokemon-horizons-the-series-18397',
      title: 'Pokémon Horizons: The Series',
      url: 'https://aniwatch.to/pokemon-horizons-the-series-18397',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/4b/14/4b145f650126e400b69e783e3d6cdd2a/4b145f650126e400b69e783e3d6cdd2a.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'Pokemon (2023)',
      nsfw: false,
      sub: 35,
      dub: 0,
      episodes: 0
    },
    {
      id: 'bang-brave-bang-bravern-18733',
      title: 'Bang Brave Bang Bravern',
      url: 'https://aniwatch.to/bang-brave-bang-bravern-18733',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/ad/1d/ad1d79d4c929278f23b91f2e787e5a50/ad1d79d4c929278f23b91f2e787e5a50.jpg',
      type: 'TV',
      duration: '25m',
      japaneseTitle: 'Yuuki Bakuhatsu Bang Bravern',
      nsfw: false,
      sub: 1,
      dub: 0,
      episodes: 0
    },
    {...}
    ...
  ]
}

fetchRecentlyAdded

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchRecentlyAdded().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 162,
  results: [
    {
      id: 'love-flops-18173',
      title: 'Love Flops',
      url: 'https://aniwatch.to/love-flops-18173',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/8c/08/8c08b4fd12e27ac4e1dc4e72af8e9568/8c08b4fd12e27ac4e1dc4e72af8e9568.jpg',
      type: 'TV',
      duration: '24m',
      japaneseTitle: 'Renai Flops',
      nsfw: true,
      sub: 12,
      dub: 7,
      episodes: 12
    },
    {
      id: 'nurarihyon-no-mago-gekitou-dai-futsal-taikai-nuragumi-w-cup-5796',
      title: 'Nurarihyon no Mago: Gekitou Dai Futsal Taikai! Nuragumi W Cup!!',
      url: 'https://aniwatch.to/nurarihyon-no-mago-gekitou-dai-futsal-taikai-nuragumi-w-cup-5796',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/bd/72/bd722d8e64272fb484a7f48e75eb9716/bd722d8e64272fb484a7f48e75eb9716.jpg',
      type: 'Special',
      duration: '13m',
      japaneseTitle: 'Nurarihyon no Mago: Gekitou Dai Futsal Taikai! Nuragumi W Cup!!',
      nsfw: false,
      sub: 1,
      dub: 0,
      episodes: 0
    },
    {...}
    ...
  ]
}

fetchTopUpcoming

Parameters

Parameter Type Description
page (optional) number page number (default 1)
zoro.fetchTopUpcoming().then(data => {
  console.log(data);
})

returns a promise which resolves into an array of anime. (Promise<ISearch<IAnimeResult[]>>)
output:

{
  currentPage: 1,
  hasNextPage: true,
  totalPages: 6,
  results: [
    {
      id: 'bucchigiri-18781',
      title: 'Bucchigiri?!',
      url: 'https://aniwatch.to/bucchigiri-18781',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/72/bf/72bfde46c44a200ff11d82049005d3c8/72bfde46c44a200ff11d82049005d3c8.jpg',
      type: 'TV',
      duration: 'Jan 13, 2024',
      japaneseTitle: 'Bucchigiri?!',
      nsfw: false,
      sub: 0,
      dub: 0,
      episodes: 0
    },
    {
      id: 'dead-dead-demons-dededede-destruction-18925',
      title: 'Dead Dead Demons Dededede Destruction',
      url: 'https://aniwatch.to/dead-dead-demons-dededede-destruction-18925',
      image: 'https://img.flawlessfiles.com/_r/300x400/100/8d/11/8d112670f41684d97015004293a087dc/8d112670f41684d97015004293a087dc.jpg',
      type: 'Movie',
      duration: 'Mar 22, 2024',
      japaneseTitle: 'Dead Dead Demons Dededede Destruction',
      nsfw: false,
      sub: 0,
      dub: 0,
      episodes: 0
    },
    {...}
    ...
  ]
}

Make sure to check the headers property of the returned object. It contains the referer header, which might be needed to bypass the 403 error and allow you to stream the video without any issues.

(back to anime providers list)