diff --git a/get_peertube_videos/get_peertube_videos.py b/get_peertube_videos/get_peertube_videos.py index d608fc9..2afeb1a 100644 --- a/get_peertube_videos/get_peertube_videos.py +++ b/get_peertube_videos/get_peertube_videos.py @@ -173,6 +173,8 @@ class GetPeertubeVideos: thumb_file, video_file ) + split_filename = video_file.split('.') + file_extension = split_filename[len(split_filename)-1] result = subprocess.run( [ 'ffmpeg', @@ -181,7 +183,7 @@ class GetPeertubeVideos: '-map', '1', '-map', '0', '-c', 'copy', - '-disposition:0', 'attached_pic', f"{video_file}_with_thumb" + '-disposition:0', 'attached_pic', f"{video_file}_with_thumb.{file_extension}" ], capture_output=True, check=False @@ -194,7 +196,7 @@ class GetPeertubeVideos: result.stderr ) os.remove(video_file) - os.rename(f"{video_file}_with_thumb", video_file) + os.rename(f"{video_file}_with_thumb.{file_extension}", video_file) def _write_downloaded_items(self): with open(self.config['downloaded_database'], 'w', encoding='utf-8') as db_file: