Skip to content

Pigamer37/animeflv-stremio-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AnimeFLV logo

Node.js and express.js based addon to add AnimeFLV functionallity to Stremio, not affiliated with AnimeFLV. (I'm new to backend so I'm using it as a learning experience).

Normal use

Install by copying stremio://pigamer37.alwaysdata.net/manifest.json on your browser or paste https://pigamer37.alwaysdata.net/manifest.json on the Stremio addons search bar πŸ” or the Add addon button

Features:

  • πŸ“Ί Catalog of currently airing anime, to keep up with what is currently being released
  • πŸ” Search the AnimeFLV database/catalog through Stremio's searchbar, or filter it by genre in the Discovery tab
  • πŸ”§ Compatible with other addons, like Cinemeta, TMDB or kitsu so you can use your preferred metadata provider (see supported ID's for technical details)
  • πŸ“ƒ See metadata extracted from AnimeFLV natively in Stremio, like synopses/overviews, genres, related media, episode lists and release dates for upcoming episodes
    • πŸ“† If you add series to your library, upcoming episodes will show up in your Stremio calendar!
  • πŸ“‘ Provides stream sources from AnimeFLV

This addon provides metadata and streaming options from AnimeFLV. It offers a catalog with airing anime on the homepage, and a searchable catalog of all AnimeFLV, even being able to filter by genre. Additionally, when you open an item on Stremio that matches some parameters set in the manifest (generated on index.js), or whenever you start watching something, the platform will call this addon. When the program can get the data for the item you are about to watch, some metadata will be provided and/or streaming options will appear as "AnimeFLV ..." (the ones marked as external open a player on your browser, working on getting more sources to be watchable directly on Stremio).

Tip

Recommendations

  1. Right now, the metadata provided by Cinemeta (the default meta and catalog addon), the TMDB meta addon or the Anime kitsu addon is much richer and works well with other addons, as they just use IMDB ID's, TMDB ID's or kitsu ID's respectively to provide and identify content. This addon should work with items provided in these catalogs, so you can get AnimeFLV's streams/sources while getting their metadata.
  2. Learning japanese? I have a Japanese subtitle addon, and there's also the Strelingo Addon, which lets you see two subtitle languages at the same time (English and Japanese, for example), and uses the former as a provider for Japanese subs.

Tips are welcome!

If you like the addon and would like to thank me monetarily, you can do so through ko-fi. Thank you! πŸ’Έ
ko-fi

Endpoints

Here's the path to call it (parameters are marked by being enclosed in {} and described below):

/{resource}/{type}/{ID}.json

Parameters

  1. resource: stream and meta are very self explanatory, and catalog exposes a list of anime.
    • When using catalog as a resource, you can also call /catalog/{type}/{ID}/search={query}.json where query is what to search for on AnimeFLV, or /catalog/{type}/{ID}/genre={query}.json where query is the genre (there's a list of genres in the manifest, and query must match one exactly) to search or filter the whole AnimeFLV database. It's defined this way to work with Stremio. Use animeflv or animeflv|genres as the ID, or use animeflv|onair (without search or genre queries) to get a list of currently airing anime.
  2. type: should not matter, but to make sure, use 'movie' or 'series' depending on what the item is
  3. ID: Except for IMDB, different seasons have different ID's. Here we have some options:
    • AnimeFLV ID: starts with "animeflv:", followed by the series AnimeFLV slug, always. This is the "native" ID type and the one the catalogs the addon offers use. You can specify an episode number if you want. Example: animeflv:kono-subarashii-sekai-ni-shukufuku-wo:2 should give results for Konosuba (Season 1 was specified with the AnimeFLV slug) Episode 2
    • IMDB ID: starts with "tt", followed by a number, always. If you are looking for a series, you can specify the season and episode numbers. Example: tt5370118:1:2 should give results for Konosuba Season 1 Episode 2
    • TMDB ID: starts with "tmdb:", followed by a number, always. You can specify a season and episode number if you want. Example: tmdb:65844:1:2 should give results for Konosuba Season 1 Episode 2
    • kitsu ID: starts with "kitsu:", followed by a number, always. You can specify an episode number if you want. Example: kitsu:10941:2 should give results for Konosuba (Season 1 was specified with the kitsu ID) Episode 2
    • AniList ID: starts with "anilist:", followed by a number, always. You can specify an episode number if you want. Example: anilist:21202:2 should give results for Konosuba (Season 1 was specified with the AniList ID) Episode 2
    • MyAnimeList ID: starts with "mal:", followed by a number, always. You can specify an episode number if you want. Example: mal:30831:2 should give results for Konosuba (Season 1 was specified with the AniList ID) Episode 2
    • aniDB ID: starts with "anidb:", followed by a number, always. You can specify an episode number if you want. Example: anidb:11261:2 should give results for Konosuba (Season 1 was specified with the AniList ID) Episode 2

Run locally

Important

0. Previous steps/requirements:

  • This project runs on Node.js, so install both Node.js and the npm (Node Package Manager)
  • You'll need to get all necessary API keys. Right now you only need to get keys for the TMDB API 1, which is free. This addon uses the AniList API and https://relations.yuna.moe/api/v2 too, but those don't need a key/authentication for publicly accessible data
  • Enter your parameters inside a .env file like this: 2
TMDB_API_READ_TOKEN = yourTMDBAPIReadToken
TMDB_API_KEY = yourTMDBAPIkey
  1. Clone the repo/dowload the code on your machine however you like, and navigate to the project's directory (where package.json resides)
  2. Run the following command to install all necessary dependencies based on package.json:
    npm install
    
  3. Run a local instance of the server

Tip

You can run a convenient instance of the project that will restart itself when you make changes to the files (after saving) using nodemon, with the preprogrammed devStart command (nodemon index.js under the hood) with:

npm run devStart
  1. Make requests to the app on localhost:3000 (or the port set in an environment variable if it exists) or by using Stremio, in which case you'll need to install the addon (just provide Stremio the manifest url: "https://localhost:3000/manifest.json", for example)

Tip

When running locally, your IP and the server's IP are the same, so you can uncomment the code on animeFLV.js that extracts StreamTape links and they should work inside of Stremio (see TO DO).

Acknowledgements:

Note

AnimeFLV logo

This application/addon uses AnimeFLV but is not endorsed, certified, or otherwise approved by AnimeFLV.

The unofficial AnimeFLV API This application/addon uses the unofficial AnimeFLV API (or its adapted code) but is not endorsed, certified, or otherwise approved by it.

AniList logo

This application/addon uses AniList and the AniList API to get metadata. It is not endorsed, certified, or otherwise approved by AniList.

The Movie DataBase logo This application/addon uses TMDB and the TMDB API but is not endorsed, certified, or otherwise approved by TMDB.

In case TMDB doesn't work, the Cinemeta Stremio Addon will be used to get the item's metadata.

TO DO:

  • Publish to Stremio Addon Catalog (not on Beam Up, because the beamup tool is not working for me)
  • Implement Stremio's skip extra argument functionality for pagination (each query outputs 24 results)
  • Research how to get the files directly to Stremio instead of having to send an external link (Streamtape streams are IP bound 😞)
    • Got YourUpload streams working inside of Stremio

Enhancements/new features

  • Support MyAnimeList, AniDB, AniList and kitsu ID's and thus the kitsu and MALSync Stremio addons via https://relations.yuna.moe/api/v2
  • Offer "On Air" catalog and searchable catalog
  • Make catalog searchable by genre. Up to 4 can be queried at once
    • Stremio doesn't reflect a multiple genre search on the UI so only one genre can be queried through the app so it doesn't appear buggy
  • Support Metadata requests
    • Get upcoming episodes with correct dates
      • Get Stremio to show UPCOMING tags on upcoming episodes and show them on the calendar (undocumented, but reverse engineered)
    • Get and display the item's related entries (prequels/sequels, spinoffs, alternative retellings...)
    • Get episode thumbnails
    • Get series backgound images
    • Get series logos
    • Get episode overviews
  • Touch up the views (the homepage, mainly)
  • Investigate Stremio API

Documentation used:

Footnotes

  1. Because of how it works, you can probably (I have not tested this) get away with not setting these keys, and you'll just won't be able to process IMDB ID (starting with "tt") or TMDB ID ("tmdb:") based items. ↩

  2. You just need to make a file inside the top level repository folder, enter the required information and rename it ".env". You don't need to install the dotenv npm package manually, the next steps will take care of project dependencies. ↩