Merge pull request 'fix torrentgalaxy issue' (#1) from bugfix/torrent-galaxy-issue into master
Reviewed-on: #1
This commit is contained in:
commit
0937b73813
|
@ -8,7 +8,7 @@
|
||||||
"google_language" => "it",
|
"google_language" => "it",
|
||||||
|
|
||||||
// If you have a local instance you can change this to http://localhost:3000
|
// If you have a local instance you can change this to http://localhost:3000
|
||||||
"invidious_instance_for_video_results" => "https://invidious.snopyta.org",
|
"invidious_instance_for_video_results" => "https://invidious.copyriot.xyz",
|
||||||
|
|
||||||
"disable_bittorent_search" => false,
|
"disable_bittorent_search" => false,
|
||||||
"bittorent_trackers" => "&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce",
|
"bittorent_trackers" => "&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce",
|
||||||
|
@ -19,14 +19,14 @@
|
||||||
Preset privacy friendly frontends for users, these can be overwritten by users in settings
|
Preset privacy friendly frontends for users, these can be overwritten by users in settings
|
||||||
e.g.: "invidious" => "https://yewtu.be",
|
e.g.: "invidious" => "https://yewtu.be",
|
||||||
*/
|
*/
|
||||||
"invidious" => "https://invidious.snopyta.org", // youtube
|
"invidious" => "https://invidious.copyriot.xyz", // youtube
|
||||||
"bibliogram" => "", // instagram
|
"bibliogram" => "", // instagram
|
||||||
"rimgo" => "https://rimgo.pussthecat.org", // imgur
|
"rimgo" => "https://rimgo.pussthecat.org", // imgur
|
||||||
"scribe" => "https://scribe.rip", // medium
|
"scribe" => "https://scribe.rip", // medium
|
||||||
"librarian" => "", // odysee
|
"librarian" => "", // odysee
|
||||||
"gothub" => "", // github
|
"gothub" => "", // github
|
||||||
"nitter" => "https://nitter.pussthecat.org", // twitter
|
"nitter" => "https://nitter.copyriot.xyz", // twitter
|
||||||
"libreddit" => "https://libreddit.kavin.rocks", // reddit
|
"libreddit" => "https://libreddit.copyriot.xyz", // reddit
|
||||||
"proxitok" => "https://proxitok.pussthecat.org", // tiktok
|
"proxitok" => "https://proxitok.pussthecat.org", // tiktok
|
||||||
"wikiless" => "", // wikipedia
|
"wikiless" => "", // wikipedia
|
||||||
"quetre" => "https://quetre.pussthecat.org", // quora
|
"quetre" => "https://quetre.pussthecat.org", // quora
|
||||||
|
|
|
@ -4,31 +4,37 @@
|
||||||
function get_torrentgalaxy_results($response)
|
function get_torrentgalaxy_results($response)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$xpath = get_xpath($response);
|
|
||||||
$results = array();
|
|
||||||
|
|
||||||
foreach($xpath->query("//div[@class='tgxtablerow txlight']") as $result)
|
try {
|
||||||
{
|
$xpath = get_xpath($response);
|
||||||
$name = $xpath->evaluate(".//div[contains(@class, 'clickable-row')]", $result)[0]->textContent;
|
$results = array();
|
||||||
$magnet = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/a/@href", $result)[1]->textContent;
|
|
||||||
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
|
||||||
$magnet = $magnet_without_tracker . $config->bittorent_trackers;
|
|
||||||
$size = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span", $result)[0]->textContent;
|
|
||||||
$seeders = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[1]->textContent;
|
|
||||||
$leechers = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[2]->textContent;
|
|
||||||
|
|
||||||
array_push($results,
|
foreach($xpath->query("//div[@class='tgxtablerow txlight']") as $result)
|
||||||
array (
|
{
|
||||||
"name" => htmlspecialchars($name),
|
$name = $xpath->evaluate(".//div[contains(@class, 'clickable-row')]", $result)[0]->textContent;
|
||||||
"seeders" => (int) $seeders,
|
$magnet = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/a/@href", $result)[1]->textContent;
|
||||||
"leechers" => (int) $leechers,
|
$magnet_without_tracker = explode("&tr=", $magnet)[0];
|
||||||
"magnet" => htmlspecialchars($magnet),
|
$magnet = $magnet_without_tracker . $config->bittorent_trackers;
|
||||||
"size" => htmlspecialchars($size),
|
$size = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span", $result)[0]->textContent;
|
||||||
"source" => "tgx.rs"
|
$seeders = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[1]->textContent;
|
||||||
)
|
$leechers = $xpath->evaluate(".//div[@class='tgxtablecell collapsehide rounded txlight']/span/font", $result)[2]->textContent;
|
||||||
);
|
|
||||||
|
array_push($results,
|
||||||
|
array (
|
||||||
|
"name" => htmlspecialchars($name),
|
||||||
|
"seeders" => (int) $seeders,
|
||||||
|
"leechers" => (int) $leechers,
|
||||||
|
"magnet" => htmlspecialchars($magnet),
|
||||||
|
"size" => htmlspecialchars($size),
|
||||||
|
"source" => "tgx.rs"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $results;
|
||||||
|
} catch (Error $e) {
|
||||||
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue