from os import walk, stat from shutil import copyfile import imghdr source_path = r'C:\Users\[UserName]\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets' destination_path = r'C:\Users\[UserName]\Pictures\wallpapers' for _, _, files in walk(source_path): for file in files: source = f'{source_path}\{file}' dest = f'{destination_path}\{file}.jpg' if imghdr.what(source) == 'jpeg': file_stat = stat(source) if file_stat.st_size > 200_000: copyfile(source, dest)