From 45a3f2835db749377febcedd7a8c647eaa171c03 Mon Sep 17 00:00:00 2001 From: TPN Date: Mon, 1 Apr 2024 14:35:40 +0000 Subject: [PATCH] fix mixdrop --- src/providers/embeds/mixdrop.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/providers/embeds/mixdrop.ts b/src/providers/embeds/mixdrop.ts index 90f67cf..a1b3143 100644 --- a/src/providers/embeds/mixdrop.ts +++ b/src/providers/embeds/mixdrop.ts @@ -12,8 +12,9 @@ export const mixdropScraper = makeEmbed({ async scrape(ctx) { // Example url: https://mixdrop.co/e/pkwrgp0pizgod0 // Example url: https://mixdrop.vc/e/pkwrgp0pizgod0 - const finalEmbedUrl = (await ctx.fetcher.full(ctx.url)).finalUrl; - const embedId = new URL(finalEmbedUrl).pathname.split('/')[2]; + let embedUrl = ctx.url; + if (ctx.url.includes('primewire')) embedUrl = (await ctx.fetcher.full(ctx.url)).finalUrl; + const embedId = new URL(embedUrl).pathname.split('/')[2]; // constructing the url because many times mixdrop.co is returned which does not work // this also handels the case where preview page urls are returned // Example: https://mixdrop.vc/f/pkwrgp0pizgod0