xync-client 0.0.110__py3-none-any.whl → 0.0.111__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of xync-client might be problematic. Click here for more details.

@@ -1,4 +1,3 @@
1
- import logging
2
1
  from asyncio import run
3
2
  from datetime import datetime
4
3
  from decimal import Decimal
@@ -8,7 +7,7 @@ from time import sleep
8
7
 
9
8
  from asyncpg.pgproto.pgproto import timedelta
10
9
  from payeer_api import PayeerAPI
11
- from playwright.async_api import async_playwright, Playwright, Locator
10
+ from playwright.async_api import async_playwright, Playwright
12
11
  from playwright._impl._errors import TimeoutError
13
12
 
14
13
  from xync_client.loader import TORM
@@ -39,50 +38,55 @@ class Client(PmAgentClient):
39
38
  await self.page.context.add_cookies([cookie])
40
39
  await self.page.goto(self.pages.SEND)
41
40
 
42
- async def send(self, dest: str, amount: int, cur: str) -> tuple[int, bytes, float]:
43
- self.last_active = datetime.now()
41
+ async def send(self, dest: str, amount: int, cur: str) -> tuple[int, bytes] | int:
44
42
  page = self.page
45
- try:
46
- await page.goto(self.pages.SEND)
47
- except TimeoutError:
48
- await login(self.agent)
49
- for cookie in self.agent.state["cookies"]:
50
- await page.context.add_cookies([cookie])
51
- await page.goto("https://payeer.com/en/account/send/")
43
+ if not page.url.startswith(self.pages.SEND):
44
+ try:
45
+ await page.goto(self.pages.SEND)
46
+ except TimeoutError:
47
+ await login(self.agent)
48
+ for cookie in self.agent.state["cookies"]:
49
+ await page.context.add_cookies([cookie])
50
+ await page.goto("https://payeer.com/en/account/send/")
52
51
  fiat_accounts = await page.locator(
53
52
  f".balance-item.balance-item--green.balance-item--{cur.lower()}"
54
53
  ).all_text_contents()
55
- has_amount = float(fiat_accounts[0].replace(",", "").strip())
56
- if float(amount) <= has_amount:
54
+ if float(amount) <= float(fiat_accounts[0].replace(",", "").strip()):
57
55
  await page.locator('input[name="param_ACCOUNT_NUMBER"]').fill(dest)
58
56
  await page.locator("select[name=curr_receive]").select_option(value=cur)
57
+ sleep(0.9)
58
+ await page.locator('input[name="sum_receive"]').fill(str(amount))
59
+ sleep(0.1)
60
+ # await page.locator("div.n-form--title").first.click()
61
+ # sleep(0.1)
62
+ await page.click(".btn.n-form--btn.n-form--btn-mod")
59
63
  sleep(0.5)
60
- await fill_amount(page.locator('input[name="sum_receive"]'), str(amount))
61
- await page.wait_for_selector(".btn.n-form--btn.n-form--btn-mod", state="visible", timeout=3000)
62
- sleep(1.5)
63
- await click_send(page.locator(".btn.n-form--btn.n-form--btn-mod:not(.repeat)"))
64
- await page.locator(".note_txt").wait_for(state="visible", timeout=6000)
64
+ await page.click(".btn.n-form--btn.n-form--btn-mod")
65
+ sleep(1.2)
66
+ if await page.locator(".input4").count():
67
+ await page.locator(".input4").fill(self.agent.auth.get("master_key"))
68
+ await page.click(".ok.button_green2")
69
+ sleep(0.1)
70
+ await page.locator(".note_txt").wait_for(state="visible")
65
71
  if await page.locator('.note_txt:has-text("successfully completed")').count():
66
72
  transaction = await page.locator(".note_txt").all_text_contents()
67
73
  trans_num = int(transaction[0].replace("Transaction #", "").split()[0])
68
74
  await page.goto("https://payeer.com/ru/account/history/")
69
- sleep(1.5)
70
75
  await page.click(f".history-id-{trans_num} a.link")
71
- await page.wait_for_selector(".ui-dialog.ui-corner-all", state="visible", timeout=5000)
72
76
  sleep(1)
73
77
  receipt = await page.query_selector(".ui-dialog.ui-corner-all")
74
- return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png"), has_amount
78
+ return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png")
75
79
  else:
76
80
  await self.bot.send("Payeer хз", self.uid, photo=await self.page.screenshot())
77
- raise Exception(dest, amount, cur)
81
+ return -1
78
82
  else:
79
- have_amount = float(fiat_accounts[0].strip())
83
+ have_amount = int(fiat_accounts[0].strip())
80
84
  await self.bot.send(
81
85
  f"Payeer no have {amount}, only {have_amount}{cur} to {dest}",
82
86
  self.uid,
83
87
  photo=await self.page.screenshot(),
84
88
  )
85
- raise Exception(f"Need {amount}{cur}, but has only {has_amount}")
89
+ return have_amount
86
90
 
87
91
  def check_in(
88
92
  self, amount: Decimal | int | float, cur: str, tme: datetime = None, tid: str | int = None
@@ -108,31 +112,6 @@ class Client(PmAgentClient):
108
112
  async def proof(self) -> bytes: ...
109
113
 
110
114
 
111
- async def fill_amount(loc: Locator, amount: str):
112
- await loc.wait_for(state="visible")
113
- await loc.fill(amount)
114
- sleep(2)
115
- if await loc.input_value() != amount or await loc.input_value() != amount:
116
- logging.warning("Fill amount repeated!")
117
- await fill_amount(loc, amount)
118
- else:
119
- ...
120
-
121
-
122
- async def click_send(loc1: Locator, count: int = 1):
123
- if await loc1.is_visible():
124
- await loc1.click(delay=90)
125
- sleep(2)
126
- try:
127
- await loc1.wait_for(state="hidden", timeout=2000 * count)
128
- except TimeoutError:
129
- if count < 4:
130
- logging.warning("Click repeated!")
131
- await click_send(loc1, count + 1)
132
- else:
133
- raise TimeoutError
134
-
135
-
136
115
  async def main(uid: int):
137
116
  from x_model import init_db
138
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-client
3
- Version: 0.0.110
3
+ Version: 0.0.111
4
4
  Author-email: Mike Artemiev <mixartemev@gmail.com>
5
5
  Project-URL: Homepage, https://gitlab.com/XyncNet/client
6
6
  Project-URL: Repository, https://gitlab.com/XyncNet/client
@@ -71,7 +71,7 @@ xync_client/Pms/Alfa/state.json,sha256=MKE6vl-JsJO9PNCVqoQgBgYZTgYkHCas7USwl8QFt
71
71
  xync_client/Pms/MTS/__init__.py,sha256=P_E7W46IZEk8RsEgl7H1xV3JplMT5l9vYQYTYyNbyQ8,2101
72
72
  xync_client/Pms/Ozon/__init__.py,sha256=EvQZDSPv0fOT2hNCTP44nXHOIEQvP5bQf_7HVLiZc2I,4123
73
73
  xync_client/Pms/Payeer/.gitignore,sha256=sWORdRp8ROppV2CsMEDJ3M_SokrNWCf8b1hlaNs64hg,12
74
- xync_client/Pms/Payeer/__init__.py,sha256=V9I1qCpdSc3TafUN8JW8xK3qsovU6CB_7cGx2hRuWVs,6642
74
+ xync_client/Pms/Payeer/__init__.py,sha256=hNREYMdRgyBqtZKN67YmKOy0wjjcxVFrwZhw4waEPqM,5919
75
75
  xync_client/Pms/Payeer/api.py,sha256=bb8qrlPYyWafel1VR-2nate6xBeRZAVciFJblHygfAs,549
76
76
  xync_client/Pms/Payeer/login.py,sha256=5PQ87zzk-0AXNNNy12jKUyp1Ub-eanqZVjrjsiIYcgg,1796
77
77
  xync_client/Pms/Sber/__init__.py,sha256=dxQfd9ZPhFTc_C4xrwaxrV6p0SijDCLNzBeUv3oQG38,4926
@@ -94,7 +94,7 @@ xync_client/TgWallet/order.py,sha256=BOmBx5WWfJv0-_-A8DcR-Xd8utqO_VTmSqSegm0cteQ
94
94
  xync_client/TgWallet/pyd.py,sha256=Ys3E8b3RLuyQ26frWT0F0BorkNxVpxnd18tY4Gp9dik,5636
95
95
  xync_client/TgWallet/pyro.py,sha256=2K7QWdo48k4MbbgQt90gdz_HiPck69Njm4xaMjIVgoo,1440
96
96
  xync_client/TgWallet/web.py,sha256=kDcv9SKKQPe91mw1qJBpbuyKYCAmZdfdHJylHumLBVU,1608
97
- xync_client-0.0.110.dist-info/METADATA,sha256=LH2TmZzXb8CAwblXRMNac30y4j4h4A9ynDkqVkhqVsA,990
98
- xync_client-0.0.110.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- xync_client-0.0.110.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
100
- xync_client-0.0.110.dist-info/RECORD,,
97
+ xync_client-0.0.111.dist-info/METADATA,sha256=snBZgo06UNxt0WsCWikf7Q-SYbjw5WgVWDhRYhzdq4c,990
98
+ xync_client-0.0.111.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ xync_client-0.0.111.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
100
+ xync_client-0.0.111.dist-info/RECORD,,