Рабочий пайплайн: YouTube -> транскрипция -> выжимка -> Postgres
- новый api/: /pipeline/process (yt-dlp, субтитры или Vosk, LLM/экстрактивная суммаризация), /videos, /llm; старый код перенесён в api_legacy/ - web/: Flet UI (flet 0.28.3 + flet-web, порт 8550) - Dockerfile.api: ffmpeg слоем из mwader/static-ffmpeg, pip с кэш-маунтом - requirements/pyproject: убраны moviepy, imageio-ffmpeg, битый asyncio - README с инструкцией запуска и загрузкой Vosk-модели Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
3
api_legacy/models/base.py
Normal file
3
api_legacy/models/base.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from sqlalchemy.orm import declarative_base
|
||||
|
||||
Base = declarative_base()
|
||||
14
api_legacy/models/subscription.py
Normal file
14
api_legacy/models/subscription.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from sqlalchemy import Column, String, DateTime, ForeignKey, Boolean, Text
|
||||
from api.models.base import Base
|
||||
|
||||
|
||||
class Subscription(Base):
|
||||
__tablename__ = 'subscriptions'
|
||||
uuid = Column(String, primary_key=True, index=True)
|
||||
# one subscription per user (unique)
|
||||
user_id = Column(String, ForeignKey('users.id'), nullable=False, index=True, unique=True)
|
||||
until = Column(DateTime, nullable=False)
|
||||
active = Column(Boolean, nullable=False, default=True)
|
||||
# avoid NULL: store empty string when no link provided
|
||||
subscription_link = Column(Text, nullable=False, default="")
|
||||
connect_link = Column(Text, nullable=False, default="")
|
||||
12
api_legacy/models/user.py
Normal file
12
api_legacy/models/user.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from sqlalchemy import Column, String, DateTime
|
||||
from sqlalchemy.sql import func
|
||||
from api.models.base import Base
|
||||
import uuid
|
||||
|
||||
|
||||
class User(Base):
|
||||
__tablename__ = 'users'
|
||||
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
telegram_id = Column(String, unique=True, index=True, nullable=False)
|
||||
name = Column(String, nullable=False, default="")
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
|
||||
Reference in New Issue
Block a user