全球主机交流论坛

标题: github actions每日自动上传图片到tg群组 [打印本页]

作者: etc小号    时间: 2022-1-4 19:55
标题: github actions每日自动上传图片到tg群组
脚本代码如下

https://raw.githubusercontent.com/MoeClub/Pixiv/master/pixiv.py

workflows代码如下

  1. # This workflow will install Python dependencies, run tests and lint with a single version of Python
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

  3. name: Python application

  4. on:
  5.   schedule:
  6.   - cron: "15 11 * * *"

  7. jobs:
  8.   build:

  9.     runs-on: ubuntu-latest

  10.     steps:
  11.     - uses: actions/checkout@v2
  12.     - name: Set up Python 3.10
  13.       uses: actions/setup-python@v2
  14.       with:
  15.         python-version: "3.10"
  16.     - name: Install dependencies
  17.       run: |
  18.         python -m pip install --upgrade pip
  19.         pip install flake8 pytest
  20.         if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  21.     - name: download pic
  22.       run: |
  23.         python3 pixiv.py "https://www.pixiv.net/ranking.php?mode=male"
  24.     - name: upload tg
  25.       run: |
  26.         TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx       
  27.         chat_ID=xxxxxxxxx
  28.         for i in PixivImage/*
  29.         do   
  30.         curl -F chat_id=$chat_ID -F photo=@"$i" https://api.telegram.org/bot$TOKEN/sendPhoto
  31.         curl -F chat_id=$chat_ID -F document=@"$i" https://api.telegram.org/bot$TOKEN/sendDocument
  32.         rm -rf $i
  33.         done
复制代码


TOKEN和chat_ID都要改成你自己的

需要改其他图片类型修改这句

python3 pixiv.py "https://www.pixiv.net/ranking.php?mode=male"

这是我搭出来的效果,每日自动下载上传,配置一次就不用管了


https://t.me/pixivc


作者: sagerking    时间: 2022-1-4 19:59
可还行

作者: aipage    时间: 2022-1-4 20:00
有什么用呢?还要下载下来
作者: etc小号    时间: 2022-1-4 20:01
aipage 发表于 2022-1-4 20:00
有什么用呢?还要下载下来

下载是github actions做的,配置好就不用管了

至于有什么用,我也不清楚
作者: 老猹    时间: 2022-1-4 20:03
前两天在翻萌咖大佬的dd脚本时也看见这个脚本了来着。
作者: qingxrong    时间: 2022-1-4 20:03
支持一下
作者: etc小号    时间: 2022-1-4 20:04
老猹 发表于 2022-1-4 20:03
前两天在翻萌咖大佬的dd脚本时也看见这个脚本了来着。

脚本项目在这,蛮好用的,虽然是三年前的项目了

https://github.com/MoeClub/Pixiv
作者: 幺鸡    时间: 2022-1-4 20:05
是拿来做图床还是干啥?













幺鸡杠上花
作者: mjj天下第一    时间: 2022-1-4 20:05
类似的
https://t.me/carry_AnimeWallpapers
作者: etc小号    时间: 2022-1-4 20:11
幺鸡 发表于 2022-1-4 20:05
是拿来做图床还是干啥?

就是把每日榜单下载到tg,算是满足收藏癖?

作者: Skywalker    时间: 2022-1-4 21:28
actions早tm给ban了
狗日的github也不给解封
就挂了个签到
作者: 海苔    时间: 2022-1-5 04:33
幺鸡 发表于 2022-1-4 20:05
是拿来做图床还是干啥?

老板头像有原图吗
作者: hjvn2211445    时间: 2022-1-5 06:23
已给91脚本加上,应该50M以下都能发到tg

作者: cqcyx    时间: 2022-1-5 07:04
etc小号 发表于 2022-1-4 20:11
就是把每日榜单下载到tg,算是满足收藏癖?

好东西啊,这个每日榜单是指定tg某个群组的榜单吗
作者: etc小号    时间: 2022-1-5 07:29
cqcyx 发表于 2022-1-5 07:04
好东西啊,这个每日榜单是指定tg某个群组的榜单吗

pixiv这个站的图片
作者: yushui    时间: 2022-1-5 08:02
能不能只下载发送r18的呢
作者: etc小号    时间: 2022-1-5 08:31
yushui 发表于 2022-1-5 08:02
能不能只下载发送r18的呢

修改这个
https://www.pixiv.net/ranking.php?mode=male
作者: cyz971337    时间: 2022-1-5 08:41
etc小号 发表于 2022-1-5 08:31
修改这个
https://www.pixiv.net/ranking.php?mode=male

如果修改其他网站以后,脚本是下午网站所有内容吗?怎么像你说的下载排行榜的
作者: 幺鸡    时间: 2022-1-5 10:18
海苔 发表于 2022-1-5 04:33
老板头像有原图吗

https://cdn.jsdelivr.net/gh/xindada888/image@main/11-18-04-21-1609201G052536.jpg
作者: 海苔    时间: 2022-1-5 10:49
幺鸡 发表于 2022-1-5 10:18
https://cdn.jsdelivr.net/gh/xindada888/image@main/11-18-04-21-1609201G052536.jpg

谢谢!




欢迎光临 全球主机交流论坛 (https://loc.888543.xyz/) Powered by Discuz! X3.4