mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
add MAGNET_DOWNLOAD_YGGDRASIL_URL_ONLY settings
This commit is contained in:
parent
6d39625510
commit
96a03ec4ec
2 changed files with 29 additions and 3 deletions
|
|
@ -98,6 +98,8 @@ define('MAGNET_STOP_WORDS_SIMILAR',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
define('MAGNET_DOWNLOAD_YGGDRASIL_URL_ONLY', true);
|
||||||
|
|
||||||
// Comment
|
// Comment
|
||||||
define('COMMENT_DEFAULT_APPROVED', false);
|
define('COMMENT_DEFAULT_APPROVED', false);
|
||||||
define('COMMENT_DEFAULT_PUBLIC', false);
|
define('COMMENT_DEFAULT_PUBLIC', false);
|
||||||
|
|
|
||||||
|
|
@ -456,12 +456,20 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
||||||
$port = $db->getPort($addressTracker->portId);
|
$port = $db->getPort($addressTracker->portId);
|
||||||
$uri = $db->getUri($addressTracker->uriId);
|
$uri = $db->getUri($addressTracker->uriId);
|
||||||
|
|
||||||
$link[] = sprintf('tr=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
$url = sprintf('tr=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$port->value,
|
$port->value,
|
||||||
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$uri->value)));
|
$uri->value)));
|
||||||
|
|
||||||
|
// Yggdrasil url only settings enabled
|
||||||
|
if (MAGNET_DOWNLOAD_YGGDRASIL_URL_ONLY && !preg_match(YGGDRASIL_URL_REGEX, $url))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$link[] = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (TRACKER_LINKS as $tracker => $value)
|
foreach (TRACKER_LINKS as $tracker => $value)
|
||||||
|
|
@ -479,12 +487,20 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
||||||
$port = $db->getPort($acceptableSource->portId);
|
$port = $db->getPort($acceptableSource->portId);
|
||||||
$uri = $db->getUri($acceptableSource->uriId);
|
$uri = $db->getUri($acceptableSource->uriId);
|
||||||
|
|
||||||
$link[] = sprintf('as=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
$url = sprintf('as=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$port->value,
|
$port->value,
|
||||||
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$uri->value)));
|
$uri->value)));
|
||||||
|
|
||||||
|
// Yggdrasil url only settings enabled
|
||||||
|
if (MAGNET_DOWNLOAD_YGGDRASIL_URL_ONLY && !preg_match(YGGDRASIL_URL_REGEX, $url))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$link[] = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Exact Source
|
/// Exact Source
|
||||||
|
|
@ -497,12 +513,20 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
||||||
$port = $db->getPort($eXactSource->portId);
|
$port = $db->getPort($eXactSource->portId);
|
||||||
$uri = $db->getUri($eXactSource->uriId);
|
$uri = $db->getUri($eXactSource->uriId);
|
||||||
|
|
||||||
$link[] = sprintf('xs=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
$url = sprintf('xs=%s', urlencode($port->value ? sprintf('%s://%s:%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$port->value,
|
$port->value,
|
||||||
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
$uri->value) : sprintf('%s://%s%s', $scheme->value,
|
||||||
$host->value,
|
$host->value,
|
||||||
$uri->value)));
|
$uri->value)));
|
||||||
|
|
||||||
|
// Yggdrasil url only settings enabled
|
||||||
|
if (MAGNET_DOWNLOAD_YGGDRASIL_URL_ONLY && !preg_match(YGGDRASIL_URL_REGEX, $url))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$link[] = $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return download link
|
// Return download link
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue