Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发布0.11.48 Pypi版本 #127

Merged
merged 82 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
247ad33
改进代码目录结构
lunzhiPenxil Dec 6, 2023
a21fdce
Create Codecov
lunzhiPenxil Dec 8, 2023
a48f55d
Rename Codecov to Codecov.yml
lunzhiPenxil Dec 8, 2023
2c2237c
Delete Codecov.yml
lunzhiPenxil Dec 8, 2023
eb7a53d
新增OPQBot初步支持
lunzhiPenxil Dec 13, 2023
3903c75
嵌入OPQBot启动
lunzhiPenxil Dec 14, 2023
48ad152
自动分配OPQBot的接口
lunzhiPenxil Dec 14, 2023
48204c1
hook email相关库
lunzhiPenxil Dec 15, 2023
5f68a1d
Create hook-email.py
lunzhiPenxil Dec 15, 2023
b90a47e
适配OPQ部分接口
lunzhiPenxil Dec 15, 2023
e321101
优化接口
lunzhiPenxil Dec 18, 2023
8e4c60b
Update README.md
lunzhiPenxil Dec 18, 2023
e33982a
Update README.md
lunzhiPenxil Dec 18, 2023
3b9cc87
新增Shamrock兼容模式
lunzhiPenxil Dec 19, 2023
400236a
新增指定intents的qq开放平台对接
lunzhiPenxil Dec 21, 2023
f5a3c98
Update basic_default.json
lunzhiPenxil Dec 26, 2023
eaea94c
支持header token字段
lunzhiPenxil Dec 27, 2023
e290213
新增hook
lunzhiPenxil Dec 27, 2023
03ff73d
新增flask模块的端口显示
lunzhiPenxil Dec 29, 2023
b98e205
0.11.28 Discord新增指定intents账号类型
lunzhiPenxil Jan 2, 2024
245116a
Update discordSDK.py
lunzhiPenxil Jan 2, 2024
2be5619
KOOK 新增按钮点击响应,对接到消息事件中
lunzhiPenxil Jan 2, 2024
972a401
Update README.md
lunzhiPenxil Jan 4, 2024
0108bf7
新增米游社发送卡片独立接口
lunzhiPenxil Jan 5, 2024
3fd8224
将OPQBot平台群用户设置为不区分群身份
lunzhiPenxil Feb 7, 2024
433a466
进行LiteLoaderQQNT-OneBotApi初步适配
lunzhiPenxil Feb 22, 2024
fc7cd0a
Update onebotSDK.py
willkyu Mar 11, 2024
d410586
Update onebotSDK.py
willkyu Mar 11, 2024
8421c54
Merge pull request #119 from willkyu/main
lunzhiPenxil Mar 11, 2024
4cbddbc
Update onebotSDK.py
willkyu Mar 11, 2024
31c8e9b
Merge pull request #120 from willkyu/main
lunzhiPenxil Mar 11, 2024
97acb90
OPQ:尝试修复群邀请相关接口适配
lunzhiPenxil May 15, 2024
afe0b51
Merge branch 'subdev/lunzhiPenxil/patch_20240515001'
lunzhiPenxil May 15, 2024
4b2d55d
OPQ:修复群邀请相关接口适配
lunzhiPenxil May 15, 2024
fd7a0fd
暂时屏蔽win32版本debug包
lunzhiPenxil May 15, 2024
966828b
Revert "暂时屏蔽win32版本debug包"
lunzhiPenxil May 15, 2024
331d01e
OPQ:解决邀请事件的id内容问题
lunzhiPenxil May 15, 2024
349e44e
OPQ:修复好友请求相关接口适配
lunzhiPenxil May 15, 2024
c7b72e9
telegram:适配新的图文数据格式
MetaLe0 May 15, 2024
ff6a406
Merge pull request #123 from MetaLe0/main
lunzhiPenxil May 15, 2024
2813f78
QQ:内置NapCat协议端
MetaLe0 May 28, 2024
ed51ad8
Merge branch 'OlivOS-Team:main' into main
MetaLe0 May 28, 2024
a517938
Merge pull request #124 from MetaLe0/main
lunzhiPenxil May 28, 2024
7a434c9
QQ:激活内置NapCat的资源分发流程
MetaLe0 May 28, 2024
d9292b1
Update README.md
MetaLe0 May 28, 2024
9be8fb6
版本推进至0.11.30,补充元数据与本地化数据
MetaLe0 May 29, 2024
3c4bd4d
0.11.31,修正NapCat自动托管时上报地址锁死问题
MetaLe0 May 29, 2024
cd72e48
OnebotV11尝试修复收到重复flag的好友、加群邀请
MetaLe0 Jun 1, 2024
53a536c
0.11.32,内置AstralQsign
MetaLe0 Jun 1, 2024
8c2fabe
调整不符合依赖状况的逻辑
MetaLe0 Jun 3, 2024
e9565ae
0.11.33,优化内置AstralQsign的使用体验
MetaLe0 Jun 4, 2024
cd159a6
0.11.34,内置人机验证助手(滑块助手)
lunzhiPenxil Jun 7, 2024
c0edc16
0.11.35,优化QQ平台使用体验
lunzhiPenxil Jun 8, 2024
6f7f0d0
0.11.36,指定Webview引擎
lunzhiPenxil Jun 9, 2024
9611319
更新内置AstralQsign的启动方式
lunzhiPenxil Jun 10, 2024
69d8fca
0.11.37
lunzhiPenxil Jun 10, 2024
a840707
0.11.38,更新内置NapCat版本
MetaLe0 Jun 12, 2024
9c4fa3d
改进接口终端的并发设计
MetaLe0 Jun 12, 2024
2157a05
0.11.39
MetaLe0 Jun 12, 2024
8f57958
0.11.40,夏至版本
MetaLe0 Jun 12, 2024
0164ae5
0.11.41,小暑,补充NapCat端的OlivOS消息转换元数据
lunzhiPenxil Jun 28, 2024
681bbd3
Update README.md
lunzhiPenxil Jun 28, 2024
b1fccd6
Update README.md
lunzhiPenxil Jun 28, 2024
458363b
Update README.md
lunzhiPenxil Jun 28, 2024
d08afa5
新增 QQ官方/沙盒/V2 账号类型
lunzhiPenxil Jul 5, 2024
cb9c5c8
更新内置NapCat版本
lunzhiPenxil Jul 5, 2024
2b95c46
Update FUNDING.yml
lunzhiPenxil Jul 18, 2024
b7f542c
Update infoAPI.py
MetaLe0 Aug 2, 2024
9184d8b
回滚内置NapCat版本
MetaLe0 Aug 2, 2024
edfb6e9
采用新的启动脚本启动新版NapCat
MetaLe0 Aug 2, 2024
3e7ee46
0.11.43,修正QQ频道条件判断
MetaLe0 Aug 3, 2024
3747716
0.11.44,准备发布
MetaLe0 Aug 3, 2024
f938cfc
Update infoAPI.py
MetaLe0 Aug 3, 2024
367a17b
0.11.45,优化终端滚动机制
MetaLe0 Aug 4, 2024
60e4df9
调整终端输入框
MetaLe0 Aug 4, 2024
0445643
0.11.46,优化登录管理器
MetaLe0 Aug 5, 2024
1ee92dc
登录管理器新增无账号引导流程
MetaLe0 Aug 6, 2024
8e6980f
调整UI尺寸
MetaLe0 Aug 6, 2024
40586ff
0.11.47,七夕版本
MetaLe0 Aug 11, 2024
e7a4ff2
pyinstaller==6.9.0
MetaLe0 Aug 11, 2024
be73988
0.11.48,巧克力版本
MetaLe0 Aug 11, 2024
9a15fc2
Pypi版本推进至0.11.48
MetaLe0 Aug 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

