Compare commits
No commits in common. "d9fa17661947a60919e7651668c422749243baf5" and "39f7ff59b1b27ad971c2ee5247fe2aa9f6e367fb" have entirely different histories.
d9fa176619
...
39f7ff59b1
|
@ -17,13 +17,14 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event.repository.owner.id == github.event.sender.id # 自己点的 start
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Set up Python #安装python
|
- name: Set up Python #安装python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v1
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: 3.8
|
||||||
- name: Install requirements #安装轮子
|
- name: Install requirements #安装轮子
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
21
.github/workflows/MirrorSync.yml
vendored
21
.github/workflows/MirrorSync.yml
vendored
|
@ -1,21 +0,0 @@
|
||||||
name: 'SyncMirror'
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: 'Checkout codes'
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: 'Sync'
|
|
||||||
id: commit
|
|
||||||
run: |
|
|
||||||
git fetch --unshallow
|
|
||||||
git checkout master
|
|
||||||
git remote add gitea https://${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_PASSWORD }}@git.bili33.top/GamerNoTitle/wyycg-AutoCheckin.git
|
|
||||||
git push gitea master
|
|
||||||
|
|
76
README.md
76
README.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
请注意:关于LICENSE,在Apache-2.0的基础上增加一条:**禁止上传到CSDN等网站盈利,禁止放在某宝某鱼等平台贩卖**,否则官方找上门就**删库跑路**!
|
请注意:关于LICENSE,在Apache-2.0的基础上增加一条:**禁止上传到CSDN等网站盈利,禁止放在某宝某鱼等平台贩卖**,否则官方找上门就**删库跑路**!
|
||||||
|
|
||||||
仓库被封了就来这里找https://git.bili33.top/GamerNoTitle/wyycg-AutoCheckin
|
**本脚本从[@GamerNoTitle](https://github.com/GamerNoTitle)出Fork而来,源仓库已于2021.5.19删除(我也不知道为什么本仓库会成为源仓库,理论上应该所有人都是源仓库才对),具体请参照[关于得知Github查封Action仓库的信息后我自行删除脚本的这档事 #2](https://github.com/GamerNoTitle/GamerNoTitle/discussions/2)**
|
||||||
|
|
||||||
本脚本通过使用Github Action来进行[网易云游戏](https://cloudgame.webapp.163.com/newer.html?invite_code=2ZLPWY)签到操作,让你能够天天白嫖网易云游戏时长和云电脑!
|
本脚本通过使用Github Action来进行[网易云游戏](https://cloudgame.webapp.163.com/newer.html?invite_code=2ZLPWY)签到操作,让你能够天天白嫖网易云游戏时长和云电脑!
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@
|
||||||
## 目录
|
## 目录
|
||||||
|
|
||||||
- [使用方法](#使用方法)
|
- [使用方法](#使用方法)
|
||||||
- ~~[保活策略](#保活策略)~~
|
- [保活策略](#保活策略)
|
||||||
- [变量获取](#变量内容获取)
|
- [变量获取](#变量内容获取)
|
||||||
- ~~[脚本更新](#脚本更新)~~
|
- [脚本更新](#脚本更新)
|
||||||
- [Q&A](#qa)
|
- [Q&A](#qa)
|
||||||
|
|
||||||
## 使用方法
|
## 使用方法
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
1、Fork本仓库,按右上角的分支按钮(如图)
|
1、Fork本仓库,按右上角的分支按钮(如图)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2、进入设置,设置变量`cookie`和`teleid` `teletoken` `SCKEY` `QQKEY` `PPKEY`(这五个可选,但是`teleid`和`teletoken`要用的话就得两个都要配置!)
|
2、进入设置,设置变量`cookie`和`teleid` `teletoken` `SCKEY` `QQKEY` `PPKEY`(这五个可选,但是`teleid`和`teletoken`要用的话就得两个都要配置!)
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@
|
||||||
|
|
||||||
[如何获取变量内容?请点这里](#变量内容获取)
|
[如何获取变量内容?请点这里](#变量内容获取)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 测试脚本
|
### 测试脚本
|
||||||
|
|
||||||
|
@ -55,23 +55,35 @@
|
||||||
|
|
||||||
我们先进入Action界面,启用Action
|
我们先进入Action界面,启用Action
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
然后我们进入对应的脚本,启用脚本,并进行测试
|
然后我们进入对应的脚本,启用脚本,并进行测试
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
~~除了点STAR进行启动以外~~(现在STAR启动不了了),你也可以点击右边那个白白的按钮来启动
|
除了点STAR进行启动以外,你也可以点击右边那个白白的按钮来启动
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
**只要测试通过就是没问题,如果你配置了TELEGRAM还会收到你的BOT给你发送的消息**
|
**只要测试通过就是没问题,如果你配置了TELEGRAM还会收到你的BOT给你发送的消息**
|
||||||
|
|
||||||
测试通过后,你还需要创建保活需要用到的Github Token,详情可以看[保活策略](#保活策略)这一节(其实就在下面撒)
|
测试通过后,你还需要创建保活需要用到的Github Token,详情可以看[保活策略](#保活策略)这一节(其实就在下面撒)
|
||||||
|
|
||||||
## ~~保活策略~~ (新版Action可跳过,但是在设置里面的Action权限要放行写入权限!)
|
## 保活策略
|
||||||
|
|
||||||
因为Github Action在仓库60天内没有任何Push的时候会禁用你的Action,这时候我们就要进行保活
|
因为Github Action在仓库60天内没有任何Push的时候会禁用你的Action,这时候我们就要进行保活
|
||||||
|
|
||||||
保活Action已经写好了~~,但是这里有一些步骤是需要你进行的,请看下面的图片生成GITHUB_TOKEN以便让脚本造成的更改能够正常推送入你的仓库~~
|
保活Action已经写好了,但是这里有一些步骤是需要你进行的,请看下面的图片生成GITHUB_TOKEN以便让脚本造成的更改能够正常推送入你的仓库
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
到这里勾选完以后点绿绿的Generate token就可以了
|
||||||
|
|
||||||
|
**请注意:你无需在仓库的secrets内设置名为`GITHUB_TOKEN`的变量,该名称本身就是指定为自己账户下名为`GITHUB_TOKEN`的密钥,如果你在仓库的secrets内设置将会被Github提示无效**
|
||||||
|
|
||||||
## 变量内容获取
|
## 变量内容获取
|
||||||
|
|
||||||
|
@ -83,16 +95,20 @@
|
||||||
|
|
||||||
**如果使用多用户,多个cookie请使用`#`分隔**
|
**如果使用多用户,多个cookie请使用`#`分隔**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### teleid获取
|
### teleid获取
|
||||||
|
|
||||||
用你的Telegram找到@userinfobot,点个Start,会直接给你回复你的ID,复制下id后面的数字就是teleid了
|
用你的Telegram找到@userinfobot,点个Start,会直接给你回复你的ID,复制下id后面的数字就是teleid了
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### teletoken获取
|
### teletoken获取
|
||||||
|
|
||||||
找@BotFather进行机器人的创建,按照提示创建即可,会给你一个API TOKEN,如果一不小心点过去了可以用命令`/mybots`管理自己的bot,找到自己想要使用的bot并获取API就可以了
|
找@BotFather进行机器人的创建,按照提示创建即可,会给你一个API TOKEN,如果一不小心点过去了可以用命令`/mybots`管理自己的bot,找到自己想要使用的bot并获取API就可以了
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### SCKEY获取
|
### SCKEY获取
|
||||||
|
|
||||||
访问[ServerChanTurbo官网](https://sct.ftqq.com/),并用你的微信扫码登陆,获取推送用的KEY即可(因为我没有使用这个推送方法所以没有图)
|
访问[ServerChanTurbo官网](https://sct.ftqq.com/),并用你的微信扫码登陆,获取推送用的KEY即可(因为我没有使用这个推送方法所以没有图)
|
||||||
|
@ -113,6 +129,40 @@
|
||||||
|
|
||||||
访问[PushPlus官网](http://pushplus.hxtrip.com/),使用微信登录,直接在[一对一推送](http://pushplus.hxtrip.com/message)复制自己的Token填入变量即可!
|
访问[PushPlus官网](http://pushplus.hxtrip.com/),使用微信登录,直接在[一对一推送](http://pushplus.hxtrip.com/message)复制自己的Token填入变量即可!
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 脚本更新
|
||||||
|
|
||||||
|
### 自动更新
|
||||||
|
|
||||||
|
[点击这里](https://github.com/apps/pull)安装插件,可以选择所有仓库,也可以指选择你Fork的仓库(当然至少要选择fork的仓库对吧,要不然怎么更新),然后不管它就好了
|
||||||
|
|
||||||
|
详细步骤可以看下面的图片
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
如果你完成了上面的步骤,就可以不管它了,自动更新会自己进行(除非有`Merge Conflict`)
|
||||||
|
|
||||||
|
### 手动更新
|
||||||
|
|
||||||
|
在自己的仓库中,创建一个pull requests,上游(右边的选择本仓库(GamerNoTitle/wyycg-autocheckin)的master分支,左边选择自己的仓库,然后创建PR并Merge即可!
|
||||||
|
|
||||||
|
具体可以看下面的图片
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Q&A
|
## Q&A
|
||||||
|
|
||||||
## 返回值400并附带一串不知道什么鬼的字符串
|
## 返回值400并附带一串不知道什么鬼的字符串
|
||||||
|
|
|
@ -1,120 +0,0 @@
|
||||||
import sys
|
|
||||||
import requests as r
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
|
|
||||||
tele_enable = False
|
|
||||||
sc_enable = False
|
|
||||||
qq_enable = False
|
|
||||||
pp_enable = False
|
|
||||||
sign_url = 'https://n.cg.163.com/api/v2/sign-today'
|
|
||||||
current = 'https://n.cg.163.com/api/v2/client-settings/@current'
|
|
||||||
|
|
||||||
|
|
||||||
cookies = os.environ.get('wyycg_cookies').split('#')
|
|
||||||
|
|
||||||
if cookies == "" or cookies == []:
|
|
||||||
print('[网易云游戏自动签到]未设置cookie,正在退出……')
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
class ScriptRunError(Exception):
|
|
||||||
print("[网易云游戏自动签到]脚本运行错误,具体请参见日志!")
|
|
||||||
|
|
||||||
|
|
||||||
def signin(url, cookie):
|
|
||||||
header = {
|
|
||||||
'Accept': 'application/json, text/plain, */*',
|
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
|
||||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5',
|
|
||||||
'Authorization': str(cookie),
|
|
||||||
'Connection': 'keep-alive',
|
|
||||||
'Content-Length': '0',
|
|
||||||
'Host': 'n.cg.163.com',
|
|
||||||
'Origin': 'https://cg.163.com',
|
|
||||||
'Referer': 'https://cg.163.com/',
|
|
||||||
'Sec-Fetch-Dest': 'empty',
|
|
||||||
'Sec-Fetch-Mode': 'cors',
|
|
||||||
'Sec-Fetch-Site': 'same-site',
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
|
|
||||||
'X-Platform': '0'
|
|
||||||
}
|
|
||||||
|
|
||||||
result = r.post(url=url, headers=header)
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def getme(url, cookie):
|
|
||||||
header = {
|
|
||||||
'Host': 'n.cg.163.com',
|
|
||||||
'Connection': 'keep-alive',
|
|
||||||
'Accept': 'application/json, text/plain, */*',
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
|
|
||||||
'X-Platform': '0',
|
|
||||||
'Authorization': str(cookie),
|
|
||||||
'Origin': 'https://cg.163.com',
|
|
||||||
'Sec-Fetch-Site': 'same-site',
|
|
||||||
'Sec-Fetch-Mode': 'cors',
|
|
||||||
'Sec-Fetch-Dest': 'empty',
|
|
||||||
'Referer': 'https://cg.163.com/',
|
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
|
||||||
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5'
|
|
||||||
}
|
|
||||||
result = r.get(url=url, headers=header)
|
|
||||||
return result
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
print('检测到{}个账号,即将开始签到!'.format(len(cookies)))
|
|
||||||
success = []
|
|
||||||
failure = []
|
|
||||||
msg = []
|
|
||||||
for i in cookies:
|
|
||||||
cookie = i
|
|
||||||
autherror = False
|
|
||||||
signerror = False
|
|
||||||
sign_return = None
|
|
||||||
me = None
|
|
||||||
try:
|
|
||||||
me = getme(current, cookie)
|
|
||||||
except:
|
|
||||||
message = '第{}个账号验证失败!请检查Cookie是否过期!或者附上报错信息到 https://github.com/GamerNoTitle/wyycg-autosignin/issues 发起issue'.format(
|
|
||||||
cookies.index(i) + 1)
|
|
||||||
failure.append(cookie)
|
|
||||||
msg.append(message)
|
|
||||||
autherror = True
|
|
||||||
|
|
||||||
if me.status_code != 200 and not autherror:
|
|
||||||
message = '第{}个账号验证失败!请检查Cookie是否过期!或者附上报错信息到 https://github.com/GamerNoTitle/wyycg-autosignin/issues 发起issue'.format(
|
|
||||||
cookies.index(i) + 1)
|
|
||||||
failure.append(cookie)
|
|
||||||
msg.append(message)
|
|
||||||
elif me.status_code == 200:
|
|
||||||
try:
|
|
||||||
sign_return = signin(sign_url, cookie)
|
|
||||||
except:
|
|
||||||
message = '第{}个账号签到失败,回显状态码为{},具体错误信息如下:{}'.format(cookies.index(i) + 1, sign_return.status_code, sign_return.text)
|
|
||||||
failure.append(cookie)
|
|
||||||
msg.append(message)
|
|
||||||
signerror = True
|
|
||||||
|
|
||||||
if sign_return.status_code == 200:
|
|
||||||
message = '第{}个账号签到成功!'.format(cookies.index(i) + 1)
|
|
||||||
success.append(cookie)
|
|
||||||
msg.append(message)
|
|
||||||
elif not signerror:
|
|
||||||
message = '第{}个账号签到失败,回显状态码为{},具体错误信息如下:{}'.format(cookies.index(i) + 1, sign_return.status_code, sign_return.text)
|
|
||||||
failure.append(cookie)
|
|
||||||
msg.append(message)
|
|
||||||
outputmsg = str(msg).replace("[", '').replace(']', '').replace(',', '<br>').replace('\'', '')
|
|
||||||
teleinfomsg = '''
|
|
||||||
感谢使用来自GamerNoTitle的网易云游戏自动签到脚本!
|
|
||||||
今日签到结果如下:
|
|
||||||
成功数量:{0}/{2}
|
|
||||||
失败数量:{1}/{2}
|
|
||||||
具体情况如下:
|
|
||||||
{3}
|
|
||||||
GamerNoTitle: https://bili33.top
|
|
||||||
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
|
|
||||||
'''.format(len(success), len(failure), len(cookies), outputmsg)
|
|
||||||
print(teleinfomsg)
|
|
||||||
if (len(failure) != 0):
|
|
||||||
raise ScriptRunError
|
|
Loading…
Reference in New Issue
Block a user