163 字
1 分钟
Instagram-Bot——Instagram下载机器人
前言
因为Instagram的限制,我们无法直接下载其内容,因此有很多相关项目,比如在桌面浏览器使用很方便的theus/instantgram,还有本文要介绍的Instagram-Bot。
变量
Telegram
API_HASH:从APP获取API_ID:从APP获取BOT_TOKEN:从Bot获取OWNER_ID:从Telegram ID获取
INSTAGRAM_USERNAME:从Instagram获取INSTA_SESSIONFILE_ID:通过运行generate_instagram_session.py获取
安装
cd /usr/local/share/git clone https://github.com/subinps/Instagram-Botcd Instagram-Botpip3 install -r requirements.txt# 在config.py中设置合适的变量python3 main.py测试无误后Ctrl+C结束运行。
守护
chown -R nobody:nogroup /usr/local/share/Instagram-Botvi /etc/systemd/system/instagram-bot.servicesystemd文件示例如下:
[Unit]Description=Instagram-Bot serviceWants=network.target network-online.targetAfter=network.target network.service network-online.target
[Service]Type=simpleUser=nobodyWorkingDirectory=/usr/local/share/Instagram-BotExecStart=/usr/bin/python3 /usr/local/share/Instagram-Bot/main.pyRestartPreventExitStatus=23Restart=on-failureRestartSec=10
[Install]WantedBy=multi-user.target启动
systemctl enable instagram-bot.service --now Instagram-Bot——Instagram下载机器人
https://yushum.com/posts/instagram-bot-instagram下载机器人/