-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcore.php
More file actions
38 lines (30 loc) · 926 Bytes
/
Copy pathcore.php
File metadata and controls
38 lines (30 loc) · 926 Bytes
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
<?php
function CheckDestination($url) {
if (@file_get_contents($url) === FALSE) {
return FALSE;
}
return TRUE;
}
function DoJob ($url, $term = NULL) {
// $url="http://srv.musictarin.com/Musics/dl/";
$output = [];
$data=file_get_contents($url);
$data = strip_tags($data,"<a>");
$d = preg_split("/<\/a>/",$data);
foreach ( $d as $k=>$u ){
if( strpos($u, "<a href=") !== FALSE ) {
if (!is_null($term)) {
if( strpos($u, $term) !== FALSE ) {
$u = preg_replace("/.*<a\s+href=\"/sm","",$u);
$u = preg_replace("/\".*/","",$u);
$output[] = "<a href='" . "$url$u' download>" . $url . urldecode($u)."\r\n" . '</a><hr/>';
}
} else {
$u = preg_replace("/.*<a\s+href=\"/sm","",$u);
$u = preg_replace("/\".*/","",$u);;
$output[] = "<a href='" . "$url$u' download>" . $url . urldecode($u)."\r\n" . '</a><hr/>';
}
}
}
return $output;
}