From 8242e2d7ac99698002c55c8cddf699c218462e91 Mon Sep 17 00:00:00 2001 From: siengrain Date: Thu, 17 Feb 2022 20:59:18 +0000 Subject: [PATCH] :D removed some stuff --- main.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/main.py b/main.py index 108584d..4a29d0e 100644 --- a/main.py +++ b/main.py @@ -1,42 +1,48 @@ +#!/bin/env python3 + from bs4 import BeautifulSoup import notify2 import requests -from requests import get import time -import webbrowser +import os +import sys link = 'https://jkanime.net/' anime = '' notify2.init('A-notifier') -ep = '' -def linkObtainer(anime): - lonk = anime.replace(' ', '-') - lonk = lonk.replace('(', '') - lonk = lonk.replace(')', '') - lonk = lonk.lower() - return lonk +icon = os.path.join(sys.path[0]) +icon = icon +'/icon/sup.ico' + def isItUp(anime): on = 0 webp = requests.get('https://jkanime.net/') soup = BeautifulSoup(webp.text, 'html.parser') - + ani_list = [] + date = [] + pos = -1 recent_ani = soup.find_all('div', class_ = 'anime__sidebar__comment__item__text') for div in recent_ani: - if div.h5.text == anime: + ani_list.append(div.h5.text) + date.append(div.span.text) + for x in ani_list: + if x == anime: + pos = ani_list.index(x) + if pos >= 0: + if date[pos] == """ Hoy + """: on = 1 return on - while True: online = isItUp(anime) if online == 1: n = notify2.Notification("Hiii" , - anime + " is up on JKanime", - "/home/siengrain/Stuff/aFlvNot/icon/sup.ico" # Icon name + anime + " is up! :3", + icon ) n.show() - link = link + linkObtainer(anime)+'/'+ep+'/' - webbrowser.open(link) break else: + print('not yet :c') time.sleep(300) +