limit filesystem scan to mp4 files only

This commit is contained in:
simon 2022-02-10 18:48:35 +07:00
parent 077692987b
commit 0e56efc428
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -46,8 +46,9 @@ class FilesystemScanner:
all_downloaded = [] all_downloaded = []
for channel_name in all_channels: for channel_name in all_channels:
channel_path = os.path.join(self.VIDEOS, channel_name) channel_path = os.path.join(self.VIDEOS, channel_name)
videos = os.listdir(channel_path) channel_files = os.listdir(channel_path)
all_videos = ignore_filelist(videos) 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: for video in all_videos:
youtube_id = video[9:20] youtube_id = video[9:20]
all_downloaded.append((channel_name, video, youtube_id)) all_downloaded.append((channel_name, video, youtube_id))