-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathduplicate.php
More file actions
46 lines (34 loc) · 1.16 KB
/
Copy pathduplicate.php
File metadata and controls
46 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
error_reporting(E_ERROR | E_PARSE);
require "functions.php";
$configsArray = explode("\n", file_get_contents("config.txt"));
$seen = [];
$finalOutput = [];
$dropped = 0;
foreach ($configsArray as $config) {
$config = trim($config);
if ($config === '') {
continue;
}
$fp = configFingerprint($config);
if ($fp === null) {
// keep parseable-looking unique raw lines as a fallback
$fp = 'raw:' . sha1($config);
}
if (isset($seen[$fp])) {
$dropped++;
continue;
}
$seen[$fp] = true;
$finalOutput[] = $config;
}
file_put_contents("config.txt", implode("\n", $finalOutput));
$tempConfig = hiddifyHeader("SiNAVM | MIX") . urldecode(implode("\n", $finalOutput));
$base64TempConfig = base64_encode($tempConfig);
@mkdir("subscriptions/xray/normal", 0777, true);
@mkdir("subscriptions/xray/base64", 0777, true);
file_put_contents("subscriptions/xray/normal/mix", $tempConfig);
file_put_contents("subscriptions/xray/base64/mix", $base64TempConfig);
echo "Removing Duplicates Done! Kept: " . count($finalOutput) . " Dropped: {$dropped}\n";