@dlwlrma00/animefreak2

NOTE : This packages is forked from Chris Michael :) Animefreak is a custom API that provides data from the `animefreak.tv` website. You will have access to the entire catalog whether movies, series, current episodes, genres, search content, etc. with Eng


Keywords
animefreak, animefreak.tv, animefreak api, anime, anime api
License
MIT
Install
npm install @dlwlrma00/animefreak2@1.1.0

Documentation

🚩 ANIMEFREAK API (version 1.1.3 [stable])

node version npm version Maintenance License: MIT Build Status

Animefreak is a custom API that provides data from the animefreak.tv website. You will have access to the entire catalog whether movies, series, current episodes, genres, search content, etc. with English subtitles.


🎉 Updates in version v1.1.5 (stable) 🎉

  • Fix bugs on crawling Movie ID

🎉 Updates in version v1.1.3 🎉

  • Fix bugs on TV & OVA

🎉 Updates in version v1.1.0 🎉

  • Fix bugs

🎉 Updates in version v1.0.6 🎉

  • Added api.getSingleAnimeData(id)
  • Enhance crawling algo
  • Fix reponse format on api.movies() & api.latestEpisodes()

🎉 Updates in version v1.0.4 🎉

  • Technique used by the animefreak page to obtain the real src of the mp4. Therefore, most src should now work and reproduce correctly.

🚀 Custom animefreak API Link

animefreak api

🔧 Developer usage

Set up project

Before cloning the repo be sure you have installed:

  • NODE (version >= 10.16.x)
  • NPM (version >= 6.9.x)

Then:

  • Choose a folder project in your system and switch in cd [folder path]
  • Clone the repo in your folder path git clone https://github.com/ChrisMichaelPerezSantiago/animefreak.git

Installation

In order to install the project and all dependencies, enter in the project folder and run npm install


Start Local Node/Express Server

npm run start

or

npm run dev

Testing API Methods

npm run dev-api

🤝 Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

API Documentation

  const api = require('@dlwlrma00/animefreak2');

📣Read this please | To get the videos!📣

api.animeVideoHandler([id])


To get the videos (mp4) of each chapter, you only need to use the api.animeVideoHandler function that receives the id of the episode as a parameter. To verify the id of each episode, look at the episodes property:

 "episodes": [
    {
      "id": "tokyo-ghoul/episode/episode-1"
    },
    {
      "id": "tokyo-ghoul/episode/episode-2"
    },
    {
      "id": "tokyo-ghoul/episode/episode-3"
    },
    {
      "id": "tokyo-ghoul/episode/episode-4"
    },
    {
      "id": "tokyo-ghoul/episode/episode-5"
    },
    {
      "id": "tokyo-ghoul/episode/episode-6"
    },
    {
      "id": "tokyo-ghoul/episode/episode-7"
    },
    {
      "id": "tokyo-ghoul/episode/episode-8"
    },
    {
      "id": "tokyo-ghoul/episode/episode-9"
    },
    {
      "id": "tokyo-ghoul/episode/episode-10"
    },
    {
      "id": "tokyo-ghoul/episode/episode-11"
    },
    {
      "id": "tokyo-ghoul/episode/episode-12"
    }
  ]

You just have to pass the id of the episode

api.animeVideoHandler('tokyo-ghoul/episode/episode-12')
  .then(res =>{
    console.log(res)
});
// 20191209122332
// http://localhost:5000/api/v1/AnimeVideoHandler/tokyo-ghoul/episode/episode-12

{
  "video": [
    {
      "mp4": "http://st8.anime1.com/[HorribleSubs] Tokyo Ghoul - 12 [480p]_a1.mp4?st=5qJfe7rxHaGYg-8w0sJX5A&e=1575926181"
    }
  ]
}

Now you just need to use the mp4 property of each episodes id and pass it to the video element

<video width="400" controls>
  <source src="http://st8.anime1.com/[HorribleSubs] Tokyo Ghoul - 12 [480p]_a1.mp4?st=5qJfe7rxHaGYg-8w0sJX5A&e=1575926181" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

api.ongoingAnime()


// 20191209123206
// http://localhost:5000/api/v1/OngoingAnime

