在Python模块中使用InstaLoader [英] Using InstaLoader in Python module

查看:70
本文介绍了在Python模块中使用InstaLoader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试下载与主题标签相关的照片,以便使用Instaloader进行图像分析.我在GitHub存储库中找到了一种综合方法,即如何在Terminal中执行它.但是,我需要将脚本集成到Python笔记本中.

I am trying to download photos related to a hashtag for image analysis using Instaloader. I found a comprehensive way in GitHub repository, how to execute it in Terminal. However, I need to integrate the script in Python notebook.

这是脚本: $ instaloader --no-videos --no-metadata-json --no-captions"#streetart"

我尝试过:

import instaloader
loader = instaloader.Instaloader()
loader.download_hashtag('amg', max_count=20)

但是我找不到一种方法来过滤结果以仅返回图片作为输出.有人可以帮我吗?

But I could not find a way to filter the results to return pictures only as output. Can anybody help me please?

非常感谢.

推荐答案

import instaloader

loader = instaloader.Instaloader(download_videos=False, save_metadata=False, post_metadata_txt_pattern='')
loader.download_hashtag('streetart', max_count=20)

这篇关于在Python模块中使用InstaLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