Skip to content

Commit 07f0ea2

Browse files
committed
fix: facebook url strict to only detect videos/reels
1 parent 5deac1d commit 07f0ea2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/utils/instantdl/downloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function md5FromUrl(url: string) {
1616
}
1717

1818
const facebookUrlRegex =
19-
/^(https?:\/\/)?(www\.)?(facebook\.com|fb\.watch)\/[^\s?#]+(\?[^\s#]*)?(#[^\s]*)?$/i;
19+
/^(https?:\/\/)?(www\.)?(facebook\.com\/(watch\/\?v=\d+|[^\/]+\/videos\/\d+|reel\/\d+)|fb\.watch\/[A-Za-z0-9_-]+)\/?$/i;
2020
const youtubeShortsUrlRegex =
2121
/^(https?:\/\/)?(www\.)?youtube\.com\/shorts\/([A-Za-z0-9_-]{11})(\?[^\s#]*)?(#[^\s]*)?$/i;
2222

0 commit comments

Comments
 (0)