forked from wd210010/only_for_happly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
4,066 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
# @Time : 2023/05/08 10:23 | ||
# ------------------------------- | ||
# cron "0 0 17 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('500w'); | ||
|
||
import requests | ||
import random | ||
import os | ||
import json | ||
|
||
# 推送加 | ||
plustoken = os.getenv("plustoken") | ||
|
||
#推送函数 | ||
def Push(contents): | ||
# 推送加 | ||
headers = {'Content-Type': 'application/json'} | ||
json = {"token": plustoken, 'title': '双色球2注', 'content': contents.replace('\n', '<br>'), "template": "json"} | ||
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json() | ||
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败') | ||
|
||
headers ={ | ||
'Content-Type': 'application/json', | ||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148' | ||
} | ||
data ={ | ||
"limit":200, | ||
"page":1, | ||
"params":{} | ||
} | ||
resp = requests.post('https://ms.zhcw.com/proxy/lottery-chart-center/history/SSQ',headers=headers,data=json.dumps(data)) | ||
data = json.loads(resp.text)['datas'] | ||
# print(data) | ||
|
||
redbulllist =[] | ||
bruebulllist =[] | ||
for i in range(len(data)): | ||
issue = data[i]['issue'] | ||
redbull = data[i]['winningFrontNum'].split(' ') | ||
bruebull = data[i]['winningBackNum'] | ||
bruebulllist.append(bruebull) | ||
redbulllist.append(redbull) | ||
|
||
#定位函数 | ||
def find_all_index(lst, target): | ||
indices = [] | ||
for i, value in enumerate(lst): | ||
if value == target: | ||
indices.append(i) | ||
return indices | ||
print('为你生成2注双色球号码如下') | ||
msg = [] | ||
for qul in range(2): | ||
|
||
# 统计每红球号码的出现次数 | ||
count_red = [0] * 33 | ||
for bull in redbulllist: | ||
for num in bull: | ||
count_red[int(num)-1] += 1 | ||
#去出现次数最少的几个 | ||
min_ten = sorted(count_red)[:10] | ||
# print(min_ten) | ||
#定位所在位置数字 | ||
allred =[] | ||
for a in range(10): | ||
red = find_all_index(count_red,min_ten[a]) | ||
for b in range(len(red)): | ||
allred.append(red[b]+1) | ||
finallist = sorted(list(set(allred))) | ||
# print(finallist) | ||
|
||
|
||
# 统计每篮球号码的出现次数 | ||
count_brue = [0] * 16 | ||
for bull in bruebulllist: | ||
count_brue[int(bull)-1] += 1 | ||
# print(count_brue) | ||
min_3 = sorted(count_brue)[:5] | ||
# print(min_3) | ||
#定位所在位置数字 | ||
allbrue =[] | ||
for a in range(5): | ||
brue = find_all_index(count_brue,min_3[a]) | ||
for b in range(len(brue)): | ||
allbrue.append(brue[b]+1) | ||
finallist2 = sorted(list(set(allbrue))) | ||
# print(finallist2) | ||
msg.append(str(sorted(random.sample(finallist,6)))+ ' - '+str(sorted(random.sample(finallist2,1)))) | ||
massage = str(msg).replace('\', \'','\n').replace('[','').replace(']','').replace('\'','') | ||
print(massage) | ||
Push(contents=massage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
#@Author : github@raindrop https://github.com/raindrop-hb/tencent-video | ||
# @Time : 2023/3/31 10:23 | ||
# ------------------------------- | ||
# cron "30 0,1,2 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('腾讯视频签到'); | ||
|
||
import requests | ||
import json | ||
import time,os | ||
|
||
|
||
#抓取腾讯视频会员app(不是网页)界面的cookie里面的项目 设置环境变量 只能完成部分任务 还有不是所有帐号都能签到成功因为有的帐号会触发滑块认证或者短信验证 设置定时早上6点前比较好 | ||
# export tencent_vdevice_qimei36='' | ||
# export tencent_vqq_appid='' | ||
# export tencent_vqq_openid='' | ||
# export tencent_vqq_access_token='' | ||
# export tencent_main_login='qq' 默认就是qq两个字母 不要瞎改成QQ号 | ||
|
||
tencent_vdevice_qimei36 = os.getenv("tencent_vdevice_qimei36") | ||
tencent_vqq_appid = os.getenv("tencent_vqq_appid") | ||
tencent_vqq_openid = os.getenv("tencent_vqq_openid") | ||
tencent_vqq_access_token = os.getenv("tencent_vqq_access_token") | ||
tencent_main_login = os.getenv("tencent_main_login") | ||
|
||
|
||
def ten_video(): | ||
cookie='vdevice_qimei36='+tencent_vdevice_qimei36+';vqq_appid='+tencent_vqq_appid+';vqq_openid='+tencent_vqq_openid+';vqq_access_token='+tencent_vqq_access_token+';main_login='+tencent_main_login | ||
url_1='https://vip.video.qq.com/rpc/trpc.new_task_system.task_system.TaskSystem/CheckIn?rpc_data=%7B%7D' | ||
headers_1={'user-agent':'Mozilla/5.0 (Linux; Android 11; M2104K10AC Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/046237 Mobile Safari/537.36 QQLiveBrowser/8.7.85.27058', | ||
'Content-Type':'application/json', | ||
'referer':'https://film.video.qq.com/x/vip-center/?entry=common&hidetitlebar=1&aid=V0%24%241%3A0%242%3A8%243%3A8.7.85.27058%244%3A3%245%3A%246%3A%247%3A%248%3A4%249%3A%2410%3A&isDarkMode=0', | ||
'cookie':cookie | ||
} | ||
response_1 = requests.get(url_1,headers=headers_1) | ||
res_1 = json.loads(response_1.text) | ||
url_2='https://vip.video.qq.com/rpc/trpc.new_task_system.task_system.TaskSystem/ProvideAward?rpc_data=%7B%22task_id%22:1%7D' | ||
headers_2={'user-agent':'Mozilla/5.0 (Linux; Android 11; M2104K10AC Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/046237 Mobile Safari/537.36 QQLiveBrowser/8.7.85.27058', | ||
'Content-Type':'application/json', | ||
'referer':'https://film.video.qq.com/x/vip-center/?entry=common&hidetitlebar=1&aid=V0%24%241%3A0%242%3A8%243%3A8.7.85.27058%244%3A3%245%3A%246%3A%247%3A%248%3A4%249%3A%2410%3A&isDarkMode=0', | ||
'cookie':cookie | ||
} | ||
response_2 = requests.get(url_2,headers=headers_2) | ||
res_2 = json.loads(response_2.text) | ||
time_1 = int(time.time()) | ||
time_2 = time.localtime(time_1) | ||
now = time.strftime("%Y-%m-%d %H:%M:%S", time_2) | ||
log = "腾讯视频会员签到执行任务\n----------raindrop----------\n" + now | ||
try: | ||
log = log + "\n签到获得积分:" + str(res_1['check_in_score']) | ||
except: | ||
log=log+"\n腾讯视频签到异常,返回内容:"+str(res_1) | ||
print(res_1) | ||
try: | ||
log = log + "\n观看获得积分:" + str(res_2['check_in_score']) | ||
except: | ||
log=log+"\n腾讯视频领取观看积分异常,返回内容:"+str(res_2) | ||
print(res_2) | ||
url='https://vip.video.qq.com/rpc/trpc.new_task_system.task_system.TaskSystem/ReadTaskList?rpc_data=%7B%22business_id%22:%221%22,%22platform%22:3%7D' | ||
headers={'user-agent':'Mozilla/5.0 (Linux; Android 11; M2104K10AC Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/046237 Mobile Safari/537.36 QQLiveBrowser/8.7.85.27058', | ||
'Content-Type':'application/json', | ||
'referer':'https://film.video.qq.com/x/vip-center/?entry=common&hidetitlebar=1&aid=V0%24%241%3A0%242%3A8%243%3A8.7.85.27058%244%3A3%245%3A%246%3A%247%3A%248%3A4%249%3A%2410%3A&isDarkMode=0', | ||
'cookie':cookie | ||
} | ||
response = requests.get(url,headers=headers) | ||
res = json.loads(response.text) | ||
try: | ||
lis=res["task_list"] | ||
log = log + '\n--------任务状态----------' | ||
for i in lis: | ||
log=log+'\ntask_title:'+i["task_maintitle"]+'\nsubtitle:'+i["task_subtitle"]+'\ntask_button_desc:'+i["task_button_desc"] | ||
except: | ||
log = log + "获取状态异常,可能是cookie失效" | ||
print(res) | ||
print(log) | ||
|
||
|
||
def main(): | ||
ten_video() | ||
|
||
|
||
def main_handler(event, context): | ||
return main() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
# @Time : 2023/4/8 10:23 | ||
# ------------------------------- | ||
# cron "30 5 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('阿里云盘签到'); | ||
|
||
import json | ||
import requests | ||
import os | ||
|
||
##变量export ali_refresh_token='' | ||
ali_refresh_token=os.getenv("ali_refresh_token").split('&') | ||
#refresh_token是一成不变的呢,我们使用它来更新签到需要的access_token | ||
#refresh_token获取教程:https://github.com/bighammer-link/Common-scripts/wiki/%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%98refresh_token%E8%8E%B7%E5%8F%96%E6%96%B9%E6%B3%95 | ||
# ali_refresh_token = os.getenv("ali_refresh_token") | ||
# 推送加 | ||
plustoken = os.getenv("plustoken") | ||
|
||
|
||
#推送函数 | ||
def Push(contents): | ||
# 推送加 | ||
headers = {'Content-Type': 'application/json'} | ||
json = {"token": plustoken, 'title': 'aliyun签到', 'content': contents.replace('\n', '<br>'), "template": "json"} | ||
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json() | ||
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败') | ||
|
||
#签到函数 | ||
for i in range(len(ali_refresh_token)): | ||
print(f'开始帐号{i+1}签到') | ||
def daily_check(access_token): | ||
url = 'https://member.aliyundrive.com/v1/activity/sign_in_list' | ||
headers = { | ||
'Authorization': access_token | ||
} | ||
response = requests.post(url=url, headers=headers, json={}).text | ||
result = json.loads(response) | ||
if 'success' in result: | ||
print('签到成功') | ||
for i, j in enumerate(result['result']['signInLogs']): | ||
if j['status'] == 'miss': | ||
day_json = result['result']['signInLogs'][i-1] | ||
# print(day_json) | ||
if not day_json['isReward']: | ||
contents = '签到成功,今日未获得奖励' | ||
else: | ||
contents = '本月累计签到{}天,今日签到获得{}{}'.format(result['result']['signInCount'], | ||
day_json['reward']['name'], | ||
day_json['reward']['description']) | ||
print(contents) | ||
|
||
return contents | ||
|
||
|
||
# 使用refresh_token更新access_token | ||
def update_token(refresh_token): | ||
url = 'https://auth.aliyundrive.com/v2/account/token' | ||
data = { | ||
'grant_type': 'refresh_token', | ||
'refresh_token': ali_refresh_token[i] | ||
} | ||
response = requests.post(url=url, json=data).json() | ||
access_token = response['access_token'] | ||
# print('获取的access_token为{}'.format(access_token)) | ||
return access_token | ||
|
||
|
||
def mian(): | ||
# print('更新access_token') | ||
access_token = update_token(ali_refresh_token) | ||
# print('更新成功,开始进行签到') | ||
content = daily_check(access_token) | ||
if plustoken != '': | ||
Push(content) | ||
|
||
if __name__ == '__main__': | ||
mian() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
# ------------------------------- | ||
# @Author : github@wd210010 https://github.com/wd210010/just_for_happy | ||
# @Time : 2023/2/27 13:23 | ||
# ------------------------------- | ||
# cron "30 9 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('ddnsto七天续费'); | ||
|
||
import requests, json,uuid,datetime,re,os | ||
from datetime import timedelta | ||
|
||
# 配置参数 登录https://www.ddnsto.com/app/#/devices 抓包cookie | ||
ddns_cookie = os.getenv("ddns_cookie") | ||
xcsrftoken=re.findall('csrftoken=(.*?);', ddns_cookie, re.S)[0] | ||
# 先购买一次7天免费套餐 抓包查看https://www.ddnsto.com/api/user/routers/*****/ 这个url里面的*****就是userid | ||
ddns_userid=os.getenv("ddns_userid") | ||
|
||
# pushtoken | ||
plustoken=os.getenv("plustoken") | ||
|
||
|
||
def Push(contents): | ||
#推送加 | ||
headers = {'Content-Type': 'application/json'} | ||
json = {"token": plustoken, 'title': 'DDNS', 'content': contents.replace('\n', '<br>'), "template": "json"} | ||
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json() | ||
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败') | ||
|
||
# utc-beijing | ||
def UTC2BJS(UTC): | ||
UTC_format = "%Y-%m-%dT%H:%M:%S.%fZ" | ||
BJS_format = "%Y-%m-%d %H:%M:%S" | ||
UTC = datetime.strptime(UTC,UTC_format) | ||
#格林威治时间+8小时变为北京时间 | ||
BJS = UTC + timedelta(hours=8) | ||
BJSJ = BJS.strftime(BJS_format) | ||
return BJSJ | ||
|
||
|
||
#获取订单号 | ||
uu_id = uuid.uuid4() | ||
suu_id = ''.join(str(uu_id).split('-')) | ||
url_2 = 'https://www.ddnsto.com/api/user/product/orders/' | ||
headers = { | ||
'accept': 'application/json, text/plain, */*', | ||
'accept-encoding': 'gzip, deflate, br', | ||
'accept-language': 'zh-CN,zh;q=0.9', | ||
'cookie': f'{ddns_cookie}', | ||
'referer': 'https://www.ddnsto.com/app/', | ||
'sec-fetch-dest': 'empty', | ||
'sec-fetch-mode': 'cors', | ||
'sec-fetch-site': 'same-origin', | ||
'user-agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', | ||
'x-csrftoken': f'{xcsrftoken}' | ||
} | ||
data_2 = { | ||
'product_id': '2', | ||
'uuid_from_client': f'{suu_id}' | ||
} | ||
html_2 = requests.post(url=url_2, headers=headers,data=data_2) | ||
result_2 = json.loads(html_2.text) | ||
if result_2['application-error']=='超出本周免费套餐购买次数': | ||
print(result_2['application-error']) | ||
message_3=result_2['application-error'] | ||
Push(contents=message_3) | ||
else: | ||
id = result_2['id'] | ||
print(id) | ||
# 提交订单 | ||
url_3 = f'https://www.ddnsto.com/api/user/product/orders/{id}/' | ||
html_3 = requests.get(url=url_3, headers=headers).text | ||
|
||
#创建 | ||
url_4 =f'https://www.ddnsto.com/api/user/routers/{ddns_userid}/' | ||
data_4 ={ | ||
"plan_ids_to_add":[f'{id}'], | ||
"server":3 | ||
} | ||
html_4 = requests.patch(url=url_4, headers=headers,data =data_4) | ||
result_4 = json.loads(html_4.text) | ||
if len(result_4['uid'])>0: | ||
print('****白嫖成功*****'+'\n'+'到期时间:'+UTC2BJS(result_4['active_plan']["product_expired_at"])) | ||
else: | ||
print('没有白嫖到!检查配置看看') | ||
message_2 = '****白嫖成功*****'+'\n'+'到期时间:'+UTC2BJS(result_4['active_plan']["product_expired_at"]) | ||
Push(contents=message_2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/python3 | ||
# -- coding: utf-8 -- | ||
# ------------------------------- | ||
# @Author : github@wd210010 https://github.com/wd210010/just_for_happy | ||
# @Time : 2023/2/27 13:23 | ||
# ------------------------------- | ||
# cron "1 0 * * *" script-path=xxx.py,tag=匹配cron用 | ||
# const $ = new Env('富贵论坛签到'); | ||
|
||
import requests, re,time,json,time,os | ||
|
||
# 富贵论坛签到 | ||
# export fg_cookies='配置富贵论坛cookie' | ||
|
||
fg_cookies = os.getenv("fg_cookies").split('&') | ||
|
||
|
||
###逐行读取数据 | ||
for i in range(len(fg_cookies)): | ||
cookie = fg_cookies[i] | ||
url2 = 'https://www.fglt.net/' | ||
headers2 = { | ||
'cookie': f'{cookie}', | ||
'user-agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36' | ||
} | ||
re2 = requests.post(url=url2, headers=headers2).text | ||
formhash = str(re.findall('<input type="hidden" name="formhash" value="(.*?)" />', re2, re.S)).replace('\'', '').replace('[', '').replace(']', '') | ||
|
||
print('获取到formhash:'+ formhash +f'\n***开第{i+1}个账号签到***' ) | ||
|
||
#签到 | ||
url4=f'https://www.fglt.net/plugin.php?id=dsu_amupper&ppersubmit=true&formhash={formhash}&infloat=yes&handlekey=dsu_amupper&inajax=1&ajaxtarget=fwin_content_dsu_amupper' | ||
re4 = requests.post(url=url4, headers=headers2).text | ||
result =str(re.findall('showDialog\((.*?),', re4, re.S)).replace('\'', '').replace('[', '').replace(']', '').replace('"', '') | ||
print(result) | ||
|
||
|
Oops, something went wrong.