From c622f941d7a6c8b7c085d4ea698e73affb84fb6b Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Wed, 8 Jun 2022 11:44:49 +0200 Subject: [PATCH] tiktok bug fix --- archivers/tiktok_archiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/archivers/tiktok_archiver.py b/archivers/tiktok_archiver.py index 0cc8221..8100bb1 100644 --- a/archivers/tiktok_archiver.py +++ b/archivers/tiktok_archiver.py @@ -53,10 +53,11 @@ class TiktokArchiver(Archiver): except FileNotFoundError: logger.info(f'tmp file not found thus not deleted {filename}') cdn_url = self.storage.get_cdn_url(key) + timestamp = info.create.isoformat() if hasattr(info, "create") else None return ArchiveResult(status=status, cdn_url=cdn_url, thumbnail=key_thumb, - thumbnail_index=thumb_index, duration=info.duration, title=info.caption, timestamp=info.create.isoformat(), - hash=hash, screenshot=screenshot) + thumbnail_index=thumb_index, duration=getattr(info, "duration", 0), title=getattr(info, "caption", ""), + timestamp=timestamp, hash=hash, screenshot=screenshot) except tiktok_downloader.Except.InvalidUrl as e: status = 'Invalid URL'