脚本代码如下
https://raw.githubusercontent.com/MoeClub/Pixiv/master/pixiv.py
workflows代码如下
- # This workflow will install Python dependencies, run tests and lint with a single version of Python
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
-
- name: Python application
-
- on:
- schedule:
- – cron: "15 11 * * *"
-
- jobs:
- build:
-
- runs-on: ubuntu-latest
-
- steps:
- – uses: actions/[email protected]
- – name: Set up Python 3.10
- uses: actions/[email protected]
- with:
- python-version: "3.10"
- – name: Install dependencies
- run: |
- python -m pip install –upgrade pip
- pip install flake8 pytest
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- – name: download pic
- run: |
- python3 pixiv.py "https://www.pixiv.net/ranking.php?mode=male"
- – name: upload tg
- run: |
- TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- chat_ID=xxxxxxxxx
- for i in PixivImage/*
- do
- curl -F chat_id=$chat_ID -F [email protected]"$i" https://api.telegram.org/bot$TOKEN/sendPhoto
- curl -F chat_id=$chat_ID -F [email protected]"$i" https://api.telegram.org/bot$TOKEN/sendDocument
- rm -rf $i
- done
复制代码
TOKEN和chat_ID都要改成你自己的
需要改其他图片类型修改这句
python3 pixiv.py "https://www.pixiv.net/ranking.php?mode=male"
这是我搭出来的效果,每日自动下载上传,配置一次就不用管了
https://t.me/pixivc
|