From 78dc7f4810359188969fbf7421effbbd7583c597 Mon Sep 17 00:00:00 2001
From: itexpert228 <67105314+fdaser1337@users.noreply.github.com>
Date: Fri, 10 Apr 2026 10:47:56 +0300
Subject: [PATCH] pisi i sisi
---
games/nude.py | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
main.py | 3 ++
2 files changed, 87 insertions(+)
create mode 100644 games/nude.py
diff --git a/games/nude.py b/games/nude.py
new file mode 100644
index 0000000..5dfe692
--- /dev/null
+++ b/games/nude.py
@@ -0,0 +1,84 @@
+import aiohttp
+from aiogram import types
+import config
+import logging
+import random
+import json
+
+logger = logging.getLogger(__name__)
+
+CAPTIONS = [
+ "Hot stuff 🔥",
+ "Sexy content 😏"
+]
+
+async def handle_nude_cmd(message: types.Message):
+ args = message.text.split(maxsplit=1)
+
+ if len(args) > 1 and args[1].strip() == "-h":
+ help_msg = (
+ "🔥 Справка по команде /nude:\n\n"
+ "Получает случайные изображения взрослых женщин из открытых источников.\n"
+ "• Использует Pornhub API для поиска контента\n"
+ "• По умолчанию ищет популярные видео с высоким рейтингом\n"
+ "• Отправляет превью видео как изображение\n\n"
+ "Пример: /nude\n"
+ "По умолчанию: Популярный контент для взрослых"
+ )
+ await message.reply(help_msg, parse_mode="HTML")
+ return
+
+ # Используем Pornhub API для поиска видео
+ url = "https://www.pornhub.com/webmasters/search"
+
+ params = {
+ "category": "straight",
+ "ordering": "mostviewed",
+ "period": "week",
+ "thumbsize": "medium"
+ }
+
+ headers = {
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
+ }
+
+ try:
+ async with aiohttp.ClientSession() as session:
+ async with session.get(url, params=params, headers=headers) as resp:
+ if resp.status != 200:
+ logger.error(f"Pornhub API Error: {resp.status}")
+ await message.reply("Не удалось получить контент от сервера :(")
+ return
+
+ # Pornhub API возвращает HTML, нужно парсить
+ text = await resp.text()
+
+ # Ищем URL превью в HTML
+ import re
+ thumb_pattern = r'
]+src="([^"]+)"[^>]+class="thumb"'
+ matches = re.findall(thumb_pattern, text)
+
+ if not matches:
+ await message.reply("Не удалось найти контент :(")
+ return
+
+ # Берем случайное превью
+ thumb_url = random.choice(matches)
+
+ # Убедимся что URL полный
+ if not thumb_url.startswith('http'):
+ thumb_url = f"https://thumb.pornhub.com{thumb_url}"
+
+ caption = random.choice(CAPTIONS)
+
+ # Отправляем как фото
+ try:
+ input_file = types.URLInputFile(thumb_url)
+ await message.answer_photo(photo=input_file, caption=caption)
+ except Exception as e:
+ logger.error(f"Error sending photo: {e}")
+ await message.answer(f"{caption}\n{thumb_url}")
+
+ except Exception as e:
+ logger.exception("Error in nude command")
+ await message.reply("Произошла ошибка при обращении к API :(")
diff --git a/main.py b/main.py
index 7ee496c..7891bde 100644
--- a/main.py
+++ b/main.py
@@ -23,6 +23,7 @@ from AI.talk_handler import handle_talk, generate_autoreply, push_message
from games.casino import play_casino
from games.fortune import generate_fortune
from games.uwu import handle_uwu_cmd
+from games.nude import handle_nude_cmd
from games.betting import (
clear_user_sport_context,
debug_sports,
@@ -1417,6 +1418,7 @@ def main():
dp.message.register(handle_sports_debug_cmd, Command("sports_debug"))
dp.message.register(handle_gen_mem, Command("gen_mem"))
dp.message.register(handle_uwu_cmd, Command("uwu"))
+ dp.message.register(handle_nude_cmd, Command("nude"))
dp.message.register(handle_keywords, F.text)
async def on_startup(bot: Bot):
@@ -1446,6 +1448,7 @@ def main():
BotCommand(command="sports_debug", description="диагностика API матчей"),
BotCommand(command="svodka", description="СВО: итоги"),
BotCommand(command="uwu", description="Случайная картинка с e621"),
+ BotCommand(command="nude", description="Голые женщины из открытых источников"),
]
scopes = (
BotCommandScopeDefault(),