match: light cleanup

This commit is contained in:
dumbmoron 2023-12-14 22:43:57 +00:00
parent f9feaa41ce
commit c458423e03
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -37,7 +37,6 @@ export default async function(host, patternMatch, url, lang, obj) {
break;
case "vk":
r = await vk({
url: url,
userId: patternMatch["userId"],
videoId: patternMatch["videoId"],
quality: obj.vQuality
@ -57,11 +56,13 @@ export default async function(host, patternMatch, url, lang, obj) {
isAudioMuted: obj.isAudioMuted,
dubLang: obj.dubLang
}
if (url.match('music.youtube.com') || isAudioOnly === true) {
if (new URL(url).hostname === 'music.youtube.com' || isAudioOnly === true) {
fetchInfo.quality = "max";
fetchInfo.format = "vp9";
fetchInfo.isAudioOnly = true
}
r = await youtube(fetchInfo);
break;
case "reddit":
@ -83,9 +84,9 @@ export default async function(host, patternMatch, url, lang, obj) {
break;
case "tumblr":
r = await tumblr({
id: patternMatch["id"],
url: url,
user: patternMatch["user"] || false
id: patternMatch.id,
user: patternMatch.user,
url
});
break;
case "vimeo":