You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
import lookmovie from './scraper/lookmovie'; |
|
import xemovie from './scraper/xemovie'; |
|
import theflix from './scraper/theflix'; |
|
import vidzstore from './scraper/vidzstore'; |
|
|
|
async function findContent(searchTerm, type) { |
|
const results = { options: []}; |
|
const content = await Promise.all([ |
|
// lookmovie.findContent(searchTerm, type), |
|
xemovie.findContent(searchTerm, type), |
|
theflix.findContent(searchTerm, type), |
|
vidzstore.findContent(searchTerm, type) |
|
]); |
|
|
|
content.forEach((o) => { |
|
if (!o || !o.options) return; |
|
|
|
o.options.forEach((i) => { |
|
if (!i) return; |
|
results.options.push(i) |
|
}) |
|
}); |
|
|
|
return results; |
|
} |
|
|
|
async function getStreamUrl(slug, type, source, season, episode) { |
|
switch (source) { |
|
case 'lookmovie': |
|
return await lookmovie.getStreamUrl(slug, type, season, episode); |
|
case 'theflix': |
|
return await theflix.getStreamUrl(slug, type, season, episode); |
|
case 'vidzstore': |
|
return await vidzstore.getStreamUrl(slug); |
|
case 'xemovie': |
|
return await xemovie.getStreamUrl(slug, type, season, episode); |
|
default: |
|
return; |
|
} |
|
} |
|
|
|
async function getEpisodes(slug, source) { |
|
switch (source) { |
|
case 'lookmovie': |
|
return await lookmovie.getEpisodes(slug); |
|
case 'theflix': |
|
return await theflix.getEpisodes(slug); |
|
case 'xemovie': |
|
return await xemovie.getEpisodes(slug); |
|
default: |
|
return; |
|
} |
|
} |
|
|
|
export { findContent, getStreamUrl, getEpisodes }
|
|
|