├── README.md ├── .github └── workflows │ └── main.yml ├── .gitignore ├── zodgame └── zodgame.py └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | 自己写的一些签到脚本 2 | 3 | 4 | # 如果论坛开启Cloudflare质询会无法签到 5 | # 如果论坛开启Cloudflare质询会无法签到 6 | # 如果论坛开启Cloudflare质询会无法签到 7 | 8 | 列表: 9 | 10 | zodgame 11 | 12 | 13 | ## 部署自动签到--------------- 14 | 15 | ### 1. 添加 Cookie 至 Secrets 16 | 17 | - 首先通过F12抓取到Cookie,随后在项目页面,依次点击`Settings`-->`Secrets`-->`New secret` 18 | 19 | ![new-secret.png](https://i.loli.net/2020/10/28/sxTuBFtRvzSgUaA.png) 20 | 21 | - 建立名为`COOKIE`的 secret,值为`步骤1`中复制的`Cookie`内容,最后点击`Add secret` 22 | 23 | - secret名字必须为`COOKIE`! 24 | - secret名字必须为`COOKIE`! 25 | - secret名字必须为`COOKIE`! 26 | 27 | ![add-secret](https://i.loli.net/2020/10/28/sETkVdmrNcCUpgq.png) 28 | 29 | ### 2. 启用 Actions 30 | 31 | > Actions 默认为关闭状态,Fork 之后需要手动执行一次,若成功运行其才会激活。 32 | 33 | 返回项目主页面,点击上方的`Actions`,再点击左侧的`Genshin Impact Helper`,再点击`Run workflow` 34 | 35 | ![run](https://i.loli.net/2020/10/28/5ylvgdYf9BDMqAH.png) 36 | 37 | 38 | 39 | 至此,部署完毕。 40 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: "zodgame" 2 | 3 | on: 4 | schedule: 5 | - cron: "18 1 * * *" # scheduled at 06:00 (UTC+8) everyday 6 | workflow_dispatch: 7 | 8 | env: 9 | # auto merge from y1ndan/genshin-impact-helper, default: false 10 | ALLOW_MERGE: 'false' 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | # if: github.ref == 'refs/heads/master' 16 | 17 | steps: 18 | 19 | - name: Checkout master 20 | uses: actions/checkout@v2 21 | with: 22 | fetch-depth: 0 23 | ref: main 24 | 25 | 26 | - name: Set up python 27 | uses: actions/setup-python@v2 28 | with: 29 | python-version: 3.8 30 | 31 | - name: Random sleep 32 | if: github.event_name == 'schedule' 33 | run: sleep $(shuf -i 10-300 -n 1) 34 | 35 | - name: Run sign 36 | run: | 37 | python -m pip install --upgrade pip 38 | pip install requests 39 | ls -a 40 | python3 ./zodgame/zodgame.py '${{ secrets.COOKIE }}' 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /zodgame/zodgame.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import re 3 | import sys 4 | 5 | cookie = sys.argv[1] 6 | 7 | print('测试') 8 | print(cookie) 9 | 10 | # tgbot机器人配置,为空为不启用 11 | bottoken = '' 12 | chatid = '' 13 | 14 | headers = { 15 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' 16 | 'Chrome/88.0.4324.146 Safari/537.36 ', 17 | 'cookie': cookie 18 | } 19 | 20 | 21 | def get_user_info(): 22 | # 获取积分 23 | s = requests.Session() 24 | user_url = 'https://zodgame.xyz/home.php?mod=spacecp&ac=credit' 25 | try: 26 | user_r = s.get(url=user_url, headers=headers) 27 | user_page = user_r.text.encode( 28 | user_r.encoding).decode(user_r.apparent_encoding) 29 | # print(user_page) 30 | user_info_re = '.*title="访问我的空间">(.*?).*