{
  "anime": [
    {
      "title": "Okoshiyasu, Chitose-chan",
      "img": "https://www.animefreak.tv/meta/anime/8210/okoshiyasu-chitose-chan.jpg",
      "genres": [
        "comedy",
        "slice-of-life"
      ],
      "synopsis": "Chitose-chan is a penguin who lives in Kyoto. Getting in touch with people and getting fed delicious food as she curiously walks around Kyoto streets is her favourite thing to do. The story features popular places in Kyoto like Kiyomizu Temple, Ginkaku Temple, and Gion from the Penguin's point of view. This is a short story about a penguin that is nostalgic and warm, curing and relieving the heart.\n\n(Source: MAL News)",
      "rating": "Ongoing",
      "status": "TV Series",
      "type": "Oct 07, 2018",
      "firstAired": "undefined",
      "score": 10,
      "totalEps": 9,
      "episodes": [
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-1"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-2"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-3"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-4"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-5"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-6"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-7"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-8"
        },
        {
          "id": "okoshiyasu-chitose-chan/episode/episode-9"
        }
      ]
    },
  ]
}

api.popular()


// 20191209123320
// http://localhost:5000/api/v1/Popular

{
  "anime": [
    {
      "title": "Tensei shitara Slime Datta Ken",
      "img": "https://www.animefreak.tv/meta/anime/8179/tensei-shitara-slime-datta-ken.jpg",
      "genres": [
        "fantasy"
      ],
      "synopsis": "\"Rimuru Tempest\" is the new name of a slime in a fantasy world taken by a former 37-year-old human Satou Mikami after he is killed by a passing robber. Broken free from ordinary, stale past life, his fresh adventure in a fantasy world as a slime monster with unique abilities begins.",
      "rating": "Teen +13",
      "status": "Ongoing",
      "type": "TV Series",
      "firstAired": "Oct 01, 2018",
      "score": 9.23,
      "totalEps": 25,
      "episodes": [
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-1"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-2"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-3"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-4"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-5"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-6"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-7"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-8"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-9"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-10"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-11"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-12"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-13"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-14"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-15"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-16"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-17"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-18"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-19"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-20"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-21"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-22"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-23"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-24"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-25"
        }
      ]
    },
  ]
}

api.latestEpisodes([page])


Page From Limit
1 N/A
// 20191209123421
// http://localhost:5000/api/v1/LatestEpisodes/1

{
  "result": [
    {
      "data": {
        "id": "abciee-shuugyou-nikki/episode/episode-2",
        "title": "Abciee Shuugyou Nikki",
        "episode": 2,
        "episodePublished": "11 hours ago",
        "img": "https://www.animefreak.tv/meta/anime/8643/abciee-shuugyou-nikki.jpg",
        "type": "TV Series",
        "firstAired": "Jan 13, 2021",
        "score": 0,
        "totalEps": 2
      },
      "video": {
        "mp4": "https://st11.anime1.com/[SubsPlease] Abciee Shuugyou Nikki - 02 (720p) [4574ACB6]_af.mp4?st=f0liQ6NdVgvFStN50viB5A&e=1610628314"
      }
    },
  ]
}

api.movies([page])


Page From Limit
1 N/A
// 20191209123713
// http://localhost:5000/api/v1/Movies/1

{
  "movies": [
    {
      "data": {
        "title": "Kimi no Na wa.",
        "img": "https://www.animefreak.tv/meta/anime/5959/kimi-no-na-wa.jpg",
        "genres": [
          "school",
          "drama",
          "romance",
          "supernatural"
        ],
        "synopsis": "Description: The story is set one month after a comet has fallen for the first time in a thousand years in Japan. Mitsuha, a high school girl living in the countryside, wants to live in the city because she is tired of life in the country. Then, there's Taki. He's a high school student living in Tokyo with his friends while working as a part-timer at an Italian restaurant. He also has a strong interest in fine arts involving architecture. One day, Mitsuha dreams of herself as a young man. On the other hand, Taki also has a dream where he is a female student attending high school in the countryside. What's the secret behind their dreams?",
        "rating": "Teen +13",
        "status": "Finished",
        "type": "Movie",
        "firstAired": "Sep 08, 2016",
        "score": 9.3
      },
      "video": {
        "mp4": "https://st6.anime1.com/Kimi no Na wa.mp4?st=xO4lO73hTcm8ngD126NF3Q&e=1610628107"
      }
    },
  ]
}

api.ova([page])


Page From Limit
1 N/A
// 20191209123814
// http://localhost:5000/api/v1/Ova/1

