Skip to content

Commit c8d11b5

Browse files
committed
feat: update transformVideoUrl
1 parent e14cda3 commit c8d11b5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/internal/utils/src/url-for-video.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ export const transformVideoUrl = ({
3838
).toString()}`
3939
}
4040

41+
if (url?.match(/\/\/www.pornhub.com\/view_video.php\?viewkey=\w+/)) {
42+
if (mini) {
43+
return null
44+
} else {
45+
return `https://www.pornhub.com/embed/${url.match(/\/\/www.pornhub.com\/view_video.php\?viewkey=(\w+)/)?.[1]}?${new URLSearchParams(
46+
{
47+
autoplay: "1",
48+
},
49+
).toString()}`
50+
}
51+
}
52+
4153
if (attachments) {
4254
return attachments.find((attachment) => attachment.mime_type === "text/html")?.url ?? null
4355
}

0 commit comments

Comments
 (0)