diff --git a/main.py b/main.py index 4fe9191..da8fc14 100644 --- a/main.py +++ b/main.py @@ -26,7 +26,7 @@ "display_format": "Twitter • {0}" }, "Instagram": { - "patterns": [r"instagram\.com/(?:p|reel)/([\w-]+)"], + "patterns": [r"instagram\.com/(?:p|reels?)/([\w-]+)"], "base_url": "fixembed.app", "display_format": "Instagram • {0}" }, diff --git a/service/README.md b/service/README.md index c6e4bb8..602e5ed 100644 --- a/service/README.md +++ b/service/README.md @@ -67,6 +67,7 @@ Direct URL patterns for easy use: GET /twitter/{user}/status/{id} GET /instagram/p/{shortcode} GET /instagram/reel/{shortcode} +GET /instagram/reels/{shortcode} GET /threads/@{username}/post/{shortcode} GET /bluesky/profile/{handle}/post/{id} GET /reddit/r/{subreddit}/comments/{id} diff --git a/service/src/README.md b/service/src/README.md index c6e4bb8..602e5ed 100644 --- a/service/src/README.md +++ b/service/src/README.md @@ -67,6 +67,7 @@ Direct URL patterns for easy use: GET /twitter/{user}/status/{id} GET /instagram/p/{shortcode} GET /instagram/reel/{shortcode} +GET /instagram/reels/{shortcode} GET /threads/@{username}/post/{shortcode} GET /bluesky/profile/{handle}/post/{id} GET /reddit/r/{subreddit}/comments/{id} diff --git a/service/src/handlers/instagram.ts b/service/src/handlers/instagram.ts index 927859e..9e9ee9d 100644 --- a/service/src/handlers/instagram.ts +++ b/service/src/handlers/instagram.ts @@ -280,8 +280,7 @@ export const instagramHandler: PlatformHandler = { name: 'instagram', patterns: [ /instagram\.com\/p\/([^\/\?]+)/i, - /instagram\.com\/reel\/([^\/\?]+)/i, - /instagram\.com\/reels\/([^\/\?]+)/i, + /instagram\.com\/reels?\/([^\/\?]+)/i, /instagram\.com\/tv\/([^\/\?]+)/i, /instagram\.com\/stories\/([^\/]+)\/(\d+)/i, /instagram\.com\/share\/(p|reel)\/([^\/\?]+)/i, diff --git a/service/src/src/handlers/instagram.ts b/service/src/src/handlers/instagram.ts index 927859e..9e9ee9d 100644 --- a/service/src/src/handlers/instagram.ts +++ b/service/src/src/handlers/instagram.ts @@ -280,8 +280,7 @@ export const instagramHandler: PlatformHandler = { name: 'instagram', patterns: [ /instagram\.com\/p\/([^\/\?]+)/i, - /instagram\.com\/reel\/([^\/\?]+)/i, - /instagram\.com\/reels\/([^\/\?]+)/i, + /instagram\.com\/reels?\/([^\/\?]+)/i, /instagram\.com\/tv\/([^\/\?]+)/i, /instagram\.com\/stories\/([^\/]+)\/(\d+)/i, /instagram\.com\/share\/(p|reel)\/([^\/\?]+)/i, diff --git a/service/src/src/utils/fetch.ts b/service/src/src/utils/fetch.ts index d66fe2a..68b7f63 100644 --- a/service/src/src/utils/fetch.ts +++ b/service/src/src/utils/fetch.ts @@ -112,7 +112,7 @@ export function parseRedditUrl(url: string): { subreddit: string; postId: string export function parseInstagramUrl(url: string): { shortcode: string; type: 'post' | 'reel' | 'story' } | null { const patterns = [ { pattern: /instagram\.com\/p\/([^\/\?]+)/i, type: 'post' as const }, - { pattern: /instagram\.com\/reel\/([^\/\?]+)/i, type: 'reel' as const }, + { pattern: /instagram\.com\/reels?\/([^\/\?]+)/i, type: 'reel' as const }, { pattern: /instagram\.com\/stories\/[^\/]+\/(\d+)/i, type: 'story' as const }, ]; diff --git a/service/src/utils/fetch.ts b/service/src/utils/fetch.ts index 585b36e..b36bc5e 100644 --- a/service/src/utils/fetch.ts +++ b/service/src/utils/fetch.ts @@ -112,7 +112,7 @@ export function parseRedditUrl(url: string): { subreddit: string; postId: string export function parseInstagramUrl(url: string): { shortcode: string; type: 'post' | 'reel' | 'story' } | null { const patterns = [ { pattern: /instagram\.com\/p\/([^\/\?]+)/i, type: 'post' as const }, - { pattern: /instagram\.com\/reel\/([^\/\?]+)/i, type: 'reel' as const }, + { pattern: /instagram\.com\/reels?\/([^\/\?]+)/i, type: 'reel' as const }, { pattern: /instagram\.com\/stories\/[^\/]+\/(\d+)/i, type: 'story' as const }, ];