Created
October 10, 2021 10:08
-
-
Save autch/fdd486dbcbb0c2d2ee78eba0b8e225f7 to your computer and use it in GitHub Desktop.
既存の VRChat カメラ画像のフォルダを open beta (as of Oct 10, 2021) のカメラ画像のフォルダ分けに合わせる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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