mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
feat: check EZTV mirrors for available site to query (#3036)
This commit is contained in:
parent
925caff5dd
commit
a1e229a7e1
@ -6,7 +6,7 @@ class EZTVBridge extends BridgeAbstract
|
|||||||
{
|
{
|
||||||
const MAINTAINER = 'alexAubin';
|
const MAINTAINER = 'alexAubin';
|
||||||
const NAME = 'EZTV';
|
const NAME = 'EZTV';
|
||||||
const URI = 'https://eztv.re/';
|
const URI = 'https://eztvstatus.com';
|
||||||
const DESCRIPTION = 'Search for torrents by IMDB id. You can find IMDB id in the url of a tv show.';
|
const DESCRIPTION = 'Search for torrents by IMDB id. You can find IMDB id in the url of a tv show.';
|
||||||
|
|
||||||
const PARAMETERS = [
|
const PARAMETERS = [
|
||||||
@ -47,9 +47,11 @@ class EZTVBridge extends BridgeAbstract
|
|||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
|
$eztv_uri = $this->getEztvUri();
|
||||||
|
Debug::log($eztv_uri);
|
||||||
$ids = explode(',', trim($this->getInput('ids')));
|
$ids = explode(',', trim($this->getInput('ids')));
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$data = json_decode(getContents(sprintf('https://eztv.re/api/get-torrents?imdb_id=%s', $id)));
|
$data = json_decode(getContents(sprintf('%s/api/get-torrents?imdb_id=%s', $eztv_uri, $id)));
|
||||||
if (!isset($data->torrents)) {
|
if (!isset($data->torrents)) {
|
||||||
// No results
|
// No results
|
||||||
continue;
|
continue;
|
||||||
@ -79,6 +81,19 @@ class EZTVBridge extends BridgeAbstract
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getEztvUri()
|
||||||
|
{
|
||||||
|
$html = getSimpleHTMLDom(self::URI);
|
||||||
|
$urls = $html->find('a.domainLink');
|
||||||
|
foreach ($urls as $url) {
|
||||||
|
$headers = get_headers($url->href);
|
||||||
|
if (substr($headers[0], 9, 3) === '200') {
|
||||||
|
return $url->href;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Exception('No valid EZTV URI available');
|
||||||
|
}
|
||||||
|
|
||||||
protected function getItemFromTorrent($torrent)
|
protected function getItemFromTorrent($torrent)
|
||||||
{
|
{
|
||||||
$item = [];
|
$item = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user