feat: add geolocation to download logs (country, city via ip-api.com)
This commit is contained in:
@@ -42,6 +42,9 @@ class DownloadLog(Base):
|
||||
user_agent = Column(Text, default="")
|
||||
browser = Column(String(64), default="") # Chrome / Firefox / Safari / Edge / …
|
||||
device = Column(String(32), default="") # desktop / mobile / tablet / bot
|
||||
country_code = Column(String(8), default="") # e.g. CN
|
||||
country = Column(String(128), default="") # e.g. China
|
||||
city = Column(String(128), default="") # e.g. Shanghai
|
||||
downloaded_at = Column(DateTime, default=datetime.utcnow, index=True)
|
||||
|
||||
video = relationship("Video", back_populates="logs")
|
||||
|
||||
Reference in New Issue
Block a user