From 60eeca09d81bb33bf7a3599ed80c0e8b8ad38d7e Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:55 +0200 Subject: [PATCH] Added support for m.imgur.com links. Changed curate ignore log message details. --- src/curate/posts.js | 4 ++-- src/dissectLink.js | 4 ++-- src/methods/eroshare.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/curate/posts.js b/src/curate/posts.js index 13b2136..2fabc61 100644 --- a/src/curate/posts.js +++ b/src/curate/posts.js @@ -13,14 +13,14 @@ function curatePosts(posts, ignore) { }) : null; 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; } if(host) { 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; } diff --git a/src/dissectLink.js b/src/dissectLink.js index 26d6172..e0a318f 100644 --- a/src/dissectLink.js +++ b/src/dissectLink.js @@ -21,11 +21,11 @@ const hosts = [{ }, { method: 'imgurImage', label: 'imgur', - pattern: new urlPattern('http(s)\\://(i.)imgur.com/:id(.:ext)(?*)') + pattern: new urlPattern('http(s)\\://(:subdomain.)imgur.com/:id(.:ext)(?*)') }, { method: 'imgurAlbum', label: 'imgur', - pattern: new urlPattern('http(s)\\://(m.)imgur.com/:type/:id') + pattern: new urlPattern('http(s)\\://(:subdomain.)imgur.com/:type/:id') }, { method: 'gfycat', label: 'gfycat', diff --git a/src/methods/eroshare.js b/src/methods/eroshare.js index 296b46f..3649417 100644 --- a/src/methods/eroshare.js +++ b/src/methods/eroshare.js @@ -7,7 +7,7 @@ const fetch = require('node-fetch'); function eroshare(post) { return fetch(`https://web.archive.org/web/20170630040157im_/https://eroshare.com/${post.host.id}`).then(res => { if(res.ok) { - return res.text() + return res.text(); } return Promise.reject(`Unable to recover Eroshare video '${post.host.id}' :(`);