{
  "ova": [
    {
      "title": "Baki (2018)",
      "img": "https://www.animefreak.tv/meta/anime/5765/baki-2018.jpg",
      "genres": [
        "action",
        "shounen",
        "martial-arts"
      ],
      "synopsis": "Description: The protagonist, Baki Hanma, trains with an intense focus to become strong enough to surpass his father, Yujiro Hanma, the strongest fighter in the world. Five of the world's most violent and brutal death row inmates are gathering to face Baki. Their objective is to taste defeat -- their unmatched strength and skill have led them to grow bored of life itself, and they now seek out Baki in the hopes that he can overwhelm and utterly crush them. In this crisis, other underground martial art warriors gather to fight by Baki's side: Kaoru Hanayama, Gouki Shibukawa, Retsu Kaioh, and Doppo Orochi. An epic showdown between violent death row inmates and Baki and his friends begins!",
      "rating": "Everyone",
      "status": "Ongoing",
      "type": "OVA Series",
      "firstAired": "Jul 05, 2018",
      "score": 9.28,
      "totalEps": 26,
      "episodes": [
        {
          "id": "baki-2018/episode/episode-1"
        },
        {
          "id": "baki-2018/episode/episode-2"
        },
        {
          "id": "baki-2018/episode/episode-3"
        },
        {
          "id": "baki-2018/episode/episode-4"
        },
        {
          "id": "baki-2018/episode/episode-5"
        },
        {
          "id": "baki-2018/episode/episode-6"
        },
        {
          "id": "baki-2018/episode/episode-7"
        },
        {
          "id": "baki-2018/episode/episode-8"
        },
        {
          "id": "baki-2018/episode/episode-9"
        },
        {
          "id": "baki-2018/episode/episode-10"
        },
        {
          "id": "baki-2018/episode/episode-11"
        },
        {
          "id": "baki-2018/episode/episode-12"
        },
        {
          "id": "baki-2018/episode/episode-13"
        },
        {
          "id": "baki-2018/episode/episode-14"
        },
        {
          "id": "baki-2018/episode/episode-15"
        },
        {
          "id": "baki-2018/episode/episode-16"
        },
        {
          "id": "baki-2018/episode/episode-17"
        },
        {
          "id": "baki-2018/episode/episode-18"
        },
        {
          "id": "baki-2018/episode/episode-19"
        },
        {
          "id": "baki-2018/episode/episode-20"
        },
        {
          "id": "baki-2018/episode/episode-21"
        },
        {
          "id": "baki-2018/episode/episode-22"
        },
        {
          "id": "baki-2018/episode/episode-23"
        },
        {
          "id": "baki-2018/episode/episode-24"
        },
        {
          "id": "baki-2018/episode/episode-25"
        },
        {
          "id": "baki-2018/episode/episode-26"
        }
      ]
    },
  ]
}

api.tv([page])


Page From Limit
1 N/A
// 20191209124004
// http://localhost:5000/api/v1/TV/1

{
  "tv": [
    {
      "title": "Tensei shitara Slime Datta Ken",
      "img": "https://www.animefreak.tv/meta/anime/8179/tensei-shitara-slime-datta-ken.jpg",
      "genres": [
        "fantasy"
      ],
      "synopsis": "Description: \"Rimuru Tempest\" is the new name of a slime in a fantasy world taken by a former 37-year-old human Satou Mikami after he is killed by a passing robber. Broken free from ordinary, stale past life, his fresh adventure in a fantasy world as a slime monster with unique abilities begins.",
      "rating": "Teen +13",
      "status": "Ongoing",
      "type": "TV Series",
      "firstAired": "Oct 01, 2018",
      "score": 9.23,
      "totalEps": 25,
      "episodes": [
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-1"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-2"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-3"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-4"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-5"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-6"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-7"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-8"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-9"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-10"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-11"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-12"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-13"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-14"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-15"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-16"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-17"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-18"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-19"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-20"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-21"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-22"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-23"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-24"
        },
        {
          "id": "tensei-shitara-slime-datta-ken/episode/episode-25"
        }
      ]
    },
  ]
}

api.search([query])


// 20191209124113
// http://localhost:5000/api/v1/search/tokyo

{
  "search": [
    {
      "title": "Tokyo Ghoul",
      "img": "https://www.animefreak.tv/meta/anime/7301/tokyo-ghoul.jpg",
      "rating": "Teen +17",
      "status": "Finished",
      "type": "TV Series",
      "firstAired": "Jul 03, 2014",
      "score": 9.23,
      "totalEps": 12,
      "episodes": [
        {
          "id": "tokyo-ghoul/episode/episode-1"
        },
        {
          "id": "tokyo-ghoul/episode/episode-2"
        },
        {
          "id": "tokyo-ghoul/episode/episode-3"
        },
        {
          "id": "tokyo-ghoul/episode/episode-4"
        },
        {
          "id": "tokyo-ghoul/episode/episode-5"
        },
        {
          "id": "tokyo-ghoul/episode/episode-6"
        },
        {
          "id": "tokyo-ghoul/episode/episode-7"
        },
        {
          "id": "tokyo-ghoul/episode/episode-8"
        },
        {
          "id": "tokyo-ghoul/episode/episode-9"
        },
        {
          "id": "tokyo-ghoul/episode/episode-10"
        },
        {
          "id": "tokyo-ghoul/episode/episode-11"
        },
        {
          "id": "tokyo-ghoul/episode/episode-12"
        }
      ]
    },
  ]
}

Updated By - Rex Tan 🦄🦄🦄🦄🦄

api.getSingleAnimeData([id])


// http://localhost:5000/api/v1/Anime/one-punch-man

{
  "result": {
    "episodes": [
      {
        "id": "abciee-shuugyou-nikki/episode/episode-1"
      },
      {
        "id": "abciee-shuugyou-nikki/episode/episode-2"
      }
    ],
    "totalEps": 2,
    "score": 0,
    "firstAired": "Jan 13, 2021",
    "type": "TV Series",
    "status": "Ongoing",
    "rating": "Everyone",
    "genres": [
      "comedy"
    ],
    "synopsis": "ABCiee is a bit klutzy and ditsy, but he's full of spunk and he starts his dream job at a TV station! This is a work comedy filled with all kinds of hijinks! \"I never knew it was so hard working at a TV station, ciee!\" Despite having to face the unknown rules of the TV business, unique coworkers, and guest stars who have very particular quirks, ABCiee takes them head on with his positivity. Work, love, family, whatever goes!! Please watch over ABCiee as he takes on the TV business.",
    "img": "https://www.animefreak.tv/meta/anime/8643/abciee-shuugyou-nikki.jpg",
    "title": "Abciee Shuugyou Nikki"
  }
}

api.genres([genre] , [page])


Genres Page Info
Genres
action
adventure , animation
cartoon , comedy
demons , drama
ecchi , english
fantasy
game
harem , historical , horror
kids
magic , martial-arts , mecha , military , music , mystery
parody , police , psychological
romance
samurai , school , sci-fi , seinen , shoujo , shoujo-ai , shounen , shounen-ai , slice-of-life , space , sports , super-power , supernatural
thriller
vampire
Page From Limit
1 N/A
// 20191209124512
// http://localhost:5000/api/v1/Genres/action/1

{
  "anime": [
    {
      "title": "Tate no Yuusha no Nariagari",
      "img": "https://www.animefreak.tv/meta/anime/8257/tate-no-yuusha-no-nariagari.jpg",
      "genres": [
        "drama",
        "comedy",
        "seinen",
        "fantasy",
        "action",
        "adventure",
        "romance"
      ],
      "synopsis": "Description: Stories of old tell of four otherworldly heroes—wielding the sword, spear, bow, and shield—who defended the land from wave after wave of calamity. With the fate of the world in balance, the kingdom of Melromarc summons these legendary figures; in modern-day Japan, the call is answered, and the unwitting heroes are transported to this fantasy universe.\n\nThrust into Melromarc and given the title of \"Shield Hero,\" otaku Naofumi Iwatani is labeled the weakest due to his lack of offensive capability and apparent inexperience. When the heroes part ways to start their journeys, he only has one willing companion: the beautiful princess Malty Melromarc. However, she soon betrays him, steals all his money, and accuses him of taking advantage of her.\n\nFor his alleged crimes, Naofumi is branded a criminal and made outcast of society. With hatred filling his heart, he sets out alone, vowing vengeance against those who wronged him.",
      "rating": "Teen +13",
      "status": "Ongoing",
      "type": "TV Series",
      "firstAired": "Dec 31, 2018",
      "score": 9.22,
      "totalEps": 25,
      "episodes": [
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-1"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-2"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-3"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-4"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-5"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-6"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-7"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-8"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-9"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-10"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-11"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-12"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-13"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-14"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-15"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-16"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-17"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-18"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-19"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-20"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-21"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-22"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-23"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-24"
        },
        {
          "id": "tate-no-yuusha-no-nariagari/episode/episode-25"
        }
      ]
    },
  ]
}

👥 Credits


💢 Troubleshootings

This is just a personal project created for study / demonstration purpose and to simplify my working life, it may or may not be a good fit for your project(s).


❤️ Show your support

Please this repository if you like it or this project helped you!
Feel free to open issues or submit pull-requests to help me improving my work.


🤖 Author

Chris Michael

You can follow me on github · twitter


Copyright © 2019 Chris Michael.