-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
68 lines (54 loc) · 2.07 KB
/
models.py
File metadata and controls
68 lines (54 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# coding=utf-8
import asyncio
import random
import string
import typing
from aiogram import Bot, types
from asyncio import sleep
from aiogram.utils.exceptions import RetryAfter
from config import *
from aiohttp import ClientSession
async def add_item(client: ClientSession,
dc_id: int, hex_key: typing.Any,
premium: bool):
ok = False
z = ''.join([random.choice(string.digits) for _ in range(5)])
def url(arg):
return 'https://api.zelenka.guru/market/{}'.format(arg)
headers = {'Authorization': f'Bearer {LOLZ_KEY}'}
while not ok:
await asyncio.sleep(3)
post_data = {
'title': LOLZ_ACCOUNT_TITLE,
'price': LOLZ_ACCOUNT_PRICE if not premium else LOLZ_ACCOUNT_PREMIUM_PRICE,
'category_id': 24,
'currency': 'rub',
'item_origin': LOLZ_ACCOUNT_ORIGIN,
'extended_guarantee': 0,
'description': LOLZ_ACCOUNT_DESCRIPTION
}
sell = await client.post(url('item/add/'), data=post_data, headers=headers)
if sell.status == 429:
await asyncio.sleep(6)
sell = await client.post(url('item/add/'), data=post_data, headers=headers)
sell_json = await sell.json()
item_id = sell_json['item']['item_id']
try:
print(f'[LOLZ {item_id}]', 'Аккаунт добавлен, и ожидает проверки')
except:
pass
sell_data = {
'login_password': str(hex_key)+':'+str(dc_id),
'extra[checkChannels]': 1,
'extra[checkSpam]': 1
}
await asyncio.sleep(3)
checkout = await client.post(url(f'{item_id}/goods/check'), data=sell_data, headers=headers)
if not checkout.ok:
pass
else:
try:
print(f'[LOLZ {item_id}] Аккаунт успешно загружен -> https://zelenka.guru/market/{item_id}')
except:
pass
return checkout