49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
#!/bin/env python3
|
|
|
|
from bs4 import BeautifulSoup
|
|
import notify2
|
|
import requests
|
|
import time
|
|
import os
|
|
import sys
|
|
|
|
link = 'https://jkanime.net/'
|
|
anime = ''
|
|
notify2.init('A-notifier')
|
|
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:
|
|
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! :3",
|
|
icon
|
|
)
|
|
n.show()
|
|
break
|
|
else:
|
|
print('not yet :c')
|
|
time.sleep(300)
|
|
|