mirror of
https://github.com/tropicoo/yt-dlp-bot.git
synced 2024-11-10 09:03:02 +08:00
Handle telegram video and animation uploads
This commit is contained in:
parent
415a2025be
commit
f7c71e2e27
1 changed files with 6 additions and 4 deletions
|
@ -38,6 +38,7 @@ class UploadTask(AbstractTask):
|
|||
)
|
||||
message = await self._upload_video_file()
|
||||
if message:
|
||||
self._log.info(message)
|
||||
await self._save_cache(message)
|
||||
except Exception:
|
||||
self._log.exception('Something went wrong during video file upload')
|
||||
|
@ -72,11 +73,12 @@ class UploadTask(AbstractTask):
|
|||
|
||||
async def _save_cache(self, message: Message) -> None:
|
||||
self._log.debug('Saving telegram file cache - %s', message)
|
||||
video = message.video or message.animation
|
||||
cache = CacheSchema(
|
||||
cache_id=message.video.file_id,
|
||||
cache_unique_id=message.video.file_unique_id,
|
||||
file_size=message.video.file_size,
|
||||
date_timestamp=message.video.date,
|
||||
cache_id=video.file_id,
|
||||
cache_unique_id=video.file_unique_id,
|
||||
file_size=video.file_size,
|
||||
date_timestamp=video.date,
|
||||
)
|
||||
|
||||
async for db in get_db():
|
||||
|
|
Loading…
Reference in a new issue