mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-05-20 21:11:50 +00:00
fix google sr
This commit is contained in:
parent
5324b4533c
commit
6d23d24573
1 changed files with 5 additions and 1 deletions
|
|
@ -8,6 +8,10 @@ const { Type } = require('./types');
|
||||||
const CINEMETA_URL = 'https://v3-cinemeta.strem.io';
|
const CINEMETA_URL = 'https://v3-cinemeta.strem.io';
|
||||||
const KITSU_URL = 'https://anime-kitsu.strem.fun';
|
const KITSU_URL = 'https://anime-kitsu.strem.fun';
|
||||||
const TIMEOUT = 20000;
|
const TIMEOUT = 20000;
|
||||||
|
const selectors = {
|
||||||
|
...googleSr.defaultSelectors,
|
||||||
|
LinkSelector: 'a:has(h3)'
|
||||||
|
}
|
||||||
|
|
||||||
function getMetadata(id, type = Type.SERIES) {
|
function getMetadata(id, type = Type.SERIES) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
|
@ -108,7 +112,7 @@ async function getImdbId(info, type) {
|
||||||
reject(err || new Error('failed imdbId search'));
|
reject(err || new Error('failed imdbId search'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(() => googleSr.search(query)
|
}).catch(() => googleSr.search(query, { selectors })
|
||||||
.then(response => response.length ? response : Promise.reject('No results'))
|
.then(response => response.length ? response : Promise.reject('No results'))
|
||||||
.then(results => results
|
.then(results => results
|
||||||
.map(result => result.Link)
|
.map(result => result.Link)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue