|
发表于 2021-2-9 14:00:17
|
显示全部楼层
@Xiaobuer 命令行版
<?php
function usage() {
echo "Usage: ".basename($_SERVER["PHP_SELF"])." <Thunder link>\n";
echo "Example: ".basename($_SERVER["PHP_SELF"])." thunder://QUFodHRwczovL2Jicy5sdW9ib3RvdS5vcmcvdGhyZWFkLTE2NTE2LTEtMS5odG1sWlo=";
}
if (!(isset($argv[1]{10}))) {
echo "Error: require a thunder link.\n";
usage();
return 1;
} elseif (!((substr($argv[1], 0, 10)) == "thunder://")) {
echo "Error: This link is not a thunder link.\n";
usage();
return 1;
}
$base64 = str_replace('thunder://','',$argv[1]);
if (base64_encode(base64_decode($base64)) !== $base64) {
echo "Error: This link is not a thunder link.\n";
usage();
return 1;
}
$link = base64_decode($base64);
$link = substr($link, 2);
$link = substr($link, 0, -2);
echo $link;
?> |
|