用 InstaPy 打造 Instagram Bot 吧

Alan Syue
3 min readMar 15, 2020

--

記得在前公司工作的時候,絞盡腦汁研究如何提高 Instagram 帳號的 follower,那時候剛好查到這篇文章: My open source Instagram bot got me 2,500 real followers for $5 in server costs ,內容大致上是作者用自己開發的 Script 主動對相關 tag 的 user、相關 account 的 follower 進行互動,只花費了 $5 美元 server 費用就獲得 2500 追蹤。

當時看完覺得蠻有趣的,就把它 clone 回來試試看。InstaPy 是用 Selenium 來操作 Instagram 帳號做到 like, follow, comment 這些功能 ( 我記得當時查了 Instagram 的官方文件,沒有相關的 api 可供使用 ),另外會儲存 cookie 幫助下次不需再輸入帳號密碼登入,也會存一些 log,像是哪些用戶已經 follow 過了,來讓機器人不會頻繁去 follow 他。

最近因為在幫忙推廣一個 IG 帳號,又重新回去研究,發現多了很多新的東西,像是 Dashboard, GUI, 還有一些之前沒有的 api。這次想分享我如何使用此工具:

下載 project

在 terminal 輸入 git clone https://github.com/timgrossmann/InstaPy.git

config 設定

開啟專案的 quickstart.py,找到 session = InstaPy(),在 InstaPy() 寫入 Instagram 帳號及密碼:

session = InstaPy(username="account username", password="password")

動作設定

接下來基本上只要參考官方 doc 的 api 並加在下方後,在 terminal 輸入 python quickstart.py 即可以開始運行。

分享一下我的使用方法

我常用的方法是透過自定義一組相關帳號的陣列 follow_list ,然後開始執行:

  1. 追蹤帳號的 follower
  2. 追蹤帳號 following 的 user
  3. 設定追蹤按過照片讚的 user
  4. 設定追蹤有留言過的 user 實驗了一下獲得的數據反饋是有 20% 被追蹤的 user 反過來追蹤我的 Instagram 帳號,猜測因為是挑選了跟自己帳號相關, TA 相近,所以被追蹤的機會也較高。

總結

透過原作者的實驗,我覺得 InstaPy 確實是自動化增長 follower 的一種可嘗試方式,研究後也覺得此專案很有趣。下一篇會跟大家分享如何將 InstaPy Docker 化。

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Alan Syue
Alan Syue

Written by Alan Syue

Backend Engineer at UPN | Love to share everything

No responses yet

Write a response