forked from yejigao/9526498
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path酷狗音乐.py
76 lines (66 loc) · 2.92 KB
/
酷狗音乐.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 酷狗音乐
# author @wangquanfugui233
# cron */30 8-18 * * *
# 抓酷狗gateway的url的带有dfid=&appid=&token=&mid=&clientver=&from=client&clienttime=&userid&uuid=有这几个就行,不要求排序,脚本自动的,
# 抓提现的openid,去提现页面,点一下提现至微信就能抓到的了,nickname 也一样,ture=2提现2块 ture=5就提现5块,依次类推
# 变量 export kgyycks='url?后面的参数,不要url?只要参数#openid#nickname#ture=2'多号用@分开
import asyncio
import platform
import sys
import os
import subprocess
def check_environment(file_name):
v, o, a = sys.version_info, platform.system(), platform.machine()
print(f"Python版本: {v.major}.{v.minor}.{v.micro}, 操作系统类型: {o}, 处理器架构: {a}")
if (v.minor in [10]) and o == 'Linux' and a in ['x86_64', 'aarch64', 'armv8']:
print("符合运行要求,arm8没试过不知道行不行,仓库加密的脚本均不支持青龙模块")
check_so_file(file_name, v.minor, a)
else:
if not (v.minor in [10]):
print("不符合要求: Python版本不是3.10")
if o != 'Linux':
print("不符合要求: 操作系统类型不是Linux")
if a != 'x86_64':
print("不符合要求: 处理器架构不是x86_64 aarch64 armv8")
def check_so_file(filename, py_v, cpu_info):
if os.path.exists(filename):
print(f"{filename} 存在")
import aiokgyy as kg
asyncio.run(kg.main())
else:
print(f"不存在{filename}文件,准备下载文件")
url = 'https://files.doudoudou.top/?f=/script/others'
download_so_file(filename, py_v, cpu_info,main_url=url)
def run_command(command):
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True
)
for line in process.stdout:
line = line.strip()
if "%" in line:
print(line)
process.wait()
return process.returncode
def download_so_file(filename, py_v, cpu_info, main_url):
file_base_name = os.path.splitext(filename)[0]
if cpu_info in ['aarch64', 'armv8']:
url = main_url + f'/{file_base_name}_3{py_v}_aarch64.so'
if cpu_info == 'x86_64':
url = main_url + f'/{file_base_name}_3{py_v}_{cpu_info}.so'
# print(github_url)
# 您的命令,使用 -# 参数显示下载进度
command = ['curl', '-#', '-o', filename, url]
# 执行命令并处理输出
result = run_command(command)
if result == 0:
print(f"下载完成:{filename},调用check_so_file funtion")
check_so_file(filename,py_v,cpu_info)
else:
if main_url != 'https://files.doudoudou.top/?f=/script/others':
print(f"下载失败:{filename},更换备用url下载")
download_so_file(filename,py_v,cpu_info,main_url='https://files.doudoudou.top/?f=/script/others')
if __name__ == '__main__':
check_environment('aiokgyy.so')