[instagram] add 'profile' extractor (#5262)

https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2188915210
This commit is contained in:
Mike Fährmann
2024-06-28 22:51:20 +02:00
parent ea81fa985f
commit 44896b0296
4 changed files with 24 additions and 1 deletions

View File

@@ -596,6 +596,22 @@ class InstagramTagExtractor(InstagramExtractor):
return self.api.tags_media(self.item)
class InstagramProfileExtractor(InstagramExtractor):
"""Extractor for an Instagram user's profile data"""
subcategory = "profile"
pattern = USER_PATTERN + r"/profile"
example = "https://www.instagram.com/USER/profile/"
def items(self):
screen_name = self.item
if screen_name.startswith("id:"):
user = self.api.user_by_id(screen_name[3:])
else:
user = self.api.user_by_name(screen_name)
return iter(((Message.Directory, user),))
class InstagramAvatarExtractor(InstagramExtractor):
"""Extractor for an Instagram user's avatar"""
subcategory = "avatar"