fix suggestions by @ihatespawn

This commit is contained in:
hyperdefined 2024-07-24 20:45:57 -04:00
parent 250cbcfac1
commit 49ba560304
No known key found for this signature in database
GPG Key ID: EB0B55B31E88AB03
2 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ import { cleanString } from "../../sub/utils.js";
export default async function(obj) { export default async function(obj) {
// handle video downloads // handle video downloads
if (obj.type == 'portal') { if (obj.type == 'portal') {
let req = await fetch(`https://www.newgrounds.com/${obj.type}/video/${obj.id}`, { let req = await fetch(`https://www.newgrounds.com/portal/video/${obj.id}`, {
headers: { headers: {
'User-Agent': genericUserAgent, 'User-Agent': genericUserAgent,
'X-Requested-With': 'XMLHttpRequest', 'X-Requested-With': 'XMLHttpRequest',
@ -72,15 +72,15 @@ export default async function(obj) {
} }
return { return {
urls: url, urls: url,
filenameAttributes: { filenameAttributes: {
service: "newgrounds", service: "newgrounds",
id: obj.id, id: obj.id,
title: fileMetadata.title, title: fileMetadata.title,
author: fileMetadata.artist, author: fileMetadata.artist,
}, },
fileMetadata, fileMetadata,
isAudioOnly: true isAudioOnly: true
}
} }
} }
}

View File

@ -60,5 +60,5 @@ export const testers = {
patternMatch.id?.length <= 11, patternMatch.id?.length <= 11,
"newgrounds": (patternMatch) => "newgrounds": (patternMatch) =>
patternMatch.id?.length <= 6, patternMatch.id?.length <= 1,
} }