Skip to content

Instantly share code, notes, and snippets.

@autch
Created October 10, 2021 10:08
Show Gist options
  • Save autch/fdd486dbcbb0c2d2ee78eba0b8e225f7 to your computer and use it in GitHub Desktop.
Save autch/fdd486dbcbb0c2d2ee78eba0b8e225f7 to your computer and use it in GitHub Desktop.
既存の VRChat カメラ画像のフォルダを open beta (as of Oct 10, 2021) のカメラ画像のフォルダ分けに合わせる
import os
import shutil
import glob
import re
GLOB_PATTERN = 'VRChat_*_*.png'
TIME_PATTERN = r'(?P<ym>\d{4}-\d{2})-\d{2}_\d{2}-\d{2}-\d{2}.\d{3}'
re_time = re.compile(TIME_PATTERN)
for f in glob.iglob(GLOB_PATTERN):
m = re_time.search(f)
if m:
ym = m.group('ym')
os.makedirs(ym, exist_ok=True)
shutil.move(f, ym + '/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment