Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

Commit d8734d8

Browse files
Initial Release v0.0.1
1 parent 72962db commit d8734d8

File tree

5 files changed

+697
-0
lines changed

5 files changed

+697
-0
lines changed

README.md

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
<h1 style="text-align: center;">AniKimi API</h1>
2+
<div align="center">A Simple, LightWeight, Statically-Typed Python3 API wrapper for GogoAnime</div>
3+
<div align="center">The v2 of gogoanimeapi (depreciated)</div>
4+
<div align="center">Made with JavaScript and Python3</div>
5+
6+
7+
###
8+
9+
<div align="center">
10+
<img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white">
11+
<img src="https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=darkgreen">
12+
<img src="https://img.shields.io/badge/JavaScript-323330?style=for-the-badge&logo=javascript&logoColor=F7DF1E">
13+
<img src="https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white">
14+
<img src="https://img.shields.io/badge/PyCharm-000000.svg?&style=for-the-badge&logo=PyCharm&logoColor=white">
15+
</div>
16+
17+
###
18+
19+
### Features of AniKimi
20+
* Custom url changing option.
21+
* Statically-Typed, No more annoying JSON responses.
22+
* Autocomplete supported by most IDE's.
23+
* Complete solution.
24+
* Faster response.
25+
* Less CPU consumption.
26+
27+
### Installing
28+
Using Pypi
29+
30+
```$ pip3 install anikimiapi```
31+
32+
### Getting Started
33+
#### Pre-Requisites
34+
* #### Getting Required Tokens
35+
* Visit the GogoAnime Website.
36+
* Login or SignUp using ur email or google.
37+
* Add an extension to your browser named [Get cookies.txt](https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid?hl=en).
38+
* Now in the GogoAnime Website, right click and select "Get cookies.txt"
39+
* A `.txt` file will be downloaded.
40+
* In the `.txt` file, find the name "gogoanime" and "auth".
41+
* Copy the respective tokens on the right side of the above names.
42+
* Keep it safely, since its your private credentials.
43+
44+
### Diving into the API
45+
###
46+
#### Authorize the API
47+
To Authorize the API, use AniKimi class. You can also import it from other files. It also supports cross imports. But all API request should be made using this class only.
48+
```python3
49+
from anikimiapi import AniKimi
50+
51+
# Initialize AniKimi class
52+
anime = AniKimi(
53+
gogoanime_token="the saved gogoanime token",
54+
auth_token="the saved auth token",
55+
host="https://gogoanime.pe/"
56+
)
57+
```
58+
###
59+
>**Note:** If GogoAnime changes their domain, use the 'host' parameter. Otherwise, leave it blank. This parameter was optional and defaults to https://gogoanime.pe/
60+
###
61+
#### Getting Anime search results
62+
You can search anime by using `search_anime` method, It returns the search results as `ResultObject` which contains two arguments, the `title` and `animeid`.
63+
```python3
64+
from anikimiapi import AniKimi
65+
66+
anime = AniKimi(
67+
gogoanime_token="the saved gogoanime token",
68+
auth_token="the saved auth token"
69+
)
70+
71+
# Search Anime
72+
results = anime.search_anime(query="tokikaku kawaii")
73+
74+
for i in results:
75+
print(i.title) # (or)
76+
print(i.animeid)
77+
```
78+
79+
###
80+
>**Note:** If no search results found, the API will raise `NoSearchResultsError` error. Make sure to handle it.
81+
###
82+
#### Getting details of a specific Anime
83+
You can the basic information about a specific anime with `animeid` using `get_details` method. It will return anime details as `MediaInfoObject`.
84+
85+
The `MediaInfoObject` contains the following arguments,
86+
* title
87+
* other_names
88+
* season
89+
* year
90+
* status
91+
* genres
92+
* episodes
93+
* image_url
94+
* summary
95+
```python
96+
from anikimiapi import AniKimi
97+
98+
anime = AniKimi(
99+
gogoanime_token="the saved gogoanime token",
100+
auth_token="the saved auth token"
101+
)
102+
103+
# Get anime Details
104+
details = anime.get_details(animeid="clannad-dub")
105+
print(details.title)
106+
print(details.genres) # And many more...
107+
```
108+
109+
###
110+
>**Note:** If an Invalid `animeid` is given, the API will raise `InvalidAnimeIdError`. Make sure to handle it.
111+
###
112+
#### Getting the Anime Links
113+
You can simply get the streamable and downloadable links of a specific episode of an Anime by its `animeid` and `episode_num` using `get_episode_link` method. It will return anime links in `MediaLinksObject`.
114+
115+
The `MediaLinksObject` returns the links, if available. Otherwise, it will return `None`. The `MediaLinksObject` has the following arguments,
116+
* link_hdp
117+
* link_360p
118+
* link_480p
119+
* link_720p
120+
* link_1080p
121+
* link_streamsb
122+
* link_xstreamcdn
123+
* link_streamtape
124+
* link_mixdrop
125+
* link_mp4upload
126+
* link_doodstream
127+
```python3
128+
from anikimiapi import AniKimi
129+
130+
anime = AniKimi(
131+
gogoanime_token="the saved gogoanime token",
132+
auth_token="the saved auth token"
133+
)
134+
135+
# Getting Anime Links
136+
anime_link = anime.get_episode_link(animeid="clannad-dub", episode_num=3)
137+
138+
print(anime_link.link_hdp)
139+
print(anime_link.link_720p)
140+
print(anime_link.link_streamsb) # And many more...
141+
```
142+
###
143+
>**Note:** If invalid `animeid` or `episode_num` is passed, the API will return `InvalidAnimeIdError`. Make sure to handle it.
144+
>
145+
> If the given `gogoanime_token` and `auth_token` are invalid, the API will raise `InvalidTokenError`. So, be careful of that.
146+
###
147+
#### Getting a List of anime by Genre
148+
You can also get the List of anime by their genres using `get_by_genres` method. This method will return results as a List of `ResultObject`.
149+
150+
Currently, the following genres are supported,
151+
* action
152+
* adventure
153+
* cars
154+
* comedy
155+
* dementia
156+
* demons
157+
* drama
158+
* dub
159+
* ecchi
160+
* fantasy
161+
* game
162+
* harem
163+
* hentai - Temporarily Unavailable
164+
* historical
165+
* horror
166+
* josei
167+
* kids
168+
* magic
169+
* martial-arts
170+
* mecha
171+
* military
172+
* music
173+
* mystery
174+
* parody
175+
* police
176+
* psychological
177+
* romance
178+
* samurai
179+
* school
180+
* sci-fi
181+
* seinen
182+
* shoujo
183+
* shoujo-ai
184+
* shounen-ai
185+
* shounen
186+
* slice-of-life
187+
* space
188+
* sports
189+
* super-power
190+
* supernatural
191+
* thriller
192+
* vampire
193+
* yaoi
194+
* yuri
195+
```python
196+
from anikimiapi import AniKimi
197+
198+
anime = AniKimi(
199+
gogoanime_token="the saved gogoanime token",
200+
auth_token="the saved auth token"
201+
)
202+
203+
# Getting anime list by genres
204+
gen = anime.get_by_genres(genre_name="romance", page=1)
205+
206+
for result in gen:
207+
print(result.title)
208+
print(result.animeid)
209+
```
210+
###
211+
>**Note:** If invalid `genre_name` or `page` is passed, the API will raise `InvalidGenreNameError`. Make sure to handle it.
212+
###
213+
#### Getting List of Airing Anime (v2 API New Feature)
214+
You can get a List of currently Airing Anime using `get_airing_anime` method. This method will return results as a List of `ResultObject`.
215+
```python
216+
from anikimiapi import AniKimi
217+
218+
anime = AniKimi(
219+
gogoanime_token="the saved gogoanime token",
220+
auth_token="the saved auth token"
221+
)
222+
223+
# Getting Airing Anime List
224+
airing = anime.get_airing_anime(count=15)
225+
for i in airing:
226+
print(i.title)
227+
print(i.animeid)
228+
```
229+
###
230+
>**Note:** If the value of count exceeds 20, The API will raise `AiringIndexError`. So, pass a value less than or equal to 20.
231+
232+
# Copyrights ©2021 BaraniARR;
233+
### Licensed under GNU GPLv3 Licnense;

anikimiapi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from anikimiapi.anikimi import AniKimi

0 commit comments

Comments
 (0)