Skip to content

claude ebanutiy#1

Open
lifeaborted wants to merge 13 commits into
mainfrom
on-znaet
Open

claude ebanutiy#1
lifeaborted wants to merge 13 commits into
mainfrom
on-znaet

Conversation

@lifeaborted

Copy link
Copy Markdown
Owner

мама я сияю

Comment thread bot.py Outdated
)

# Проверка токена
BOT_TOKEN = "8253639704:AAGZyIusjDMMKfNvDl3eEjSLGhzyynp-Xu0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

токен нужно скрыть (

Comment thread .env
@@ -0,0 +1,2 @@
BOT_TOKEN=7958803085:AAGojohIvDSA8HjrkQvQiNIgRzjAwwSRtUE

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

теперь в другом файле светится) лучше env не пушить, все оборачивать в переменные

Comment thread bot.py

# Проверка на TikTok ссылку
if 'tiktok.com' not in url.lower():
await update.message.reply_text(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

не сильно силен в асинхронщине в питоне, но такое ощущение что плодить множество await методов не нужно.

Comment thread database.py
async def get_total_videos():
"""Получение общего количества видео"""
async with aiosqlite.connect(DATABASE_NAME) as db:
async with db.execute('SELECT COUNT(*) FROM videos') as cursor:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

если видосов много будет? тут хотелось бы индекс впихнуть

Comment thread bot.py Outdated

# Если файл не найден, скачиваем заново
else:
await status_message.edit_text('⚠️ Файл не найден в кэше. Скачиваю заново...')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

не вижу где объявлен status_message

Comment thread bot.py
logging.info(f"Видео отправлено из кэша (file_id) пользователю {user.id}")
return
except Exception as e:
logging.warning(f"Не удалось отправить через file_id: {e}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

если он выйдет за таймаут он пользователю ничего не покажет

Comment thread downloader.py Outdated

# Папка для постоянного хранения файлов

DOWNLOAD_DIR = 'downloads'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

тоже нужно сделать энвом

Comment thread docker-compose.yml
env_file:
- .env
environment:
- TZ=Europe/Moscow

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

не очень понял зачем тут это, если переопределение для бдшки - ок. просто у тебя в бд UTC, а тут почему-то мск

@apartapatia

Copy link
Copy Markdown
Collaborator

mama ya pishu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants