Skip to content
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
25 changes: 10 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

async def feeds():
async with bot:
url = 'https://subsplease.org/api/?f=latest&tz=Canada/central'
while True:

url = 'https://subsplease.org/api/?f=latest&tz=Canada/central'
Comment on lines +32 to -34
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function feeds refactored with the following changes:

res = get(url).json()

k = None
Expand All @@ -40,32 +40,27 @@ async def feeds():


anime_name = res[kek[0]]['show']
ep = res[kek[0]]['episode']
last = db['latest'] or ""

if last != anime_name:



lnk = res[kek[0]]['downloads']

last = db['latest'] or ""

if last != anime_name:
ep = res[kek[0]]['episode']





lnk = res[kek[0]]['downloads']

for x in lnk:
quality = x['res']
links = x['magnet']


data = f"{quality}: ```{links}```\n\n"

if k:
k = f"{k}\n{data}"

else:
k = data
data = f"{quality}: ```{links}```\n\n"

k = f"{k}\n{data}" if k else data
db['latest'] = anime_name
await bot.send_message(int(CHAT_ID) , f"**{anime_name}** **Ep**: {ep}:\n\n{k}" , parse_mode="markdown")
print(db)
Expand Down