[instagram] use 'reel' subcategory for '/reel/CODE' URLs (#8274)

This commit is contained in:
Mike Fährmann
2025-10-01 10:05:22 +02:00
parent bcefcd5ae1
commit eb4c159f36
2 changed files with 10 additions and 4 deletions

View File

@@ -453,11 +453,16 @@ class InstagramPostExtractor(InstagramExtractor):
"""Extractor for an Instagram post"""
subcategory = "post"
pattern = (r"(?:https?://)?(?:www\.)?instagram\.com"
r"/(?:share/()|[^/?#]+/)?(?:p|tv|reels?)/([^/?#]+)")
r"/(?:share/()|[^/?#]+/)?(?:p|tv|reels?())/([^/?#]+)")
example = "https://www.instagram.com/p/abcdefg/"
def __init__(self, match):
if match[2] is not None:
self.subcategory = "reel"
InstagramExtractor.__init__(self, match)
def posts(self):
share, shortcode = self.groups
share, reel, shortcode = self.groups
if share is not None:
url = text.ensure_http_scheme(self.url)
headers = {