I've never allowed external torrents but thinking of changing that so I'll test your code serph on my live site, botanicar if you have old code that use to work might be worth posting here it might have something useful in there
<?php
function scrapeSupported($tracker)
{
$pieces = parse_url($tracker);
if (! isset($pieces['scheme'])) {
return false;
} elseif (! preg_match('@^(http[s]?|udp)$@', $pieces['scheme'])) {
return false;
}
$delimiter = strripos($pieces['path'], '/');
if ($delimiter === false) {
return false;
} elseif (substr($pieces['path'], ++$delimiter, 8) !== 'announce') {
return false;
} else {
return true;
}
}
$urls[] = "http://example.com/announce";
$urls[] = "http://example.com/x/announce";
$urls[] = "http://example.com/announce.php";
$urls[] = "http://example.com/a";
$urls[] = "http://example.com/announce?x2%0644";
$urls[] = "http://example.com/announce?x=2/4";
$urls[] = "http://example.com/x%064announce";
$urls[] = "http://foobar.org:8080/passkey/announce";
foreach ($urls as $url) {
$results[$url] = scrapeSupported($url);
}
var_dump($results);
array(8) {
["http://example.com/announce"]=>
bool(true)
["http://example.com/x/announce"]=>
bool(true)
["http://example.com/announce.php"]=>
bool(true)
["http://example.com/a"]=>
bool(false)
["http://example.com/announce?x2%0644"]=>
bool(true)
["http://example.com/announce?x=2/4"]=>
bool(true)
["http://example.com/x%064announce"]=>
bool(false)
["http://foobar.org:8080/passkey/announce"]=>
bool(true)
}
No users online
Torrents
Members
Online