[instagram] support '/share/SHORTCODE' URLs (#8340)
i.e. "bare" /share/ links
This commit is contained in:
@@ -436,7 +436,8 @@ class InstagramExtractor(Extractor):
|
||||
return cursor
|
||||
|
||||
def _update_cursor(self, cursor):
|
||||
self.log.debug("Cursor: %s", cursor)
|
||||
if cursor:
|
||||
self.log.debug("Cursor: %s", cursor)
|
||||
self._cursor = cursor
|
||||
return cursor
|
||||
|
||||
@@ -461,16 +462,18 @@ 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?()))?"
|
||||
r"|(?:[^/?#]+/)?(?:p|tv|reels?()))"
|
||||
r"/([^/?#]+)")
|
||||
example = "https://www.instagram.com/p/abcdefg/"
|
||||
|
||||
def __init__(self, match):
|
||||
if match[2] is not None:
|
||||
if match[2] is not None or match[3] is not None:
|
||||
self.subcategory = "reel"
|
||||
InstagramExtractor.__init__(self, match)
|
||||
|
||||
def posts(self):
|
||||
share, reel, shortcode = self.groups
|
||||
share, _, _, shortcode = self.groups
|
||||
if share is not None:
|
||||
url = text.ensure_http_scheme(self.url)
|
||||
headers = {
|
||||
|
||||
Reference in New Issue
Block a user