Added support for m.imgur.com links. Changed curate ignore log message details.
This commit is contained in:
parent
9dd9c823e8
commit
3794fc3776
|
@ -13,14 +13,14 @@ function curatePosts(posts, ignore) {
|
||||||
}) : null;
|
}) : null;
|
||||||
|
|
||||||
if(ignoring) {
|
if(ignoring) {
|
||||||
console.log('\x1b[33m%s\x1b[0m', `Ignoring ${ignoring} post '${post.title}' - ${post.url}`);
|
console.log('\x1b[33m%s\x1b[0m', `Ignoring ${ignoring} post '${post.title}' (${post.permalink})`);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(host) {
|
if(host) {
|
||||||
if(config.fetch.avoidDuplicates && processed.has(host.id)) {
|
if(config.fetch.avoidDuplicates && processed.has(host.id)) {
|
||||||
console.log('\x1b[33m%s\x1b[0m', `Ignoring cross-post or repost '${post.title}' - ${post.url}`);
|
console.log('\x1b[33m%s\x1b[0m', `Ignoring cross-post or repost '${post.url}' (${post.permalink})`);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,11 @@ const hosts = [{
|
||||||
}, {
|
}, {
|
||||||
method: 'imgurImage',
|
method: 'imgurImage',
|
||||||
label: 'imgur',
|
label: 'imgur',
|
||||||
pattern: new urlPattern('http(s)\\://(i.)imgur.com/:id(.:ext)(?*)')
|
pattern: new urlPattern('http(s)\\://(:subdomain.)imgur.com/:id(.:ext)(?*)')
|
||||||
}, {
|
}, {
|
||||||
method: 'imgurAlbum',
|
method: 'imgurAlbum',
|
||||||
label: 'imgur',
|
label: 'imgur',
|
||||||
pattern: new urlPattern('http(s)\\://(m.)imgur.com/:type/:id')
|
pattern: new urlPattern('http(s)\\://(:subdomain.)imgur.com/:type/:id')
|
||||||
}, {
|
}, {
|
||||||
method: 'gfycat',
|
method: 'gfycat',
|
||||||
label: 'gfycat',
|
label: 'gfycat',
|
||||||
|
|
|
@ -7,7 +7,7 @@ const fetch = require('node-fetch');
|
||||||
function eroshare(post) {
|
function eroshare(post) {
|
||||||
return fetch(`https://web.archive.org/web/20170630040157im_/https://eroshare.com/${post.host.id}`).then(res => {
|
return fetch(`https://web.archive.org/web/20170630040157im_/https://eroshare.com/${post.host.id}`).then(res => {
|
||||||
if(res.ok) {
|
if(res.ok) {
|
||||||
return res.text()
|
return res.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.reject(`Unable to recover Eroshare video '${post.host.id}' :(`);
|
return Promise.reject(`Unable to recover Eroshare video '${post.host.id}' :(`);
|
||||||
|
|
Loading…
Reference in New Issue