merge: 10.7.3 from main

This commit is contained in:
wukko
2025-02-11 16:18:30 +06:00
14 changed files with 63 additions and 31 deletions

View File

@@ -305,12 +305,12 @@ export default function instagram(obj) {
if (sidecar) {
const picker = sidecar.edges.filter(e => e.node?.display_url)
.map((e, i) => {
const type = e.node?.is_video ? "video" : "photo";
const type = e.node?.is_video && e.node?.video_url ? "video" : "photo";
let url;
if (type === 'video') {
if (type === "video") {
url = e.node?.video_url;
} else if (type === 'photo') {
} else if (type === "photo") {
url = e.node?.display_url;
}

View File

@@ -44,7 +44,7 @@ export default async function(o) {
let fileMetadata = {
title: videoData.movie.title.trim(),
author: (videoData.author?.name || videoData.compilationTitle).trim(),
author: (videoData.author?.name || videoData.compilationTitle)?.trim(),
}
if (bestVideo) return {

View File

@@ -98,6 +98,14 @@ function aliasURL(url) {
if (url.hostname === 'xhslink.com' && parts.length === 3) {
url = new URL(`https://www.xiaohongshu.com/a/${parts[2]}`);
}
break;
case "loom":
const idPart = parts[parts.length - 1];
if (idPart.length > 32) {
url.pathname = `/share/${idPart.slice(-32)}`;
}
break;
}
return url;