Closed satyamtg closed 4 years ago
I don't really like moving it all to that condition as this will get complicated if we introduce other weird scenarios like this.
I'd prefer that we leave that loop alone and at the end of that function we clear files out. I suggest we loop on videos folder items and compare with what's left in
videos
. This way, whatever new filter we add, it will be included.FYI, once we move to the pylibzim, this will be rendered useless as we'd be adding videos to the ZIM file on the fly and not creating them on filesystem and then adding it all via zimwriterfs.
@rgaudin have implemented a function to clean unused videos at the end from videos_dir
mislead you with my example. renamed fname
to path
as it better reflects the actual variable type.
Related to #76 . This ensures that the video files that are downloaded but no longer exist on YouTube are removed.