-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathanime_world.py
135 lines (126 loc) · 4.59 KB
/
anime_world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (C) 2020-2021 by DevsExpo@Github, < https://github.com/DevsExpo >.
#
# This file is part of < https://github.com/DevsExpo/FridayUserBot > project,
# and is released under the "GNU v3.0 License Agreement".
# Please see < https://github.com/DevsExpo/blob/master/LICENSE >
#
# All rights reserved.
from anime_downloader.sites import get_anime_class
from main_startup.core.decorators import friday_on_cmd
from main_startup.helper_func.basic_helpers import edit_or_reply, get_text
from mal import Anime, AnimeSearch, Manga, MangaSearch
@friday_on_cmd(
["anime", "animes"],
is_official=False,
cmd_help={
"help": "Automatically Gets Streaming Link Of The Anime. Get Site names list from Here : https://devsexpoanime.netlify.app",
"example": "{ch}anime (anime name:site name)",
},
)
async def anime(client, message):
pablo = await edit_or_reply(message, "`Searching For Anime.....`")
anime = get_text(message)
if not anime:
await pablo.edit("`Please Give Me A Valid Input. You Can Check Help Menu To Know More!`")
return
lmao = anime.split(":", 1)
try:
site = lmao[1]
except BaseException:
site = "animeonline360"
await pablo.edit(
"Please Provide Site Name From Next Time. Now Continuing With Default Site."
)
lol = lmao[0]
why = site.lower()
Twist = get_anime_class(why)
try:
search = Twist.search(lol)
except BaseException:
await ommhg.edit("Please Try Different Site. Given Site Is Down.")
title1 = search[0].title
url1 = search[0].url
title2 = search[1].title
url2 = search[1].url
title3 = search[2].title
url3 = search[2].url
title4 = search[3].title
url4 = search[3].url
title5 = search[4].title
url5 = search[4].url
NopZ = f"<b><u>Anime Search Complete</b></u> \n\n\n<b>Title</b>:- <code>{title1}</code> \n<b>URL Link</b>:- {url1}\n\n<b>Title</b>:- <code>{title2}</code> \n<b>URL Link</b>:- {url2}\n\n<b>Title</b>:- <code>{title3}</code>\n<b>URL Link</b>:- {url3}\n\n<b>Title</b>:- <code>{title4}</code> \n<b>URL Link</b>:- {url4}\n\n<b>Title</b>:- <code>{title5}</code> \n<b>URL Link</b>:- {url5}\n\n<b>Links Gathered By Friday\nGet Your Own Friday From @FRIDAYCHAT</b>"
await pablo.edit(NopZ, parse_mode="html")
@friday_on_cmd(
["animeinfo", "ainfo"],
is_official=False,
cmd_help={
"help": "Gives Anime Information!",
"example": "{ch}ainfo (anime name)",
},
)
async def animeinfo(client, message):
pablo = await edit_or_reply(message, "`Searching For Anime.....`")
anime = get_text(message)
if not anime:
await pablo.edit("`Please Give Me A Valid Input. You Can Check Help Menu To Know More!`")
return
search = AnimeSearch(anime)
ID = search.results[0].mal_id
anime = Anime(ID)
jp = "".join(x + "; " for x in anime.genres)
link = anime.image_url
if link is None:
link = search.results[0].image_url
By = f"""<u><b>Anime Information Gathered</b></u>
<b>tlele:- {search.results[0].title}
Mal ID:- {search.results[0].mal_id}
Url:- {search.results[0].url}
Type:- {search.results[0].type}
Episodes:- {search.results[0].episodes}
Score:- {search.results[0].score}
Synopsis:- {search.results[0].synopsis}
Status:- {anime.status}
Genres:- {jp}
Duration:- {anime.duration}
Popularity:- {anime.popularity}
Rank:- {anime.rank}
favorites:- {anime.favorites}</b>
"""
await pablo.edit(By, parse_mode="html")
@friday_on_cmd(
["manga", "mangainfo"],
is_official=False,
cmd_help={
"help": "Gives manga Information!",
"example": "{ch}manga (manga name)",
},
)
async def manga(client, message):
pablo = await edit_or_reply(message, "`Searching For Manga.....`")
anime = get_text(message)
if not anime:
await pablo.edit("`Please Give Me A Valid Input. You Can Check Help Menu To Know More!`")
return
search = MangaSearch(anime)
ID = search.results[0].mal_id
manga = Manga(ID)
jp = "".join(x + "; " for x in manga.genres)
link = manga.image_url
if link is None:
link = search.results[0].image_url
By = f"""<u><b>manga Information Gathered</b></u>
<b>tlele:- {search.results[0].title}
Mal ID:- {search.results[0].mal_id}
Url:- {search.results[0].url}
Type:- {search.results[0].type}
volumes:- {search.results[0].volumes}
Score:- {search.results[0].score}
Synopsis:- {search.results[0].synopsis}
Status:- {manga.status}
Genres:- {jp}
Chapters:- {manga.chapters}
Popularity:- {manga.popularity}
Rank:- {manga.rank}
favorites:- {manga.favorites}</b>
"""
await pablo.edit(By, parse_mode="html")