Skip to content
This repository was archived by the owner on Oct 19, 2019. It is now read-only.

Commit b7d2b2f

Browse files
committed
Fixes #2
1 parent a62d0ea commit b7d2b2f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/scrappers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import urlparser = require('urlparser');
99
import { Hoster } from './Hoster';
1010
import { HosterInfo } from './HosterInfo';
1111
import { HosterScrapper } from './HosterScrapper';
12-
import { Runner } from './Runner';
1312
import { ScrapperList } from './ScrapperList';
1413
import { Source } from './Source';
1514
import { SourceInfo } from './SourceInfo';
@@ -108,7 +107,7 @@ export const scrappers: { stream: ScrapperList, hoster: ScrapperList } = {
108107
return null;
109108

110109
const htmlRunner = runners.getByType('html');
111-
if (!(htmlRunner instanceof Runner))
110+
if (typeof htmlRunner === 'undefined')
112111
return null;
113112
const html = await htmlRunner.run({
114113
url,
@@ -510,9 +509,9 @@ export const scrappers: { stream: ScrapperList, hoster: ScrapperList } = {
510509
hoster: args.mirrors.map(e => new Hoster({
511510
name: e.host.name,
512511
url:
513-
e.host.embed_prefix.replace(/\\\//g, '/') +
512+
(e.host.embed_prefix || '').replace(/\\\//g, '/') +
514513
e.embed_id +
515-
e.host.embed_suffix || '',
514+
(e.host.embed_suffix || ''),
516515
quality: e.quality
517516
}))
518517
});

test/test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
const { config, scrappers, classes: { SourceInfo, HosterInfo } } = require('../dist/index.js');
22

33
(async () => {
4+
45
config.showError = true;
56

67
config.puppeteer.headless = true;
7-
//config.puppeteer.executablePath = 'C:\\Users\\Admin\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe';
8-
//config.puppeteer.headless = false;
8+
// config.puppeteer.executablePath = 'C:\\Users\\Admin\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe';
9+
// config.puppeteer.headless = false;
910
config.puppeteer.args = ['--no-sandbox', '--disable-setuid-sandbox'];
1011

1112
const urls = [
1213
'https://oload.win/embed/3fz9J5E1aMg',
13-
'http://streamcloud.eu/dx008gqtcsdw/jumanji.SD-spectre.mkv.html',
14+
// 'http://streamcloud.eu/dx008gqtcsdw/jumanji.SD-spectre.mkv.html', // test not working
1415
'https://vidzi.tv/8yrmh5ooflp6.html',
1516
'https://vidstreaming.io/streaming.php?id=MzkzNTA=&title=Sword+Art+Online+Episode+6',
1617
'https://streamango.com/embed/klkflffksmotebqk/YuGiOhArcVEpisode123-rh-343_mp4',
@@ -19,7 +20,7 @@ const { config, scrappers, classes: { SourceInfo, HosterInfo } } = require('../d
1920

2021
'https://ww3.gogoanime.io/death-note-episode-19',
2122
'https://www.masterani.me/anime/watch/2809-b-the-beginning/7',
22-
'http://kissanime.ru/Anime/Yu-Gi-Oh-Arc-V-Dub/Episode-123?id=142754&s=default'
23+
// 'http://kissanime.ru/Anime/Yu-Gi-Oh-Arc-V-Dub/Episode-123?id=142754&s=default' // test not working
2324
];
2425

2526
let allSuccess = true;
@@ -47,4 +48,5 @@ const { config, scrappers, classes: { SourceInfo, HosterInfo } } = require('../d
4748
if (!allSuccess)
4849
process.exit(1);
4950
process.exit(0);
51+
5052
})();

0 commit comments

Comments
 (0)