Initial commit: XDL Twitter/X video downloader
This commit is contained in:
26
backend/app/models.py
Normal file
26
backend/app/models.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""SQLAlchemy models."""
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, Integer, String, DateTime, BigInteger, Text
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class Video(Base):
|
||||
__tablename__ = "videos"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
task_id = Column(String(64), unique=True, index=True, nullable=False)
|
||||
url = Column(String(512), nullable=False)
|
||||
title = Column(String(512), default="")
|
||||
platform = Column(String(32), default="twitter")
|
||||
thumbnail = Column(String(1024), default="")
|
||||
quality = Column(String(32), default="")
|
||||
format_id = Column(String(64), default="")
|
||||
filename = Column(String(512), default="")
|
||||
file_path = Column(String(1024), default="")
|
||||
file_size = Column(BigInteger, default=0)
|
||||
duration = Column(Integer, default=0)
|
||||
status = Column(String(16), default="pending") # pending, downloading, done, error
|
||||
error_message = Column(Text, default="")
|
||||
progress = Column(Integer, default=0) # 0-100
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
Reference in New Issue
Block a user