Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Based Anime Watch Order #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions DaisyX/modules/watchorder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import requests

from DaisyX.services.pyrogram import pbot
from pyrogram import filters
from bs4 import BeautifulSoup

@pbot.on_message(filters.command('watchorder'))

def watchorderx(_,message):
anime = message.text.replace(message.text.split(' ')[0], '')
res = requests.get(f'https://chiaki.site/?/tools/autocomplete_series&term={anime}').json()
data = None
id_ = res[0]['id']
res_ = requests.get(f'https://chiaki.site/?/tools/watch_order/id/{id_}').text
soup = BeautifulSoup(res_ , 'html.parser')
anime_names = soup.find_all('span' , class_='wo_title')
for x in anime_names:
if data:
data = f"{data}\n{x.text}"
else:
data = x.text
message.reply_text(f'Watchorder of {anime}: \n```{data}```')