Fixed invalid URL breaking scrape, prefixing reddit URLs with origin.
This commit is contained in:
@@ -20,8 +20,8 @@ async function redditAlbum(host, post) {
|
||||
url: host.url,
|
||||
title: post.title,
|
||||
},
|
||||
items: items.map(url => ({
|
||||
id: new URL(url).pathname.match(/\/(.*).jpg/)[1],
|
||||
items: items.map((url) => ({
|
||||
id: new URL(url).pathname.match(/\/(.*).\w+$/)?.[1],
|
||||
url,
|
||||
datetime: post.datetime,
|
||||
type: mime.getType(url) || 'image/jpeg',
|
||||
|
||||
Reference in New Issue
Block a user