"Активный 90" это не "активь 90 дней", а "90 дней проверяй, не снесли ли темы, где ты писал". Именно это будет проверять скрипт, в определённые часы будет отправлять вам уведомление: cookies = { 'xf_user': 'F12', 'xf_tfa_trust': 'Приложение', 'xf_session': 'Файлы cookie', 'lolz.live_xf_tc_lmad': 'https://lolz.live' } headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36', } tg_bot_token = '123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' tg_chat_id = 987654321 # Без кавычек hours = '16,19,21' # Больше ничего редактировать не нужно from requests import Session from bs4 import BeautifulSoup from Crypto.Cipher import AES from re import compile, MULTILINE from datetime import datetime, timezone from collections import Counter from apscheduler.schedulers.asyncio import AsyncIOScheduler from aiogram import Bot, Dispatcher, types from aiogram.filters import Command from asyncio import get_event_loop, run s = Session() s.headers.update(headers) s.cookies.update(cookies) scheduler = AsyncIOScheduler(timezone="Europe/Moscow", job_defaults={'misfire_grace_time': None}) bot = Bot(token=tg_bot_token) dp = Dispatcher() @dp.message(Command('start')) async def start(message: types.Message): if not message.from_user.id == tg_chat_id: return await message.answer(':)', reply_markup=types.ReplyKeyboardMarkup(keyboard=[[types.KeyboardButton(text='Проверить сейчас')]], resize_keyboard=True)) @dp.message(lambda message: message.text == 'Проверить сейчас') async def check_now(message: types.Message): if not message.from_user.id == tg_chat_id: return await bot.send_chat_action(message.chat.id, action="typing") await trophy_notifier() async def trophy_notifier(): today = datetime.now(timezone.utc).date() # Устанавливаем куки dfuid (или как его там) soup = BeautifulSoup(s.get('https://lolz.live').text, 'html.parser') if soup.find("noscript") and soup.find("noscript").text == 'Oops! Please enable JavaScript and Cookies in your browser.': match = compile(r'document\.cookie\s*=\s*"([^="]+)="\s*\+\s*toHex\(slowAES\.decrypt\(toNumbers\(\"([0-9a-f]{32})\"\)', MULTILINE).search(soup.find_all('script')[1].string) value = AES.new(bytearray.fromhex("e9df592a0909bfa5fcff1ce7958e598b"), AES.MODE_CBC, bytearray.fromhex("5d10aa76f4aed1bdf3dbb302e8863d52")).decrypt(bytearray.fromhex(match.group(2))).hex() s.cookies.set(name=match.group(1), value=value) s.get('https://lolz.live') # Нет, это не ошибка. Почему-то нужно делать два запроса, чтобы всё работало. soup = BeautifulSoup(s.get('https://lolz.live/account/personal-details').text, 'html.parser') profile = soup.find_all('p', class_='explain')[2].find('a')['href'] notification = '⏳Активный 90: ' try: notification += BeautifulSoup(s.get(profile + 'trophies').text, 'html.parser').find(id='trophy-132').find('div', class_='count').text + '/90' except: notification += 'СЕГОДНЯ НЕ ВЫПОЛНЕН' posts = BeautifulSoup(s.get(f'https://lolz.live/search/search?users={soup.find(id="ctrl_username")["value"]}&content=post').text, 'html.parser').find_all('li', class_='searchResult post primaryContent') posts = list(filter(lambda post: post.find('abbr', class_="DateTime") and datetime.fromtimestamp(int(post.find('abbr', class_="DateTime")['data-time']), tz=timezone.utc).date() == today, posts)) notification += '\n\nСообщений: ' + (str(len(posts)) if len(posts) < 20 else '> 20') likes = BeautifulSoup(s.get(profile + 'likes').text, 'html.parser').find('div', class_='likesList').find_all('div', class_='likeContainer') + BeautifulSoup(s.get(profile + 'likes?content_type=post_comment').text, 'html.parser').find('div', class_='likesList').find_all('div', class_='likeContainer') likes = list(filter(lambda like: like.find('abbr', class_="DateTime") and datetime.fromtimestamp(int(like.find('abbr', class_="DateTime")['data-time']), tz=timezone.utc).date() == today, likes)) notification += '\n\nСимпатий: ' + (str(len(likes)) if len(likes) < 20 else '> 20') forums = [like.find_all('a')[4].text for like in likes] notification += '\n' + '\n'.join([f'{section}: {count}' for section, count in Counter(forums).items()]) await bot.send_message(tg_chat_id, notification) async def main(): scheduler = AsyncIOScheduler(timezone="Europe/Moscow", job_defaults={'misfire_grace_time': None}) scheduler.add_job(trophy_notifier, 'cron', hour='16,18,16,20', minute='0') scheduler.start() try: await dp.start_polling(bot) finally: await bot.session.close() scheduler.shutdown() run(main()) Python cookies = { 'xf_user': 'F12', 'xf_tfa_trust': 'Приложение', 'xf_session': 'Файлы cookie', 'lolz.live_xf_tc_lmad': 'https://lolz.live' } headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36', } tg_bot_token = '123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' tg_chat_id = 987654321 # Без кавычек hours = '16,19,21' # Больше ничего редактировать не нужно from requests import Session from bs4 import BeautifulSoup from Crypto.Cipher import AES from re import compile, MULTILINE from datetime import datetime, timezone from collections import Counter from apscheduler.schedulers.asyncio import AsyncIOScheduler from aiogram import Bot, Dispatcher, types from aiogram.filters import Command from asyncio import get_event_loop, run s = Session() s.headers.update(headers) s.cookies.update(cookies) scheduler = AsyncIOScheduler(timezone="Europe/Moscow", job_defaults={'misfire_grace_time': None}) bot = Bot(token=tg_bot_token) dp = Dispatcher() @dp.message(Command('start')) async def start(message: types.Message): if not message.from_user.id == tg_chat_id: return await message.answer(':)', reply_markup=types.ReplyKeyboardMarkup(keyboard=[[types.KeyboardButton(text='Проверить сейчас')]], resize_keyboard=True)) @dp.message(lambda message: message.text == 'Проверить сейчас') async def check_now(message: types.Message): if not message.from_user.id == tg_chat_id: return await bot.send_chat_action(message.chat.id, action="typing") await trophy_notifier() async def trophy_notifier(): today = datetime.now(timezone.utc).date() # Устанавливаем куки dfuid (или как его там) soup = BeautifulSoup(s.get('https://lolz.live').text, 'html.parser') if soup.find("noscript") and soup.find("noscript").text == 'Oops! Please enable JavaScript and Cookies in your browser.': match = compile(r'document\.cookie\s*=\s*"([^="]+)="\s*\+\s*toHex\(slowAES\.decrypt\(toNumbers\(\"([0-9a-f]{32})\"\)', MULTILINE).search(soup.find_all('script')[1].string) value = AES.new(bytearray.fromhex("e9df592a0909bfa5fcff1ce7958e598b"), AES.MODE_CBC, bytearray.fromhex("5d10aa76f4aed1bdf3dbb302e8863d52")).decrypt(bytearray.fromhex(match.group(2))).hex() s.cookies.set(name=match.group(1), value=value) s.get('https://lolz.live') # Нет, это не ошибка. Почему-то нужно делать два запроса, чтобы всё работало. soup = BeautifulSoup(s.get('https://lolz.live/account/personal-details').text, 'html.parser') profile = soup.find_all('p', class_='explain')[2].find('a')['href'] notification = '⏳Активный 90: ' try: notification += BeautifulSoup(s.get(profile + 'trophies').text, 'html.parser').find(id='trophy-132').find('div', class_='count').text + '/90' except: notification += 'СЕГОДНЯ НЕ ВЫПОЛНЕН' posts = BeautifulSoup(s.get(f'https://lolz.live/search/search?users={soup.find(id="ctrl_username")["value"]}&content=post').text, 'html.parser').find_all('li', class_='searchResult post primaryContent') posts = list(filter(lambda post: post.find('abbr', class_="DateTime") and datetime.fromtimestamp(int(post.find('abbr', class_="DateTime")['data-time']), tz=timezone.utc).date() == today, posts)) notification += '\n\nСообщений: ' + (str(len(posts)) if len(posts) < 20 else '> 20') likes = BeautifulSoup(s.get(profile + 'likes').text, 'html.parser').find('div', class_='likesList').find_all('div', class_='likeContainer') + BeautifulSoup(s.get(profile + 'likes?content_type=post_comment').text, 'html.parser').find('div', class_='likesList').find_all('div', class_='likeContainer') likes = list(filter(lambda like: like.find('abbr', class_="DateTime") and datetime.fromtimestamp(int(like.find('abbr', class_="DateTime")['data-time']), tz=timezone.utc).date() == today, likes)) notification += '\n\nСимпатий: ' + (str(len(likes)) if len(likes) < 20 else '> 20') forums = [like.find_all('a')[4].text for like in likes] notification += '\n' + '\n'.join([f'{section}: {count}' for section, count in Counter(forums).items()]) await bot.send_message(tg_chat_id, notification) async def main(): scheduler = AsyncIOScheduler(timezone="Europe/Moscow", job_defaults={'misfire_grace_time': None}) scheduler.add_job(trophy_notifier, 'cron', hour='16,18,16,20', minute='0') scheduler.start() try: await dp.start_polling(bot) finally: await bot.session.close() scheduler.shutdown() run(main()) Заполняем конфигДля получения cookie сайта lolz.live, нажимаем F12 -> Приложение (Application) -> Файлы cookie -> https://lolz.live Ищем здесь по названию те, что нужны для скрипта и вставляем в конфиг значение. Остальные не трогаем. Далее заполняем токен бота ТГ и ваш ID (узнать можно в боте https://t.me/myidbot) hours - это часы через запятую, когда нужно отправлять уведомления.
Пытался пытался заработать трофей, но счетчик кривовато работает, надо прям сильно активить, забил А так на этом нелегком пути все инструменты полезны
вот это мне очень нужно, потому что на 22 дне я уже с ума схожу, и по кд начинаю заходить, чтоб посмотреть - сбилось или нет
чтобы не мониторить снесли или нет можно просто снять вучаева с тематов, тогда половина тем висеть будет дальше
Вообще ничем не чекаю. Если не засчитало, значит посчитало нужным не давать мне его - значит в другой раз будет лучше.