librex/engines/bittorrent/get_magnet_1337x.php

15 lines
434 B
PHP
Raw Normal View History

2023-02-03 21:01:28 +00:00
<?php
require "../../misc/tools.php";
$config = require "../../config.php";
$url = $_REQUEST["url"];
$response = request($url);
$xpath = get_xpath($response);
$magnet = $xpath->query("//main/div/div/div/div/div/ul/li/a/@href")[0]->textContent;
$magnet_without_tracker = explode("&tr=", $magnet)[0];
$magnet = $magnet_without_tracker . $config->bittorent_trackers;
header("Location: $magnet")
?>