Repository: GamerNoTitle/wyycg-autocheckin
Branch: master
Commit: e12f44c30694
Files: 10
Total size: 30.9 KB
Directory structure:
gitextract_014h_t93/
├── .github/
│ ├── FUNDING.yml
│ └── workflows/
│ ├── AutoSignin.yml.disabled
│ ├── KeepAlive.yml.disabled
│ └── MirrorSync.yml
├── LICENSE
├── README.md
├── UUID.txt
├── main.py
├── qinglong/
│ └── qinglong.py
└── requirements.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://afdian.net/@GamerNoTitle','https://paypal.me/GamerNoTitle','https://goto.bili33.top/WeChatPay','https://goto.bili33.top/Alipay'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
================================================
FILE: .github/workflows/AutoSignin.yml.disabled
================================================
name: AutoCheckin
on:
workflow_dispatch:
release:
types: [published]
push:
tags:
- 'v*'
# branches:
# - master
schedule:
- cron: "0 2 * * *"
watch:
types: [started]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python #安装python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install requirements #安装轮子
run: |
pip install -r requirements.txt
- name: Run script
run: |
python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" "${{ secrets.QQKEY }}" "${{ secrets.PPKEY }}"
================================================
FILE: .github/workflows/KeepAlive.yml.disabled
================================================
name: 'KeepActionAlive'
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
jobs:
auto_renew:
runs-on: ubuntu-latest
steps:
- name: 'Checkout codes'
uses: actions/checkout@v2
- name: 'Avoid Github Workflow being suspended'
run: echo $(cat /proc/sys/kernel/random/uuid) > UUID.txt
- name: 'Commit Files'
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git diff --quiet && git diff --staged --quiet || git commit -am '是否继续白嫖:[是] —— 继续白嫖成功!'
echo ::set-output name=status::success
- name: 'GitHub Push'
if: steps.commit.output.status != 'success'
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
================================================
FILE: .github/workflows/MirrorSync.yml
================================================
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
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020-present GamerNoTitle
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
# 网易云游戏自动签到
请注意:关于LICENSE,在Apache-2.0的基础上增加一条:**禁止上传到CSDN等网站盈利,禁止放在某宝某鱼等平台贩卖**,否则官方找上门就**删库跑路**!
仓库被封了就来这里找https://git.bili33.top/GamerNoTitle/wyycg-AutoCheckin
本脚本通过使用Github Action来进行[网易云游戏](https://cloudgame.webapp.163.com/newer.html?invite_code=2ZLPWY)签到操作,让你能够天天白嫖网易云游戏时长和云电脑!
喜欢就给我点个STAR吧!
签到时间是早上10点,如果有需要就自己修改.github/workflows/AutoSignin.yml中第12行的时间,时间遵循UTC时间,+8才是我们的时间
**请不要使用非master分支脚本,他们通常正在开发新功能,会有BUG出现**
关于签到失败返回的结果([这里有实例](https://github.com/GamerNoTitle/wyycg-autocheckin/discussions/6)),如果你有解码的经验,可以前往[这里](https://github.com/GamerNoTitle/wyycg-autocheckin/discussions/6)提供帮助,Thanks♪(・ω・)ノ
## 赞助
点击下面的Badge其中一个就可以跳转到相应页面,感谢老板的支持!
## 目录
- [使用方法](#使用方法)
- ~~[保活策略](#保活策略)~~
- [变量获取](#变量内容获取)
- ~~[脚本更新](#脚本更新)~~
- [Q&A](#qa)
## 使用方法
### 变量添加
1、Fork本仓库,按右上角的分支按钮(如图)

2、进入设置,设置变量`cookie`和`teleid` `teletoken` `SCKEY` `QQKEY` `PPKEY`(这五个可选,但是`teleid`和`teletoken`要用的话就得两个都要配置!)
**请注意:你无需在仓库的secrets内设置名为`GITHUB_TOKEN`的变量,该名称本身就是指定为自己账户下名为`GITHUB_TOKEN`的密钥,如果你在仓库的secrets内设置将会被Github提示无效**
**如果使用多用户,多个cookie请使用`#`分隔**
[如何获取变量内容?请点这里](#变量内容获取)



### 测试脚本
**请在当天没有签到的情况下测试!!!**
我们先进入Action界面,启用Action

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

~~除了点STAR进行启动以外~~(现在STAR启动不了了),你也可以点击右边那个白白的按钮来启动
**只要测试通过就是没问题,如果你配置了TELEGRAM还会收到你的BOT给你发送的消息**
测试通过后,你还需要创建保活需要用到的Github Token,详情可以看[保活策略](#保活策略)这一节(其实就在下面撒)
## ~~保活策略~~ (新版Action可跳过,但是在设置里面的Action权限要放行写入权限!)
因为Github Action在仓库60天内没有任何Push的时候会禁用你的Action,这时候我们就要进行保活
保活Action已经写好了~~,但是这里有一些步骤是需要你进行的,请看下面的图片生成GITHUB_TOKEN以便让脚本造成的更改能够正常推送入你的仓库~~
## 变量内容获取
### cookie获取
首先我们进入[官网](https://cg.163.com),进行登录,然后用F12打开开发者工具后使用Ctrl+F5进行刷新,会刷出很多结果
我们在里面找到`@me`这一项,然后在右边找到`Authorization`将冒号后面的内容复制下来就是我们所需要的Cookie
**如果使用多用户,多个cookie请使用`#`分隔**

### teleid获取
用你的Telegram找到@userinfobot,点个Start,会直接给你回复你的ID,复制下id后面的数字就是teleid了
### teletoken获取
找@BotFather进行机器人的创建,按照提示创建即可,会给你一个API TOKEN,如果一不小心点过去了可以用命令`/mybots`管理自己的bot,找到自己想要使用的bot并获取API就可以了
### SCKEY获取
访问[ServerChanTurbo官网](https://sct.ftqq.com/r/3350),并用你的微信扫码登陆,获取推送用的KEY即可(因为我没有使用这个推送方法所以没有图)
**请各位使用了SC推送服务的小伙伴尽快迁移到SCT,原服务将会在四月底下线**
### QQKEY获取
**不推荐使用此推送方式,因为其极不稳定!使用该推送方式无法收到QQ提醒的请不要开issue说这个问题,因为这是该服务的问题不是脚本问题**
访问[CoolPush官网](https://cp.xuthus.cc/),使用任一方式登录,在`调用代码Skey`可以看到你的KEY

### PPKEY获取
**此平台是ServerChan的替代平台,因为ServerChan发了个[通知](https://mp.weixin.qq.com/s/L4rONhZN2OCQ80cHxPAY0Q),所以我就先把这个给更了
访问[PushPlus官网](http://pushplus.hxtrip.com/),使用微信登录,直接在[一对一推送](http://pushplus.hxtrip.com/message)复制自己的Token填入变量即可!
## Q&A
## 返回值400并附带一串不知道什么鬼的字符串
例子:
```
感谢使用来自GamerNoTitle的网易云游戏自动签到脚本!
今日签到结果如下:
成功数量:0/1
失败数量:1/1
具体情况如下:
第1个账号签到失败,回显状态码为400,具体错误信息如下:GL8B/hH+v9cYGsm/Ag8PAAwBAr/XztPNzsm/Ag8PChAEv9e/EhACD70QBgQLvREMAf4Wv8m/Ag8PChAEAAu/17/5EtID0tD5EtLWz9b5EtIBA8/5EtT/1AL5EtLP0M2/Gqc=
GamerNoTitle: https://bili33.top
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
```
首先你需要确认你当天是否已经签到过了才运行的脚本,如果确实先签了到再运行脚本,网易确实会返回400
目前也只发现这种情况会返回400,如果有其他情况你可以在issue跟我提出
## 错误代码
### telepot.exception.TelegramError
#### Chat not found
请先用你要接受信息的账户发个`/start`给你的bot,或者检查用户ID是否正确!
#### Not found
请检查自己的Telebot Token是否正确!
### telepot.exception.UnauthorizedError
该错误显示如下:
```
Traceback (most recent call last):
File "main.py", line 185, in
send(teleid, teleinfomsg)
File "main.py", line 82, in send
bot.sendMessage(id, message, parse_mode=None, disable_web_page_preview=None, disable_notification=None,
File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/telepot/init.py", line 513, in sendMessage
return self._api_request('sendMessage', _rectify(p))
File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/telepot/init.py", line 491, in _api_request
return api.request((self._token, method, params, files), **kwargs)
File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/telepot/api.py", line 155, in request
return _parse(r)
File "/opt/hostedtoolcache/Python/3.8.9/x64/lib/python3.8/site-packages/telepot/api.py", line 147, in _parse
raise e(description, error_code, data)
telepot.exception.UnauthorizedError: ('Unauthorized', 401, {'ok': False, 'error_code': 401, 'description': 'Unauthorized'})
```
解决方法:检查自己的Bot的Token是不是正确的!
### urllib3.exceptions
#### MaxRetryError
`HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botxxxx/sendMessage`
出现这个错误,那就是Telegram的问题,Github连接不上Telegram服务器(大半是TG服务器炸了)
#### ReadTimeoutError
`HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)`
出现这个错误,那就是Telegram的问题,Github连接不上Telegram服务器(大半是TG服务器炸了)~~(复制粘贴大法)~~
---
## 历史STAR

## 免责声明
使用本脚本造成的封号或任何违反相关法律法规造成的任何责任,由使用者自行承担,开发者不担负任何责任!
================================================
FILE: UUID.txt
================================================
484f060f-1cfa-4d65-a8e3-aae2ca5c22b0
================================================
FILE: main.py
================================================
import sys
import requests as r
import json
import telepot
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 = sys.argv[1].split('#')
teleid = sys.argv[2]
teletoken = sys.argv[3]
sckey = sys.argv[4]
qqkey = sys.argv[5]
ppkey = sys.argv[6]
if cookies == "" or cookies == []:
print('[网易云游戏自动签到]未设置cookie,正在退出……')
sys.exit()
if teleid != "" and teletoken != "":
tele_enable = True
print('Telegram推送已配置!')
bot = telepot.Bot(teletoken)
else:
print('未配置Telegram推送!')
if sckey != "":
sc_enable = True
print('ServerChan推送已配置!')
else:
print('未配置ServerChan推送!')
if qqkey != "":
qq_enable = True
print('QQ推送已配置!')
else:
print('未配置QQ推送!')
if ppkey != '':
pp_enable = True
print('PushPlus推送已配置!')
else:
print('未配置PushPlus推送!')
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
def send(id, message):
if tele_enable:
print('正在使用Telebot进行消息推送……')
bot.sendMessage(id, message, parse_mode=None, disable_web_page_preview=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None)
print('Telebot消息推送完成!')
def scsend(SCKEY, message):
sc_url = 'http://sctapi.ftqq.com/{}.send?title=网易云游戏自动签到脚本&desp={}'.format(SCKEY, message)
if sc_enable:
print('正在使用ServerChan进行消息推送……')
r.get(url=sc_url)
print('ServerChan消息推送完成!')
def qqsend(QQKEY, message):
qq_url = 'https://push.xuthus.cc/send/{}?c=网易云游戏自动签到脚本\n{}'.format(QQKEY, message)
if qq_enable:
print('正在进行QQ消息推送……')
r.get(url=qq_url)
print('QQ消息推送完成!')
def ppsend(PPKEY, message):
pp_url = 'http://pushplus.hxtrip.com/send?token={}&title=网易云游戏自动签到脚本&content={}&template=html'.format(PPKEY, message)
if pp_enable:
print('正在使用PushPlus进行消息推送……')
r.get(url=pp_url)
print('PushPlus消息推送完成')
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(',', '
').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)
scinfomsg = '''
感谢使用来自GamerNoTitle的网易云游戏自动签到脚本!
今日签到结果如下:
成功数量:{0}/{2}
失败数量:{1}/{2}
具体情况如下:
{3}
GamerNoTitle: https://bili33.top
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
'''.format(len(success), len(failure), len(cookies), outputmsg)
qqinfomsg = '''
感谢使用来自bili33.top GamerNoTitle的网易云游戏自动签到脚本
今日签到结果如下:
成功数量:{0}/{2}
失败数量:{1}/{2}
具体情况如下:
{3}
GamerNoTitle: https://bili33.top
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
'''.format(len(success), len(failure), len(cookies), outputmsg)
ppinfomsg = '''
感谢使用来自bili33.top GamerNoTitle的网易云游戏自动签到脚本
今日签到结果如下:
成功数量:{0}/{2}
失败数量:{1}/{2}
具体情况如下:
{3}
GamerNoTitle: https://bili33.top
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
'''.format(len(success), len(failure), len(cookies), outputmsg)
send(teleid, teleinfomsg)
scsend(sckey, scinfomsg)
qqsend(qqkey, qqinfomsg)
ppsend(ppkey, ppinfomsg)
print(teleinfomsg)
if (len(failure) != 0):
raise ScriptRunError
================================================
FILE: qinglong/qinglong.py
================================================
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(',', '
').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
================================================
FILE: requirements.txt
================================================
requests
telepot