Facebook
From VBorokhov, 5 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 243
  1. from os import walk, stat
  2. from shutil import copyfile
  3. import imghdr
  4.  
  5. source_path = r'C:\Users\[UserName]\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets'
  6. destination_path = r'C:\Users\[UserName]\Pictures\wallpapers'
  7.  
  8. for _, _, files in walk(source_path):
  9.     for file in files:
  10.         source = f'{source_path}\{file}'
  11.         dest = f'{destination_path}\{file}.jpg'
  12.  
  13.         if imghdr.what(source) == 'jpeg':
  14.             file_stat = stat(source)
  15.             if file_stat.st_size > 200_000:
  16.                 copyfile(source, dest)