UNPKG

483 BJavaScriptView Raw
1const open = require('opn');
2const { print, l10n } = require('../utils');
3
4module.exports = (thread, config) => {
5 print.debug('dmhy:downloaders:system:thread', thread);
6 print.debug('dmhy:downloaders:system:config', config);
7
8 return open(thread.link).then(() => {
9 print.success(l10n('DOWNLOADER_DL_SUCCESS', { title: thread.title }));
10 }).catch((error) => {
11 print.error(l10n('DOWNLOADER_DL_FAILED', { title: thread.title }));
12 return Promise.reject(error);
13 });
14};