Giter Club home page Giter Club logo

shopee-coins-bot's Introduction

蝦皮簽到機器人

release unittests docker ghcr

Important

蝦皮的登入驗證程序不時更新且越來越嚴格,維護登入步驟花費不少時間與力氣。正在實驗的新版 (v2) 機器人將不會再支援使用帳號密碼登入,而是改用與 pinkoi 簽到機器人同樣的人工給予 cookie 的方式。新版機器人會在九月釋出,屆時當前 (v1) 的機器人將會停止維護。

💰💰 簽到蝦皮領蝦幣 💰💰

這支程式針對台灣的蝦皮用戶設計,也就是 shopee.tw 網站的使用者。其他國家沒試過。

使用方式

這支程式需要用到 dockerpodman

機器人已經包成容器,映像位於 Docker Hub hyperbola/shopee-coins-bot 以及 GitHub Container Registry ghcr.io/wdzeng/shopee-coins-bot。 支援 amd64、arm64(樹梅派 4)以及 armv7。

Tags

以下為映像最新的 tag。其他可用的 tag 請參考 Docker Hub 或 GitHub Container Registry 頁面。

  • latest, 1, 1.3, 1.3.1

使用說明

傳入 --help 可以印出使用說明。

docker run hyperbola/shopee-coins-bot:1 --help

帳號密碼登入

第一次使用時,需要提供蝦皮帳號密碼,並且強烈建議設定機器人登入後儲存 cookie 的位置,以備未來機器人能夠執行自動登入。如果你不指定一個 cookie 的位置,那未來每次登入都會需要帳號與密碼。

docker run -v /path/to/somewhere:/cookie \
    hyperbola/shopee-coins-bot:1 -u username -p password -c /cookie

Important

機器人進行登入期間,你可能會收到來自 shopee 的 Email 或手機驗證簡訊,其中會有一個驗證登入的連結。請在 10 分鐘內進行驗證,在這期間機器人會等你。一旦你點了驗證簡訊後,機器人會立即繼續執行下去。

自動登入

如果之前有儲存過 cookie,用 cookie 登入即可,這樣就不會觸發簡訊驗證。

docker run -v /path/to/somewhere:/cookie hyperbola/shopee-coins-bot:1 -c /cookie

參數

所有參數都是選填。

  • -u, --user <STRING>: 蝦皮帳號;可以是手機、電子信箱或蝦皮 ID
  • -p, --pass <STRING>: 蝦皮密碼 DEPRECATED
  • -P, --path-to-pass <FILE>: 密碼檔案
  • -c, --cookie <FILE>: cookie 檔案
  • -i, --ignore-password: 不要儲存密碼 DEPRECATED
  • -x, --no-sms: 如果觸發簡訊驗證,直接令程式以失敗結束;預設為 false
  • -y, --no-email: 如果觸發電子郵件驗證,直接令程式以失敗結束;預設為 false
  • -f, --force: 如果今天已經領過蝦幣,令程式以成功作收;預設為 false
  • -q, --quiet: 不要印出訊息;但仍會印出警告與錯誤訊息
  • -s, --screenshot <DIR>: 簽到失敗時將螢幕截圖的儲存於指定資料夾下(圖檔檔名 為 screenshot.png)
  • -V, --version: 印出版本
  • -h, --help: 印出參數說明

如果你同時設定了帳號、密碼與 cookie,機器人會以下列順序嘗試登入:

  1. cookie
  2. 帳號與密碼

每次登入成功時,機器人就會將 cookie 更新至最新狀態。

Important

Cookie 是機密資料,請妥善保存。

Cookie 檔案的位置以下列優先順序決定。

  1. 環境變數 COOKIE
  2. 程式參數 --cookie

帳號以下列優先順序決定。

  1. 環境變數 USERNAME
  2. 程式參數 --user

密碼以下列優先順序決定。

  1. 環境變數 PASSWORD
  2. 程式參數 --pass DEPRECATED
  3. 環境變數 PATH_PASS
  4. 程式參數 --path-to-pass

Exit Code

Exit code 解釋
0 簽到成功。
1 今日已簽到。如果傳了 --force 參數,那就會改為回傳 0。
2 需要簡訊驗證,但你傳了 --no-sms 參數。
3 機器人遇到拼圖遊戲。這通常是因為嘗試登入次數太多,被網站 ban 掉。
4 操作逾時。
5 觸發電子郵件驗證。機器人尚不支援。 DEPRECATED
6 使用者進行簡訊驗證時選擇拒絕機器人登入。
7 需要電子郵件驗證,但你傳了 --no-email 參數。
69 嘗試登入次數太多被 ban。
77 參數不合法。
87 帳號或密碼錯誤。
88 不明錯誤。

姊妹機器人

shopee-coins-bot's People

Contributors

wdzeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shopee-coins-bot's Issues

Operation timeout exceeded.

Status: Downloaded newer image for hyperbola/shopee-coins-bot:1
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.
Start to load cookies.
Failed to load cookies: EACCES: permission denied, open '/cookie'
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Operation timeout exceeded.

