Allow lookmovie content search to fail

This commit is contained in:
James Hawkins 2021-10-01 16:23:10 +01:00
parent 455805cb88
commit 3627660840

View File

@ -5,6 +5,7 @@ const BASE_URL = `${process.env.REACT_APP_CORS_PROXY_URL}https://lookmovie.io`;
let phpsessid;
async function findContent(searchTerm, type) {
try {
const searchUrl = `${BASE_URL}/${type}s/search/?q=${encodeURIComponent(searchTerm)}`;
const searchRes = await fetch(searchUrl).then((d) => d.text());
@ -49,6 +50,9 @@ async function findContent(searchTerm, type) {
options: [{ title, slug, type, year, source: 'lookmovie' }]
}
}
} catch (e) {
return { options: [] }
}
}
async function getVideoUrl(config) {
const { subtitles, token: accessToken } = await getAccessInfo(config);