(
self,
cookie: str,
uid: str,
needToken: bool = False,
game_id: Optional[int] = WAVES_GAME_ID,
)
| 83 | return waves_user |
| 84 | |
| 85 | async def get_used_headers( |
| 86 | self, |
| 87 | cookie: str, |
| 88 | uid: str, |
| 89 | needToken: bool = False, |
| 90 | game_id: Optional[int] = WAVES_GAME_ID, |
| 91 | ) -> Dict[str, Any]: |
| 92 | headers = { |
| 93 | "did": "", |
| 94 | "b-at": "", |
| 95 | } |
| 96 | if needToken: |
| 97 | headers["token"] = cookie |
| 98 | waves_user: Optional[WavesUser] = await WavesUser.select_data_by_cookie_and_uid( |
| 99 | cookie=cookie, |
| 100 | uid=uid, |
| 101 | game_id=game_id, |
| 102 | ) or await WavesUser.select_data_by_cookie( |
| 103 | cookie=cookie, |
| 104 | ) |
| 105 | |
| 106 | if not waves_user: |
| 107 | return headers |
| 108 | |
| 109 | headers["did"] = waves_user.did or "" |
| 110 | headers["b-at"] = waves_user.bat or "" |
| 111 | return headers |
| 112 | |
| 113 | async def get_self_ck( |
| 114 | self, uid: str, user_id: str, bot_id: str, game_id: int = WAVES_GAME_ID |
no test coverage detected