custom: ['https://afdian.net/@OlivOS'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['https://afdian.com/a/OlivOS'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
118 changes: 62 additions & 56 deletions OlivOS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,69 @@

import platform

from . import infoAPI
from . import L10NAPI
from . import L10NDataAPI
from . import bootAPI
from . import bootDataAPI
from . import data
from .core.info import infoAPI
from .core.L10N import L10NAPI
from .core.L10N import L10NDataAPI
from .core.boot import bootAPI
from .core.boot import bootDataAPI
from .core.inlineData import data
from . import hook
from . import contentAPI
from . import messageAPI
from . import metadataAPI
from . import API
from .core.core import contentAPI
from .core.core import messageAPI
from .core.core import metadataAPI
from .core.core import API
from . import thirdPartyModule
from . import accountAPI
from . import diagnoseAPI
from . import flaskServerAPI
from . import onebotV12SDK
from . import onebotV12LinkServerAPI
from . import pluginAPI
from . import onebotSDK
from . import virtualTerminalSDK
from . import virtualTerminalLinkServerAPI
from . import qqGuildSDK
from . import qqGuildLinkServerAPI
from . import qqGuildv2SDK
from . import qqGuildv2LinkServerAPI
from . import qqRedSDK
from . import qqRedLinkServerAPI
from . import telegramSDK
from . import telegramPollServerAPI
from . import discordSDK
from . import discordLinkServerAPI
from . import hackChatSDK
from . import hackChatLinkServerAPI
from . import dodobotEAServerAPI
from . import dodobotEATXAPI
from . import dodobotEASDK
from . import dodoSDK
from . import dodoPollServerAPI
from . import dodoLinkSDK
from . import dodoLinkServerAPI
from . import dingtalkSDK
from . import dingtalkLinkServerAPI
from . import fanbookSDK
from . import fanbookPollServerAPI
from . import kaiheilaSDK
from . import kaiheilaLinkServerAPI
from . import mhyVilaSDK
from . import mhyVilaLinkServerAPI
from . import biliLiveSDK
from . import biliLiveLinkServerAPI
from . import updateAPI
from . import webTool
from .core.core import accountAPI
from .core.core import accountMetadataAPI
from .core.core import diagnoseAPI
from .adapter.onebotV11 import flaskServerAPI
from .adapter.onebotV12 import onebotV12SDK
from .adapter.onebotV12 import onebotV12LinkServerAPI
from .core.core import pluginAPI
from .adapter.onebotV11 import onebotSDK
from .adapter.virtualTerminal import virtualTerminalSDK
from .adapter.virtualTerminal import virtualTerminalLinkServerAPI
from .adapter.qqGuild import qqGuildSDK
from .adapter.qqGuild import qqGuildLinkServerAPI
from .adapter.qqGuild import qqGuildv2SDK
from .adapter.qqGuild import qqGuildv2LinkServerAPI
from .adapter.red import qqRedSDK
from .adapter.red import qqRedLinkServerAPI
from .adapter.OPQBot import OPQBotSDK
from .adapter.OPQBot import OPQBotLinkServerAPI
from .adapter.telegram import telegramSDK
from .adapter.telegram import telegramPollServerAPI
from .adapter.discord import discordSDK
from .adapter.discord import discordLinkServerAPI
from .adapter.hackChat import hackChatSDK
from .adapter.hackChat import hackChatLinkServerAPI
from .adapter.dodo import dodobotEAServerAPI
from .adapter.dodo import dodobotEATXAPI
from .adapter.dodo import dodobotEASDK
from .adapter.dodo import dodoSDK
from .adapter.dodo import dodoPollServerAPI
from .adapter.dodo import dodoLinkSDK
from .adapter.dodo import dodoLinkServerAPI
from .adapter.dingtalk import dingtalkSDK
from .adapter.dingtalk import dingtalkLinkServerAPI
from .adapter.fanbook import fanbookSDK
from .adapter.fanbook import fanbookPollServerAPI
from .adapter.kaiheila import kaiheilaSDK
from .adapter.kaiheila import kaiheilaLinkServerAPI
from .adapter.mhyVila import mhyVilaSDK
from .adapter.mhyVila import mhyVilaLinkServerAPI
from .adapter.biliLive import biliLiveSDK
from .adapter.biliLive import biliLiveLinkServerAPI
from .core.web import updateAPI
from .core.web import webTool
if platform.system() == 'Windows':
from . import multiLoginUIAPI
from . import libEXEModelAPI
from . import libWQEXEModelAPI
from . import libCWCBEXEModelAPI
from . import nativeWinUIAPI
from . import webviewUIAPI
from .nativeGUI import multiLoginUIAPI
from .libBooter import libEXEModelAPI
from .libBooter import libWQEXEModelAPI
from .libBooter import libCWCBEXEModelAPI
from .libBooter import libOPQBotEXEModelAPI
from .libBooter import libNapCatEXEModelAPI
from .libBooter import libAstralQsignEXEModelAPI
from .nativeGUI import nativeWinUIAPI
from .nativeGUI import webviewUIAPI
from . import userModule
140 changes: 140 additions & 0 deletions OlivOS/adapter/OPQBot/OPQBotLinkServerAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# -*- encoding: utf-8 -*-
'''
_______________________ ________________
__ __ \__ /____ _/_ | / /_ __ \_ ___/
_ / / /_ / __ / __ | / /_ / / /____ \
/ /_/ /_ /____/ / __ |/ / / /_/ /____/ /
\____/ /_____/___/ _____/ \____/ /____/

@File : OlivOS/OPQBotLinkServerAPI.py
@Author : lunzhiPenxil仑质
@Contact : [email protected]
@License : AGPL
@Copyright : (C) 2020-2023, OlivOS-Team
@Desc : None
'''

import time
import json
import websocket
import uuid
import threading

import OlivOS

gCheckList = [
'opqbot_default',
'opqbot_auto',
'opqbot_port',
'opqbot_port_old',
]

modelName = 'OPQBotLinkServerAPI'

class server(OlivOS.API.Proc_templet):
def __init__(self, Proc_name, scan_interval=0.001, dead_interval=1, rx_queue=None, tx_queue=None, logger_proc=None,
debug_mode=False, bot_info_dict=None):
OlivOS.API.Proc_templet.__init__(
self,
Proc_name=Proc_name,
Proc_type='OPQBot_link',
scan_interval=scan_interval,
dead_interval=dead_interval,
rx_queue=rx_queue,
tx_queue=tx_queue,
logger_proc=logger_proc
)
self.Proc_config['debug_mode'] = debug_mode
self.Proc_data['bot_info_dict'] = bot_info_dict
self.Proc_data['extend_data'] = {
'websocket_url': None,
'ws_obj': None,
'ws_item': None
}
self.Proc_data['platform_bot_info_dict'] = None

def run(self):
wsPath = f"ws://{self.Proc_data['bot_info_dict'].post_info.host}:{self.Proc_data['bot_info_dict'].post_info.port}/ws"
self.log(2, OlivOS.L10NAPI.getTrans('OlivOS OPQBot link server [{0}] is running on [{1}]', [self.Proc_name, wsPath], modelName))
threading.Thread(
target=self.message_router,
args=()
).start()
while True:
try:
self.Proc_data['extend_data']['websocket_url'] = wsPath
except:
self.Proc_data['extend_data']['websocket_url'] = None
if self.Proc_data['extend_data']['websocket_url'] is not None:
self.run_websocket_rx_connect_start()
time.sleep(self.Proc_info.scan_interval)

def on_message(self, ws, message):
try:
#print(message)
rx_data = json.loads(message)
rx_obj = OlivOS.OPQBotSDK.PAYLOAD.rxPacket(data=rx_data)
if rx_obj.active:
sdk_event = OlivOS.OPQBotSDK.event(rx_obj, self.Proc_data['bot_info_dict'])
tx_packet_data = OlivOS.pluginAPI.shallow.rx_packet(sdk_event)
self.Proc_info.tx_queue.put(tx_packet_data, block=False)
except:
pass

def on_error(self, ws, error):
self.log(0, OlivOS.L10NAPI.getTrans(
'OlivOS OPQBot link server [{0}] websocket link error',
[self.Proc_name],
modelName
))

def on_close(self, ws, close_status_code, close_msg):
self.log(0, OlivOS.L10NAPI.getTrans(
'OlivOS OPQBot link server [{0}] websocket link close',
[self.Proc_name],
modelName
))

def on_open(self, ws: websocket.WebSocketApp):
self.log(2, OlivOS.L10NAPI.getTrans(
'OlivOS OPQBot link server [{0}] websocket link start',
[self.Proc_name],
modelName
))

def run_websocket_rx_connect_start(self):
websocket.enableTrace(False)
ws = websocket.WebSocketApp(
self.Proc_data['extend_data']['websocket_url'],
on_open=self.on_open,
on_message=self.on_message,
on_error=self.on_error,
on_close=self.on_close
)
self.Proc_data['extend_data']['ws_obj'] = ws
self.Proc_data['extend_data']['ws_item'] = uuid.uuid4()
proxy_set = OlivOS.webTool.get_system_proxy_tuple('http')
ws.run_forever(http_proxy_host=proxy_set[0], http_proxy_port=proxy_set[1], proxy_type=proxy_set[2])
self.Proc_data['extend_data']['ws_obj'] = None
self.Proc_data['extend_data']['ws_item'] = None
self.log(2, OlivOS.L10NAPI.getTrans(
'OlivOS OPQBot link server [{0}] websocket link lost',
[self.Proc_name],
modelName
))

def message_router(self):
while True:
if self.Proc_data['extend_data']['ws_obj'] is None or self.Proc_info.rx_queue.empty():
time.sleep(self.Proc_info.scan_interval)
else:
try:
rx_packet_data = self.Proc_info.rx_queue.get(block=False)
except:
rx_packet_data = None
if rx_packet_data is not None:
if 'data' in rx_packet_data.key and 'action' in rx_packet_data.key['data']:
if 'send' == rx_packet_data.key['data']['action']:
if 'data' in rx_packet_data.key['data']:
#print(rx_packet_data.key['data']['data'])
self.Proc_data['extend_data']['ws_obj'].send(rx_packet_data.key['data']['data'])
Loading
Loading