Skip to content

Conversation

@TheUnrealZaka
Copy link

Summary

This PR fixes Instagram link detection to support both /reel/ and /reels/ URL formats across all components.

Problem

The bot only detected Instagram links with /reel/ (singular), but Instagram also uses /reels/ (plural) in some URLs:

  • ✅ Detected: https://www.instagram.com/reel/code/
  • ❌ Not detected: https://www.instagram.com/reels/code/

Solution

Updated the Instagram regex patterns from /reel/ to /reels?/

The s? makes the "s" optional, matching both reel and reels.

Updated regex patterns in Python and TypeScript to match both /reel and /reels Instagram URLs. Documentation updated to reflect the new supported route. This improves compatibility with Instagram's URL variations.
Copilot AI review requested due to automatic review settings January 1, 2026 21:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Instagram link detection to support both /reel/ (singular) and /reels/ (plural) URL formats by updating regex patterns from /reel/ to /reels?/ across the codebase.

Key Changes:

  • Updated regex patterns to use reels? (making the 's' optional) instead of separate patterns for /reel/ and /reels/
  • Consolidated duplicate patterns in handler files into a single pattern
  • Added documentation for the /instagram/reels/{shortcode} endpoint

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
service/src/utils/fetch.ts Updated parseInstagramUrl regex pattern to match both /reel/ and /reels/
service/src/src/utils/fetch.ts Updated parseInstagramUrl regex pattern (duplicate location)
service/src/handlers/instagram.ts Consolidated two separate patterns into one using reels?
service/src/src/handlers/instagram.ts Consolidated two separate patterns (duplicate location)
service/README.md Added /instagram/reels/{shortcode} to documented API endpoints
service/src/README.md Added /instagram/reels/{shortcode} to documented API endpoints (duplicate location)
main.py Updated Python regex pattern to support both URL formats

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant