refactor: 添加订阅协程处理

This commit is contained in:
jxxghp
2025-08-02 09:14:38 +08:00
parent e5d2ade6e6
commit c2c8214075
8 changed files with 479 additions and 89 deletions
+14
View File
@@ -173,6 +173,20 @@ class SubscribeHelper(metaclass=WeakSingleton):
return True
return False
async def async_sub_reg(self, sub: dict) -> bool:
"""
异步新增订阅统计
"""
enabled, _ = self._check_subscribe_share_enabled()
if not enabled:
return False
res = await AsyncRequestUtils(proxies=settings.PROXY, timeout=5, headers={
"Content-Type": "application/json"
}).post_res(self._sub_reg, json=sub)
if res and res.status_code == 200:
return True
return False
def sub_done(self, sub: dict) -> bool:
"""
完成订阅统计