|
1 | | -const { config, scrappers, classes: { SourceInfo, HosterInfo } } = require('../dist/index.js'); |
2 | | - |
3 | | -(async () => { |
4 | | - config.showError = true; |
5 | | - |
6 | | - config.puppeteer.headless = true; |
7 | | - //config.puppeteer.executablePath = 'C:\\Users\\Admin\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'; |
8 | | - config.puppeteer.args = ['--no-sandbox', '--disable-setuid-sandbox']; |
9 | | - |
10 | | - const urls = [ |
11 | | - 'https://openload.co/embed/zRpmqpRRaac/YuGiOhArcVEpisode123-rh-480.x.mp4', |
12 | | - 'https://oload.tv/embed/fZOeAHeGgcI', |
13 | | - 'http://streamcloud.eu/dx008gqtcsdw/jumanji.SD-spectre.mkv.html', |
14 | | - 'https://vidzi.tv/8yrmh5ooflp6.html', |
15 | | - 'http://vidstreaming.io/streaming.php?id=NzUwMDI=&title=Mob+Psycho+100+Episode+9', |
16 | | - 'https://streamango.com/embed/klkflffksmotebqk/YuGiOhArcVEpisode123-rh-343_mp4', |
17 | | - 'https://rapidvideo.com/e/FO24ULAW2H', |
18 | | - |
19 | | - 'https://ww3.gogoanime.io/death-note-episode-19', |
20 | | - 'http://kissanime.ru/Anime/Yu-Gi-Oh-Arc-V-Dub/Episode-123?id=142754&s=default' |
21 | | - ]; |
22 | | - |
23 | | - let allSuccess = true; |
24 | | - try { |
25 | | - for (let url of urls) { |
26 | | - const scrapper = scrappers.all.getFirstApplicable(url); |
27 | | - const scrap = await scrapper.run(url); |
28 | | - |
29 | | - const success = |
30 | | - scrap.info && |
31 | | - scrap.info instanceof SourceInfo && scrap.info.source.length > 0 || |
32 | | - scrap.info instanceof HosterInfo && scrap.info.hoster.length > 0; |
33 | | - |
34 | | - console.log(`${scrapper.name}: ${success}`); |
35 | | - |
36 | | - if (!success) |
37 | | - allSuccess = false; |
38 | | - } |
39 | | - } catch (err) { |
40 | | - allSuccess = false; |
41 | | - if (config.showError) |
42 | | - console.error(err); |
43 | | - console.error('Unexpected error during testing'); |
44 | | - } |
45 | | - if (!allSuccess) |
46 | | - process.exit(1); |
47 | | - process.exit(0); |
48 | | -})(); |
| 1 | +const { config, scrappers, classes: { SourceInfo, HosterInfo } } = require('../dist/index.js'); |
| 2 | + |
| 3 | +(async () => { |
| 4 | + config.showError = true; |
| 5 | + |
| 6 | + config.puppeteer.headless = true; |
| 7 | + //config.puppeteer.executablePath = 'C:\\Users\\Admin\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'; |
| 8 | + config.puppeteer.args = ['--no-sandbox', '--disable-setuid-sandbox']; |
| 9 | + |
| 10 | + const urls = [ |
| 11 | + 'https://openload.co/embed/zRpmqpRRaac/YuGiOhArcVEpisode123-rh-480.x.mp4', |
| 12 | + 'https://oload.tv/embed/fZOeAHeGgcI', |
| 13 | + 'http://streamcloud.eu/dx008gqtcsdw/jumanji.SD-spectre.mkv.html', |
| 14 | + 'https://vidzi.tv/8yrmh5ooflp6.html', |
| 15 | + 'http://vidstreaming.io/streaming.php?id=NzUwMDI=&title=Mob+Psycho+100+Episode+9', |
| 16 | + 'https://streamango.com/embed/klkflffksmotebqk/YuGiOhArcVEpisode123-rh-343_mp4', |
| 17 | + 'https://rapidvideo.com/e/FO24ULAW2H', |
| 18 | + |
| 19 | + 'https://ww3.gogoanime.io/death-note-episode-19', |
| 20 | + 'http://kissanime.ru/Anime/Yu-Gi-Oh-Arc-V-Dub/Episode-123?id=142754&s=default' |
| 21 | + ]; |
| 22 | + |
| 23 | + let allSuccess = true; |
| 24 | + try { |
| 25 | + for (let url of urls) { |
| 26 | + const scrapper = scrappers.all.getFirstApplicable(url); |
| 27 | + const scrap = await scrapper.run(url); |
| 28 | + |
| 29 | + const success = |
| 30 | + scrap.info && |
| 31 | + scrap.info instanceof SourceInfo && scrap.info.source.length > 0 || |
| 32 | + scrap.info instanceof HosterInfo && scrap.info.hoster.length > 0; |
| 33 | + |
| 34 | + console.log(`${scrapper.name}: ${success}`); |
| 35 | + |
| 36 | + if (!success) |
| 37 | + allSuccess = false; |
| 38 | + } |
| 39 | + } catch (err) { |
| 40 | + allSuccess = false; |
| 41 | + if (config.showError) |
| 42 | + console.error(err); |
| 43 | + console.error('Unexpected error during testing'); |
| 44 | + } |
| 45 | + if (!allSuccess) |
| 46 | + process.exit(1); |
| 47 | + process.exit(0); |
| 48 | +})(); |
0 commit comments