Skip to content

Commit

Permalink
Support /reels/ links
Browse files Browse the repository at this point in the history
  • Loading branch information
stekc committed Sep 18, 2024
1 parent 0577ad7 commit 040c942
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cogs/socials.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, bot):
r"https:\/\/(www\.)?((vm|vt)\.tiktok\.com\/[A-Za-z0-9]+|tiktok\.com\/@[\w.]+\/(video|photo)\/[\d]+\/?|tiktok\.com\/t\/[a-zA-Z0-9]+\/)"
)
self.instagram_pattern = re.compile(
r"(https:\/\/(www.)?instagram\.com\/(?:p|reel)\/([^/?#&]+))\/"
r"(https:\/\/(www.)?instagram\.com\/(?:p|reel|reels)\/([^/?#&]+))\/"
)
self.reddit_pattern = re.compile(
r"(https?://(?:www\.)?(?:old\.)?reddit\.com/r/[A-Za-z0-9_]+/(?:comments|s)/[A-Za-z0-9_]+(?:/[^/ ]+)?(?:/\w+)?)|(https?://(?:www\.)?redd\.it/[A-Za-z0-9]+)"
Expand Down Expand Up @@ -503,7 +503,7 @@ async def fix_instagram(
link = link.replace("www.", "")
link = link.replace("instagram.com", self.config["instagram"]["url"])

if "/reel/" in link:
if "/reel/" or "/reels/" in link:
link = link.replace(
self.config["instagram"]["url"], "d." + self.config["instagram"]["url"]
)
Expand Down

0 comments on commit 040c942

Please sign in to comment.