試了好幾次,一直收不到簡訊。

我用其它電腦登入蝦皮時,在等簡訊頁面 60 秒後,再點選再次發送簡訊才馬上收到 1 封,是不是蝦皮故意的?

無法儲存 cookie

image

使用 win10 WSL2 跑 docker。
讀取 cookie 時出現 Failed to load cookies: EISDIR: illegal operation on a directory, read 寫入則是Failed to save cookie: EISDIR: illegal operation on a directory, open '/app/cookie'

每天自動登入卡在每週一重新驗證帳號密碼畫面

每天自動執行,但每週一都會卡在重新驗證帳號密碼。

平常自動執行的日誌:

Start shopee coins bot v1.1.0.
Start to load cookies.
Cookies loaded.
Start to login shopee.
Already logged in.
Start to save cookie.
Cookie saved.
Coin received.

每週一卡住的日誌:

Start shopee coins bot v1.1.0.
Start to load cookies.
Cookies loaded.
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Operation timeout exceeded.

另為了截圖,把 cookie 刪除後,重新用帳號密碼執行,卡在登入畫面。

日誌:

Start shopee coins bot v1.1.0.
No cookies given. Will try to login using username and password.
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
A screenshot has been put at /sc/screenshot.png.
Operation timeout exceeded.

畫面:
123

執行機種:
Synology DS918+ 版本: 7.1-42661 Update 4 (實體記憶體16GB)
Docker 套件版本: 20.10.3-1308

cookie 檔案問題

抱歉,想請教一下,我有用帳號密碼並透過簡訊認證登入成功,但想嘗試以 cookie 登入時卻都無法成功。

想請教您說需儲存 cookie 的位置,但我在執行以下兩行時,卻噴錯了,請問是否有更詳細的教學呢?

docker run -it -v /path/to/somewhere:/cookie \
    hyperbola/shopee-coins-bot:1 -u username -p password -c /cookie

登入逾時,沒收到簡訊或信件通知

[root@test ~]# docker run -v /www/shopee/coin:/cookie hyperbola/shopee-coins-bot:1 -u username-p password-c /cookie
Start shopee coins bot v1.3.1.
Passing password from command line is considered insecure. Should use environment variable or password file.
Option `--pass` is deprecated and will be removed in the future.
Start to load cookies.
Failed to load cookies: Unexpected end of JSON input
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Operation timeout exceeded.

Try puppeteer

Not sure if puppeteer has higher performance or less size, give it a try.

Failed to load cookies: EISDIR: illegal operation on a directory, read

docker run -it -v ~/cookie/coin:/cookie hyperbola/shopee-coins-bot:1 -u 'username' -p 'password' -c /cookie
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.
Start to load cookies.
Failed to load cookies: EISDIR: illegal operation on a directory, read
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Login failed: wrong password.

已经确定密码无误,但还是不让进。

Unexpected end of JSON input 這問題是?

指令如下,也在 cookie 用 touch 建立 coin 檔案 。

docker run -it -v ~/cookie/coin:/cookie hyperbola/shopee-coins-bot:1 -u '' -p '' -c /cookie

會出現 Unexpected end of JSON input

Start shopee coins bot v1.1.0.
Start to load cookies.
Failed to load cookies: Unexpected end of JSON input
Start to login shopee.
Failed to login. Missing username or password.

用的是甲骨文的 ARM。

蝦皮官網頁面更新而無法簽到

04/15 網友反映無法簽到。

Author: @ray1025

今日連續發生3次,都是卡在這畫面。

screenshot

第1次,用cookie: Start shopee coins bot v1.2.0. Start to load cookies. Cookies loaded. Start to login shopee. Already logged in. Start to save cookie. Cookie saved. A screenshot has been put at /screenshot/screenshot.png. Operation timeout exceeded. Error: 操作逾時。 Error: Process completed with exit code 4.

第2、3次,改用帳密: Start shopee coins bot v1.2.0. Start to load cookies. Failed to load cookies: ENOENT: no such file or directory, open '/repo/plain_credential' Start to login shopee. Try to login by username and password. Login form submitted. Waiting for redirect. Login failed: please login via SMS. An SMS message is sent to your mobile. Once you click the link I will keep going. I will wait for you and please complete it in 10 minutes. Login permitted. Start to save cookie. Cookie saved. A screenshot has been put at /screenshot/screenshot.png. Operation timeout exceeded. Error: 操作逾時。 Error: Process completed with exit code 4.

Author: @jrchen982

@ray1025 我狀況跟你一樣耶,換主機跑也都失敗。

我在猜是不是因為簽到 button 上顯示的名字換了,現在顯示 完成簽到,即可獲得 XX 蝦幣!,如果有簽過,會顯示 明天再回來簽到,可獲得 XX 蝦幣!,根據 @wdzeng 大神的原始碼來看,好像原本顯示的文字應該是 今日簽到獲得,而如果已經簽到過,原本應該會顯示 明天再回來領取

不曉得是不是這樣導致 bot 抓不到按鈕而操作逾時。

docker部屬和參數詢問

