-
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.
Merge commit '033a49c82a2618c184ea47b6a4b7108c6bbda7fb'
- Loading branch information
Showing
59 changed files
with
789 additions
and
82 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.1.8" | ||
__version__ = "0.1.9" | ||
|
||
from .logo import * | ||
from .utils import * | ||
|
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
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
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
from .main_router import MRouter | ||
from .v1.main_router import MRouter |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,18 @@ | ||
from pydantic import BaseModel, Field | ||
|
||
class Total(BaseModel): | ||
gift: int = Field(example=999, description="礼物数量") | ||
enter: int = Field(example=999, description="进入房间次数") | ||
guard: int = Field(example=999, description="舰队数量") | ||
danmaku: int = Field(example=999, description="弹幕数量") | ||
superchat: int = Field(example=999, description="超级聊天数量") | ||
|
||
class Data(BaseModel): | ||
count: int = Field(example=999, description="直播记录总数") | ||
total: Total | ||
|
||
class get_total(BaseModel): | ||
code: int = Field(example=0, description="状态码") | ||
message: str = Field(example="success", description="状态信息") | ||
data: Data | ||
|
File renamed without changes.
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
6 changes: 3 additions & 3 deletions
6
app/pusher/router/_get_info.py → app/pusher/router/v1/_get_info.py
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
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
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
4 changes: 2 additions & 2 deletions
4
app/pusher/router/main_router.py → app/pusher/router/v1/main_router.py
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
from ._task_livestatus import live_status_inspectors | ||
from ._task_liveclear import live_clear_inspectors |
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,22 @@ | ||
from blivedm import logger | ||
|
||
from .utils import func_get_live_status | ||
|
||
from database.model import UIDS | ||
from database.connector import get_db_config_session | ||
|
||
|
||
def live_clear_inspectors(): | ||
with get_db_config_session() as config_db_session: | ||
uid_query_list = config_db_session.query(UIDS.uid).filter(UIDS.is_live == True).all() | ||
uid_list = [uid[0] for uid in uid_query_list] | ||
uid_dict = {"uids": uid_list} | ||
live_config = func_get_live_status(uid_dict, False) | ||
|
||
for x in live_config: | ||
uid = x["uid"] | ||
live_status_update = config_db_session.query(UIDS).filter(UIDS.uid == uid).first() | ||
live_status_update.is_live = False | ||
|
||
config_db_session.commit() | ||
logger.info(f"PREPARING LISTENING {uid}") |
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
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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
from blivedm import logger | ||
|
||
from .api import api_query_live_status | ||
|
||
def func_get_live_status(uid_list): | ||
def func_get_live_status( | ||
uid_list: list = [], | ||
check_live_code: bool = True, | ||
): | ||
live_list = [] | ||
if check_live_code: | ||
live_status = 1 | ||
else: | ||
live_status = 0 | ||
|
||
ret_json = api_query_live_status(uid_list) | ||
if ret_json["code"] != 0: | ||
return live_list | ||
|
||
for x, c in ret_json["data"].items(): | ||
if c["live_status"] == 1: | ||
live_list.append(c) | ||
try: | ||
for x, c in ret_json["data"].items(): | ||
if c["live_status"] == live_status: | ||
live_list.append(c) | ||
except: | ||
# logger.error("UID错误 {}") | ||
return [] | ||
|
||
return live_list |
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
Oops, something went wrong.