Рефакторинг, плюс небольшие изменения - подготовка к использованию внешних конвертеров
This commit is contained in:
@@ -6,12 +6,13 @@ const ConvertBase = require('./ConvertBase');
|
||||
|
||||
class ConvertSamlib extends ConvertBase {
|
||||
check(data, opts) {
|
||||
const {url} = opts;
|
||||
const {url, dataType} = opts;
|
||||
|
||||
const parsedUrl = new URL(url);
|
||||
if (parsedUrl.hostname == 'samlib.ru' ||
|
||||
if (dataType && dataType.ext == 'html' &&
|
||||
(parsedUrl.hostname == 'samlib.ru' ||
|
||||
parsedUrl.hostname == 'budclub.ru' ||
|
||||
parsedUrl.hostname == 'zhurnal.lib.ru') {
|
||||
parsedUrl.hostname == 'zhurnal.lib.ru')) {
|
||||
return {hostname: parsedUrl.hostname};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user