你好
請問一下有沒有比較詳細教學的影片或文章
我現在已我的Ubuntu上下載好了(已經有安裝Docker和Portainer
我不確定下一步需要如何做

docker 在 Windows 上無法設定 cookie 位置

您好,windows 系統下我以系統管理員權限之 cmd 輸入

docker run -it -v //c/cookie hyperbola/shopee-coins-bot:1 -u xxxxxx -p xxxxxxx -c /cookie

會出現以下訊息。

Passing password from command line is considered insecure. Should use environment variable or password file.
Start to load cookies.
Failed to load cookies: ENOENT: no such file or directory, open '/cookie'
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Login failed: please login via SMS.
An SMS message is sent to your mobile. Once you click the link I will keep going. I will wait for you and please complete it in 10 minutes.
Login permitted.
Start to save cookie.
Failed to save cookie: EACCES: permission denied, open '/cookie'
Coin already received.

請問是否是 cookie 位置問題,不過我記得 -v 會自動創建。
或是要先新增 cookie 檔,如果是要先新增 cookie 檔,請問該如何新增呢?

PS:感謝大大的開發,期待此 docker 有人發圖文教學,謝謝!

這周開始無法使用 Login failed: need email Auth

沒收到驗證簡訊或者郵件

docker run -it -v "/root/shopee:/secret" hyperbola/shopee-coins-bot:1 -c /secret/shopee-cookie -u xxxxxx -p xxxxx -s /root/shopee -f
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.
Start to load cookies.
Cookies loaded.
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Login failed: need email Auth
Failed to save screenshot: EACCES: permission denied, open '/root/shopee/screenshot.png'

Add unittests for driver

Add a unittest to check that headless browser is sending correct headers and hiding automation characteristics.

[v2] Open API

Current this project is only a runnable program in docker. Rewrite the project such that external user can use this project to get metadata or to provide actions.

API

  • getUser: get the current login user
  • hasCheckin: check if the user has checkin today
  • getWeeklyCheckinStatus: get the checkin status this week
  • getTotalCoins: get the user's total coin amount
  • login: login to Shopee
  • checkin: checkin and receive Shopee coin

新增對 arm64 架構的支援

我執行首次啟動命令

❯ docker run -it -v /path/to/local:/cookie hyperbola/shopee-coins-bot:1 -u username -p password -c /cookie
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.

❯ docker ps -a
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                      PORTS                    NAMES
a400a4e93420   hyperbola/shopee-coins-bot:1   "tini -- node index.…"   10 seconds ago   Exited (88) 7 seconds ago                            busy_lalande

之後我加上 --platform 參數

❯ docker run -it -v /path/to/local:/cookie --platform linux/amd64 hyperbola/shopee-coins-bot:1 -u username -p password -c /cookie
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.

❯ docker ps -a
CONTAINER ID   IMAGE                          COMMAND                  CREATED              STATUS                           PORTS                    NAMES
cac46630e4c7   hyperbola/shopee-coins-bot:1   "tini -- node index.…"   6 seconds ago        Exited (88) 3 seconds ago                                 admiring_swanson

❯ docker logs -f cac46630e4c7
Start shopee coins bot v1.0.17.
Passing password from command line is considered insecure. Should use environment variable or password file.

Environment:
Apple Silicon M1 Max, macOS 12.4
Docker version 20.10.16, build aa7e414

機器人在部分機器上 Operation timeout

這幾天開始好像無法運作了?
用 docker 的 latest 跟 kelly 都會卡在 redirection
Output 如下

Start shopee coins bot v1.1.0.
Passing password from command line is considered insecure. Should use environment variable or password file.
Start to load cookies.
Cookies loaded.
Start to login shopee.
Try to login by username and password.
Login form submitted. Waiting for redirect.
Operation timeout exceeded.

[v2] cookie 時效問題

我連續使用v2版執行whoami、balance、history一個禮拜,結果第8天開始You are not logged in. Is your cookie expired?

Unable to login (Failed to save cookie: EISDIR:)

Thanks for great tool.

The issue:

root@123456:~# sudo docker run -it -v /root:/cookie hyperbola/shopee-coins-bot:1 -u username -p password -c /cookie
Passing password from command line is consider insecure. Use environment variable or password file instead.
Try to login by username and password.
Login failed: please login via SMS.
An SMS message is sent to your mobile. Please click the link in 10 minutes. I will wait for you...
Login permitted.
Failed to save cookie: EISDIR: illegal operation on a directory, open '/cookie'
Coin already received.

因為被偵測自動化程式而簽到失敗

最近 bot 都有成功,但是蝦幣都無法領到,在不同天時有嘗試過切換 IP 也沒用,研判蝦皮有加入裝置的認證機制,一個裝置一天可能只領一次。docker 打包檔的裝置資訊有辦法設定隨機嗎?

新增對 arm/v7 架構的支援

wdzeng 您好,

我嘗試在docker上安裝時得到反饋:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested

請問是否有機會製作 arm 架構下可用的 image 呢?

目前使用環境是 Raspberry Pi 4 Model B 8GB RAM。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.