feat: update transformVideoUrl

This commit is contained in:
DIYgod
2025-05-18 14:00:13 +08:00
parent e14cda3b86
commit c8d11b58e9
@@ -38,6 +38,18 @@ export const transformVideoUrl = ({
).toString()}`
}
if (url?.match(/\/\/www.pornhub.com\/view_video.php\?viewkey=\w+/)) {
if (mini) {
return null
} else {
return `https://www.pornhub.com/embed/${url.match(/\/\/www.pornhub.com\/view_video.php\?viewkey=(\w+)/)?.[1]}?${new URLSearchParams(
{
autoplay: "1",
},
).toString()}`
}
}
if (attachments) {
return attachments.find((attachment) => attachment.mime_type === "text/html")?.url ?? null
}