diff --git a/StarRailUID/starrailuid_gachalog/draw_gachalogs.py b/StarRailUID/starrailuid_gachalog/draw_gachalogs.py index 7cf9b0e..8f26428 100644 --- a/StarRailUID/starrailuid_gachalog/draw_gachalogs.py +++ b/StarRailUID/starrailuid_gachalog/draw_gachalogs.py @@ -406,7 +406,7 @@ async def draw_gachalogs_img(uid: str, user_id: str) -> Union[bytes, str]: 'mm', ) y_extend += ( - (1 + ((total_data[type_list[index - 1]]['total'] - 1) // 5)) * 165 + (1 + ((total_data[type_list[index - 1]]['total'] - 1) // 5)) * 150 if index != 0 else 0 ) @@ -415,7 +415,7 @@ async def draw_gachalogs_img(uid: str, user_id: str) -> Union[bytes, str]: tasks = [] for item_index, item in enumerate(total_data[i]['list']): item_x = (item_index % 5) * 138 + 25 - item_y = (item_index // 5) * 150 + y + 355 + item_y = (item_index // 5) * 170 + y + 355 xy_point = (item_x, item_y) tasks.append( _draw_card( diff --git a/StarRailUID/utils/mys_api.py b/StarRailUID/utils/mys_api.py index 2a1deec..43cb2f7 100644 --- a/StarRailUID/utils/mys_api.py +++ b/StarRailUID/utils/mys_api.py @@ -36,23 +36,11 @@ RECOGNIZE_SERVER = { class MysApi(_MysApi): - mysVersion = '2.44.1' - _HEADER = { - 'x-rpc-app_version': mysVersion, - 'User-Agent': ( - 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) ' - f'AppleWebKit/605.1.15 (KHTML, like Gecko) miHoYoBBS/{mysVersion}' - ), - 'x-rpc-client_type': '5', - 'x-rpc-device_id': uuid.uuid4().hex, - 'x-rpc-device_fp': random_hex(16), - 'x-rpc-page': '3.1.3_#/rpg', - 'Referer': 'https://webstatic.mihoyo.com/', - 'Origin': 'https://webstatic.mihoyo.com', - } - def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self._HEADER['x-rpc-device_id'] = uuid.uuid4().hex + self._HEADER['x-rpc-device_fp'] = random_hex(14) + self._HEADER['x-rpc-page'] = '3.1.3_#/rpg' async def create_qrcode_url(self) -> Union[Dict, int]: device_id: str = ''.join(random.choices(ascii_letters + digits, k=64))