View difference between Paste ID: JXPDgQTM and rBQcbeVy
SHOW: | | - or go back to the newest paste.
1
<?php
2
$cookie = "COOKIE";
3
$folderID = 315488;
4
delfiles($folderID);
5
function delfiles($folderID)
6
{
7
	global $cookie;
8
	$ch = curl_init();
9
	curl_setopt($ch, CURLOPT_HEADER, 0);
10
	curl_setopt($ch, CURLOPT_URL,"https://1fichier.com/console/get_folder_content.pl?id=".$folderID);
11
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
12
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
13
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
14
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: SID='.$cookie ));
15
	//curl_setopt($ch, CURLOPT_INTERFACE, "tundhm");
16
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
17
	$files = curl_exec($ch);
18
19
	$files = json_decode($files, true);
20
21
	foreach ($files as &$value) {
22
		$id = str_replace("https://1fichier.com/?", "", $value['url']);
23
24
		if($value['type'] == "f")
25
		{
26
			echo "DELETE: ".$value['name']. " ID:". $id . " Result: ";
27
			$ch = curl_init();
28
			curl_setopt($ch, CURLOPT_HEADER, 0);
29
			curl_setopt($ch, CURLOPT_URL,"https://1fichier.com/console/remove.pl");
30
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
31
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
32
			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
33
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: SID='.$cookie ));
34
			curl_setopt($ch, CURLOPT_TIMEOUT, 4);
35
			//curl_setopt($ch, CURLOPT_INTERFACE, "tundhm");
36
			curl_setopt($ch,CURLOPT_POST, 1);
37
			curl_setopt($ch,CURLOPT_POSTFIELDS, 'remove=1&selected%5B%5D=C_0_'.$id);
38
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
39
			echo curl_exec($ch);
40
			
41
		}else{
42
			$id = str_replace("https://1fichier.com/console/get_folder_content.pl?id=", "", $value['url']);
43
			echo "DELETE: ".$value['name']. " ID:". $id . " Result: ";
44
			delfiles($id);
45
			
46
			$ch = curl_init();
47
			curl_setopt($ch, CURLOPT_HEADER, 0);
48
			curl_setopt($ch, CURLOPT_URL,"https://1fichier.com/console/rmdir.pl?dir=".$id);
49
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
50
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
51
			curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
52
			curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: SID='.$cookie ));
53
			//curl_setopt($ch, CURLOPT_INTERFACE, "tundhm");
54
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
55
			echo curl_exec($ch);
56
57
		}
58
		echo PHP_EOL;
59
60
	}
61
}