另一个没有api的instagram图片和视频下载程序
instalooter的Python项目详细描述
不是所有宝藏的金银,伙计。
Instalooter是一个可以下载任何相关图片或视频的程序 从Instagram配置文件,没有任何API访问。它可以被看作 重新实现现已弃用的InstaRaider 由@akurtovic开发。
v1.0.0完全从头重写,因此,will 可能会破坏与自制脚本的兼容性。同时,非常小心 使cli尽可能与以前的版本保持一致, 所以希望能有家的感觉。
要求
安装
在pypi上可以使用pip安装instalooter。如果你不是 熟悉python生态系统的包管理,请参见 Installation page 在documentation中。 但是,您可能最终会使用以下命令:
pip install --user instalooter --pre
用法
instalooter自带cli:
$ instalooter user <username> [<directory>] [options] $ instalooter hashtag <hashtag> [<directory>] [options] $ instalooter post <post_token> [<directory>] [options] $ instalooter batch [<batch_file>]
有关所有可能的用途,请参见instalooter --usage,或instalooter --help 完整的使用指南。
登录和注销
有两种方法可以通过Instalooter登录Instagram:
- 使用login子命令(instalooter login)以交互方式登录 使用您的用户名和密码。
- 给一个--username(如果需要,还可以给一个--password)参数 下载命令。
在这两种情况下,都将在特定于缓存的文件夹中创建会话cookie。 要删除它并关闭服务器上的会话,请使用logout 子命令。
示例
从当前目录中的instagram配置文件下载所有图片:
$ instalooter user instagram
下载最新的20张标有python的图片或视频到/tmp:
$ instalooter hashtag python /tmp -n 20 -v -c MYLOGIN
从~/pictures目录中的url下载一篇文章:
$ instalooter post "https://www.instagram.com/p/BFB6znLg5s1/" ~/Pictures
使用配置文件使用自定义参数从多个帐户下载 (见Batch mode):
$ instalooter batch /path/to/a/config/file.ini
有关Usage page的详细信息 在online documentation中。