Skip to content

Instantly share code, notes, and snippets.

@zoidyzoidzoid
Created May 1, 2015 10:29
Show Gist options
  • Save zoidyzoidzoid/cf7428e5f32ff8ebbe4b to your computer and use it in GitHub Desktop.
Save zoidyzoidzoid/cf7428e5f32ff8ebbe4b to your computer and use it in GitHub Desktop.
Refresh CS:GO Comp thumbnails and overviews
# Only runs on Python 3.5
import os
import shutil
legit_maps = ['de_cache', 'de_cbble', 'de_dust2', 'de_inferno', 'de_mirage', 'de_nuke', 'de_overpass', 'de_season', 'de_train']
maps_path = 'H:/Program Files (x86)/Steam/SteamApps/common/Counter-Strike Global Offensive/csgo/maps'
overviews_path = 'H:/Program Files (x86)/Steam/SteamApps/common/Counter-Strike Global Offensive/csgo/resource/overviews'
dropbox_path = 'C:/Users/example/Dropbox/csgo'
original_overviews_paths = list(os.scandir(overviews_path))
original_thumbnails_paths = list(os.scandir(maps_path))
for d in original_overviews_paths:
if any(d.name.startswith(map) for map in legit_maps):
print('> Processing {0}'.format(d.name))
shutil.copy(os.path.join(overviews_path, d.name), os.path.join(dropbox_path, d.name))
for d in original_thumbnails_paths:
if not d.name.endswith('.jpg'):
continue
if any(d.name.startswith(map) for map in legit_maps):
print('> Processing {0}'.format(d.name))
shutil.copy(os.path.join(maps_path, d.name), os.path.join(dropbox_path, d.name))
while not input('Done: [y/N)').lower().startswith('y'):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment