Add to downloaded files

This commit is contained in:
Antonio J. Delgado 2024-12-28 20:15:05 +02:00
parent 15bf7472b6
commit 318ea7fd2d

View file

@ -153,6 +153,8 @@ class GetPeertubeVideos:
with open(full_thumb_file_name, mode='wb') as thumb_file: with open(full_thumb_file_name, mode='wb') as thumb_file:
thumb_file.write(thumb_bytes) thumb_file.write(thumb_bytes)
self._add_thumbnail_to_video(full_file_name, full_thumb_file_name) self._add_thumbnail_to_video(full_file_name, full_thumb_file_name)
self.downloaded_items.append(item['id'])
self._write_downloaded_items()
else: else:
self._log.debug( self._log.debug(
"Item already downloaded, skipping." "Item already downloaded, skipping."
@ -195,6 +197,7 @@ class GetPeertubeVideos:
result.stdout, result.stdout,
result.stderr result.stderr
) )
return None
os.remove(video_file) os.remove(video_file)
os.rename(f"{video_file}_with_thumb.{file_extension}", video_file) os.rename(f"{video_file}_with_thumb.{file_extension}", video_file)