mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[instagram] add 'profile' extractor (#5262)
https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2188915210
This commit is contained in:
parent
ea81fa985f
commit
44896b0296
@ -430,7 +430,7 @@ Consider all listed sites to potentially be NSFW.
|
||||
<tr>
|
||||
<td>Instagram</td>
|
||||
<td>https://www.instagram.com/</td>
|
||||
<td>Avatars, Collections, Followed Users, Guides, Highlights, Posts, Reels, Saved Posts, Stories, Tag Searches, Tagged Posts, User Profiles</td>
|
||||
<td>Avatars, Collections, Followed Users, Guides, Highlights, Posts, User Profile Data, Reels, Saved Posts, Stories, Tag Searches, Tagged Posts, User Profiles</td>
|
||||
<td><a href="https://github.com/mikf/gallery-dl#cookies">Cookies</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -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"
|
||||
|
@ -166,6 +166,7 @@ SUBCATEGORY_MAP = {
|
||||
"media" : "Media Files",
|
||||
"note" : "Images from Notes",
|
||||
"popular": "Popular Images",
|
||||
"profile": "User Profile Data",
|
||||
"recent" : "Recent Images",
|
||||
"search" : "Search Results",
|
||||
"status" : "Images from Statuses",
|
||||
|
@ -132,6 +132,12 @@ __tests__ = (
|
||||
"#count" : ">= 16",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.instagram.com/instagram/profile",
|
||||
"#category": ("", "instagram", "profile"),
|
||||
"#class" : instagram.InstagramProfileExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.instagram.com/instagram/avatar",
|
||||
"#category": ("", "instagram", "avatar"),
|
||||
|
Loading…
Reference in New Issue
Block a user