|
@@ -1,5 +1,5 @@
|
|
<?php
|
|
<?php
|
|
-require "../../misc/tools.php";
|
|
|
|
|
|
+require "../../functions/tools.php";
|
|
$opts = require "../../config.php";
|
|
$opts = require "../../config.php";
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------
|
|
/* ------------------------------------------------------------------------------------
|
|
@@ -15,24 +15,24 @@ $opts = require "../../config.php";
|
|
|
|
|
|
$ch = curl_init();
|
|
$ch = curl_init();
|
|
|
|
|
|
-curl_setopt($this->ch, CURLOPT_URL, $_REQUEST["url"]);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_HTTPGET, 1); // Redundant? Probably...
|
|
|
|
-curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_VERBOSE, false);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_USERAGENT, $opts->user_agents[array_rand($opts->user_agents)]);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_HTTPHEADER, array(
|
|
|
|
|
|
+curl_setopt($ch, CURLOPT_URL, $_REQUEST["url"]);
|
|
|
|
+curl_setopt($ch, CURLOPT_HTTPGET, 1); // Redundant? Probably...
|
|
|
|
+curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
+curl_setopt($ch, CURLOPT_VERBOSE, false);
|
|
|
|
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
+curl_setopt($ch, CURLOPT_USERAGENT, $opts->user_agents[array_rand($opts->user_agents)]);
|
|
|
|
+curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
'Accept-Language: en-US,en;q=0.5',
|
|
'Accept-Language: en-US,en;q=0.5',
|
|
'Upgrade-Insecure-Requests: 1'
|
|
'Upgrade-Insecure-Requests: 1'
|
|
));
|
|
));
|
|
-curl_setopt($this->ch, CURLOPT_ENCODING, "gzip,deflate");
|
|
|
|
-curl_setopt($this->ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_MAXREDIRS, 5);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_TIMEOUT, 3);
|
|
|
|
-curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
|
|
+curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
|
|
|
|
+curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);
|
|
|
|
+curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
|
|
|
+curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP);
|
|
|
|
+curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
|
|
|
|
+curl_setopt($ch, CURLOPT_TIMEOUT, 3);
|
|
|
|
+curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
|
|
$response = curl_exec($ch);
|
|
$response = curl_exec($ch);
|
|
curl_close($ch);
|
|
curl_close($ch);
|
|
@@ -42,8 +42,7 @@ $xpath = get_xpath($response);
|
|
// No results
|
|
// No results
|
|
if(!$xpath) die();
|
|
if(!$xpath) die();
|
|
|
|
|
|
-$magnet = $xpath->query("//main/div/div/div/div/div/ul/li/a/@href")[0]->textContent;
|
|
|
|
-$magnet = trim($magnet);
|
|
|
|
|
|
+$magnet = trim($xpath->query("//main/div/div/div/div/div/ul/li/a/@href")[0]->textContent);
|
|
|
|
|
|
header("Location: $magnet")
|
|
header("Location: $magnet")
|
|
?>
|
|
?>
|