0

我正在尝试获取带有特定用户特定主题标签的媒体。相反,该 api 似乎为所有公共图像提供了不特定于帐户的主题标签。

这是使用我尝试过的主题标签获取媒体节点的 api:

{hashtag-id}/recent_media?user_id={iguserId}&fields=id,media_type,comments_count,like_count,caption

除了我需要的帐户媒体之外,这个还返回与该特定主题标签关联的公共图像。例如:我正在请求用户帐户中带有#xxxx 作为主题标签的图像。我期望该帐户的图像仅包含 xxxx 标记。但是,在回复中,我也收到了来自其他帐户的图像,这些图像具有相同的 #xxxx 主题标签。这个 api 似乎在全球范围内工作,我不明白 api 中“user_id”参数的使用。

4

1 回答 1

-1

看看这个API。使用非常简单,您可以从主题标签获取媒体并指定一个帐户。这将帮助您获取 Instagram 企业帐户的所有帖子。

Python 3.x 实现:

import instaloader

# Get instance

L = instaloader.Instaloader()

#Load the UserName

profile = instaloader.Profile.from_username(L.context, USERNAME)

#Read the profile posts and downloads those containing the hashtags

for i in profile.get_posts():
    if HASHTAG in i.caption_hashtags:
        L.download_post(i, target=DIRECTORY_NAME)
于 2019-06-20T08:34:11.130 回答