From 0e56efc428e3783433071e3b33217f89b09b6966 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 10 Feb 2022 18:48:35 +0700 Subject: [PATCH] limit filesystem scan to mp4 files only --- tubearchivist/home/src/index/filesystem.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tubearchivist/home/src/index/filesystem.py b/tubearchivist/home/src/index/filesystem.py index 5a33501..0354e83 100644 --- a/tubearchivist/home/src/index/filesystem.py +++ b/tubearchivist/home/src/index/filesystem.py @@ -46,8 +46,9 @@ class FilesystemScanner: all_downloaded = [] for channel_name in all_channels: channel_path = os.path.join(self.VIDEOS, channel_name) - videos = os.listdir(channel_path) - all_videos = ignore_filelist(videos) + channel_files = os.listdir(channel_path) + channel_files_clean = ignore_filelist(channel_files) + all_videos = [i for i in channel_files_clean if i.endswith(".mp4")] for video in all_videos: youtube_id = video[9:20] all_downloaded.append((channel_name, video, youtube_id))