<?php

$data = scandir('.');

foreach ($data as $item) {
	if (substr($item, -3) !== '.7z') continue;
	$fixed = urldecode(substr($item, 0, -3));
	$pos = strpos($fixed, '(');
	if ($pos !== false) $fixed = trim(substr($fixed, 0, $pos));
	var_dump([$item => $fixed]);
	print("\n");

	rename($item, "$fixed.7z");
}

