1
0
mirror of https://github.com/instaloader/instaloader.git synced 2025-01-31 11:51:35 +01:00

Fix download hashtags

Closes #2144.
This commit is contained in:
Alexander Graf 2025-01-24 08:16:43 +01:00
parent 4264d40f19
commit 0bc91b722e
3 changed files with 5 additions and 2 deletions

View File

@ -99,7 +99,7 @@ Instaloader supports the following targets:
to **download IGTV videos**.
- ``"#hashtag"``
Posts with a certain **hashtag** (the quotes are usually necessary).
Posts with a certain **hashtag** (the quotes are usually necessary). Requires :ref:`login<login>`.
- ``%location id``
Posts tagged with a given location; the location ID is the numerical ID

View File

@ -1215,6 +1215,7 @@ class Instaloader:
Use :meth:`Hashtag.get_posts_resumable`."""
return Hashtag.from_name(self.context, hashtag).get_posts_resumable()
@_requires_login
def download_hashtag(self, hashtag: Union[Hashtag, str],
max_count: Optional[int] = None,
post_filter: Optional[Callable[[Post], bool]] = None,

View File

@ -1862,7 +1862,9 @@ class Hashtag:
return self._node["name"].lower()
def _query(self, params):
json_response = self._context.get_json("explore/tags/{0}/".format(self.name), params)
json_response = self._context.get_iphone_json(
"api/v1/tags/web_info/", {**params, "tag_name": self.name}
)
return json_response["graphql"]["hashtag"] if "graphql" in json_response else json_response["data"]
def _obtain_metadata(self):