Skip to content

Commit

Permalink
[instagram] use REST API endpoint for saved posts (#2911)
Browse files Browse the repository at this point in the history
provides 'username' and 'fullname'
as well as higher-quality images
  • Loading branch information
mikf committed Sep 21, 2022
1 parent 50e3179 commit 6737499
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions gallery_dl/extractor/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,16 @@ def posts(self):
class InstagramSavedExtractor(InstagramExtractor):
"""Extractor for ProfilePage saved media"""
subcategory = "saved"
pattern = USER_PATTERN + r"/saved/?$"
test = ("https://www.instagram.com/instagram/saved/",)
pattern = USER_PATTERN + r"/saved(?:/all-posts)?/?$"
test = (
("https://www.instagram.com/instagram/saved/"),
("https://www.instagram.com/instagram/saved/all-posts/"),
)

def posts(self):
query_hash = "2ce1d673055b99250e93b6f88f878fde"
variables = {"id": self._uid_by_screen_name(self.item), "first": 50}
return self._pagination_graphql(query_hash, variables)
endpoint = "/v1/feed/saved/posts/"
for item in self._pagination_api(endpoint):
yield item["media"]


class InstagramCollectionExtractor(InstagramExtractor):
Expand Down

0 comments on commit 6737499

Please sign in to comment.