dep
This commit is contained in:
commit
fd33a824b2
17
README.md
Normal file
17
README.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Парсер канала телеграм для входа в стим
|
||||
|
||||
## Инструкция
|
||||
Установка зависимостей
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
.env
|
||||
```bash
|
||||
API_ID # api_id юзербота
|
||||
API_HASH # api_hash юзербота
|
||||
CHANNEL_URL=https://t.me/Burger_Game # ссылка на канал
|
||||
```
|
||||
Запуск проекта
|
||||
```bash
|
||||
python main.py
|
||||
```
|
254
credentials.json
Normal file
254
credentials.json
Normal file
@ -0,0 +1,254 @@
|
||||
{
|
||||
"accounts": [
|
||||
{
|
||||
"username": "thb111990",
|
||||
"password": "steamok111990",
|
||||
"date": "2025-05-14T16:16:05"
|
||||
},
|
||||
{
|
||||
"username": "lrtts643631",
|
||||
"password": "dGCR2cEfN_",
|
||||
"date": "2025-05-14T12:44:33"
|
||||
},
|
||||
{
|
||||
"username": "hazer3",
|
||||
"password": "S2477TT27EC6",
|
||||
"date": "2025-05-14T11:11:14"
|
||||
},
|
||||
{
|
||||
"username": "brbba2063",
|
||||
"password": "che600220",
|
||||
"date": "2025-05-13T21:52:58"
|
||||
},
|
||||
{
|
||||
"username": "keraoff",
|
||||
"password": "v,!86QZSG(<e6:<",
|
||||
"date": "2025-05-13T20:51:15"
|
||||
},
|
||||
{
|
||||
"username": "borankk06",
|
||||
"password": "wwe876we432",
|
||||
"date": "2025-05-13T20:51:15"
|
||||
},
|
||||
{
|
||||
"username": "steamok1089785",
|
||||
"password": "steamok432",
|
||||
"date": "2025-05-13T14:01:45"
|
||||
},
|
||||
{
|
||||
"username": "enigma2370",
|
||||
"password": "users/14642501",
|
||||
"date": "2025-05-13T12:45:28"
|
||||
},
|
||||
{
|
||||
"username": "joaostocler",
|
||||
"password": "retii1377+-+",
|
||||
"date": "2025-05-12T23:11:48"
|
||||
},
|
||||
{
|
||||
"username": "ynysa422",
|
||||
"password": "@Gamerspace123",
|
||||
"date": "2025-05-12T23:11:48"
|
||||
},
|
||||
{
|
||||
"username": "kEasddfas21",
|
||||
"password": "https://funpay.com/users/4988354/",
|
||||
"date": "2025-05-12T12:11:51"
|
||||
},
|
||||
{
|
||||
"username": "xrikm135",
|
||||
"password": "steamok003004",
|
||||
"date": "2025-05-12T11:02:42"
|
||||
},
|
||||
{
|
||||
"username": "meteprotr",
|
||||
"password": "3D88ASX2AMCG",
|
||||
"date": "2025-05-12T11:02:41"
|
||||
},
|
||||
{
|
||||
"username": "wyvern_d",
|
||||
"password": "https://funpay.com/users/6052434/",
|
||||
"date": "2025-05-11T19:10:21"
|
||||
},
|
||||
{
|
||||
"username": "rd5977",
|
||||
"password": "951753852.ACHU",
|
||||
"date": "2025-05-11T14:32:54"
|
||||
},
|
||||
{
|
||||
"username": "aitololi5678",
|
||||
"password": "05062549",
|
||||
"date": "2025-05-11T14:32:53"
|
||||
},
|
||||
{
|
||||
"username": "hdldkfldicm",
|
||||
"password": "https://funpay.com/users/6052434/",
|
||||
"date": "2025-05-10T16:21:42"
|
||||
},
|
||||
{
|
||||
"username": "mbig4912",
|
||||
"password": "Eb2PLbZ3",
|
||||
"date": "2025-05-10T16:06:35"
|
||||
},
|
||||
{
|
||||
"username": "przgk23389",
|
||||
"password": "https://funpay.com/users/5553224/",
|
||||
"date": "2025-05-09T21:12:44"
|
||||
},
|
||||
{
|
||||
"username": "ekoqj08zyl",
|
||||
"password": "https://funpay.com/lots/offer?id=36393416",
|
||||
"date": "2025-05-09T15:39:00"
|
||||
},
|
||||
{
|
||||
"username": "platinummonsterbeatz2",
|
||||
"password": "boduyashops2",
|
||||
"date": "2025-05-09T15:39:00"
|
||||
},
|
||||
{
|
||||
"username": "prokap9",
|
||||
"password": "E1PIqrDGdjxJJd",
|
||||
"date": "2025-05-09T15:39:00"
|
||||
},
|
||||
{
|
||||
"username": "tilmant6",
|
||||
"password": "https://funpay.com/users/6052434/",
|
||||
"date": "2025-05-08T19:37:47"
|
||||
},
|
||||
{
|
||||
"username": "shynich",
|
||||
"password": "EKXCFBAC4XME",
|
||||
"date": "2025-05-08T15:51:56"
|
||||
},
|
||||
{
|
||||
"username": "Shixize1",
|
||||
"password": "PwxcoNGgFM",
|
||||
"date": "2025-05-08T13:19:23"
|
||||
},
|
||||
{
|
||||
"username": "pvztl641",
|
||||
"password": "guLILI198611",
|
||||
"date": "2025-05-07T19:35:40"
|
||||
},
|
||||
{
|
||||
"username": "crystallil1",
|
||||
"password": "1crysteine",
|
||||
"date": "2025-05-07T16:34:31"
|
||||
},
|
||||
{
|
||||
"username": "niodev",
|
||||
"password": "funpay.onibist.users.5871937.",
|
||||
"date": "2025-05-07T14:09:54"
|
||||
},
|
||||
{
|
||||
"username": "funpayandst2011firewatch1478",
|
||||
"password": "https://funpay.com/users/6115110/",
|
||||
"date": "2025-05-07T14:03:43"
|
||||
},
|
||||
{
|
||||
"username": "heqxa1234567",
|
||||
"password": "Annforeman91",
|
||||
"date": "2025-05-06T16:35:16"
|
||||
},
|
||||
{
|
||||
"username": "playerok_aeg2142",
|
||||
"password": "playerok.com/profile/AEG",
|
||||
"date": "2025-05-06T16:35:16"
|
||||
},
|
||||
{
|
||||
"username": "Met4morphosisFUNPAY",
|
||||
"password": "1FunMet4morphosisPay1@",
|
||||
"date": "2025-05-06T16:35:16"
|
||||
},
|
||||
{
|
||||
"username": "onibister",
|
||||
"password": "FunpayOnibist228",
|
||||
"date": "2025-05-05T20:46:55"
|
||||
},
|
||||
{
|
||||
"username": "Met4morphosisFUNPAY",
|
||||
"password": "1FunMet4morphosisPay1@",
|
||||
"date": "2025-05-05T16:01:51"
|
||||
},
|
||||
{
|
||||
"username": "bautinvova",
|
||||
"password": "https://funpay.com/users/5224808/",
|
||||
"date": "2025-05-05T12:47:08"
|
||||
},
|
||||
{
|
||||
"username": "vqp44022",
|
||||
"password": "quc47770",
|
||||
"date": "2025-05-05T12:47:08"
|
||||
},
|
||||
{
|
||||
"username": "zach1764362",
|
||||
"password": "4vbcwcwn",
|
||||
"date": "2025-05-05T12:47:08"
|
||||
},
|
||||
{
|
||||
"username": "megamaseridoy",
|
||||
"password": "CELEBi7867*#",
|
||||
"date": "2025-05-05T12:47:08"
|
||||
},
|
||||
{
|
||||
"username": "dl3x1",
|
||||
"password": "https://funpay.com/users/14354719/",
|
||||
"date": "2025-05-03T16:25:59"
|
||||
},
|
||||
{
|
||||
"username": "1431kong",
|
||||
"password": "UFBTDZCMXCSV",
|
||||
"date": "2025-05-03T16:25:59"
|
||||
},
|
||||
{
|
||||
"username": "lh11cuwo",
|
||||
"password": "qi55FEDN",
|
||||
"date": "2025-05-03T16:25:59"
|
||||
},
|
||||
{
|
||||
"username": "Bt5Pd3Zm9Sz4",
|
||||
"password": "Yk2Ho8Wl5Im2",
|
||||
"date": "2025-05-03T16:25:59"
|
||||
},
|
||||
{
|
||||
"username": "lrtts643631",
|
||||
"password": "dGCR2cEfN_",
|
||||
"date": "2025-05-02T15:07:06"
|
||||
},
|
||||
{
|
||||
"username": "fpfuryfamily",
|
||||
"password": "thxfp362",
|
||||
"date": "2025-05-02T15:07:06"
|
||||
},
|
||||
{
|
||||
"username": "ShezyyyFunPay",
|
||||
"password": "funpay.com/users/8943271/",
|
||||
"date": "2025-05-01T16:45:17"
|
||||
},
|
||||
{
|
||||
"username": "fmih9tqp",
|
||||
"password": "BulbulofficialFunPay",
|
||||
"date": "2025-05-01T16:45:17"
|
||||
},
|
||||
{
|
||||
"username": "impericon",
|
||||
"password": "2O9CLXJFBQXT",
|
||||
"date": "2025-04-30T21:47:13"
|
||||
},
|
||||
{
|
||||
"username": "fpfuryfamily",
|
||||
"password": "thxfp362",
|
||||
"date": "2025-04-30T14:23:32"
|
||||
},
|
||||
{
|
||||
"username": "komski01",
|
||||
"password": "omarca06",
|
||||
"date": "2025-04-29T22:59:56"
|
||||
},
|
||||
{
|
||||
"username": "quincypugy",
|
||||
"password": "0Heh%v4SSG",
|
||||
"date": "2025-04-29T18:42:08"
|
||||
}
|
||||
]
|
||||
}
|
1
credentials_backup.json
Normal file
1
credentials_backup.json
Normal file
@ -0,0 +1 @@
|
||||
{"accounts": [{"username": "enigma2370", "password": "users/14642501", "date": "2025-05-13T15:40:48"}, {"username": "enigma2370", "password": "users/14642501", "date": "2025-05-13T15:33:40"}, {"username": "enigma2370", "password": "users/14642501", "date": "2025-05-13T15:32:32"}, {"username": "thb111990", "password": "steamok111990", "date": "2025-05-14T16:16:05"}, {"username": "lrtts643631", "password": "dGCR2cEfN_", "date": "2025-05-14T12:44:33"}, {"username": "hazer3", "password": "S2477TT27EC6", "date": "2025-05-14T11:11:14"}, {"username": "brbba2063", "password": "che600220", "date": "2025-05-13T21:52:58"}]}
|
74
main.py
Normal file
74
main.py
Normal file
@ -0,0 +1,74 @@
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from pyrogram import Client
|
||||
|
||||
from steam_parser.steam import SteamLogin
|
||||
from utils.strings import parse_post
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
handlers=[
|
||||
logging.FileHandler("steam_guard.log", encoding='utf-8'),
|
||||
logging.StreamHandler()
|
||||
]
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
load_dotenv()
|
||||
|
||||
API_ID = os.getenv('API_ID')
|
||||
API_HASH = os.getenv('API_HASH')
|
||||
CHANNEL_URL = os.getenv('CHANNEL_URL')
|
||||
|
||||
|
||||
async def fetch_and_monitor_accounts():
|
||||
client = Client(
|
||||
name='pyrogram_session',
|
||||
api_id=API_ID,
|
||||
api_hash=API_HASH
|
||||
)
|
||||
|
||||
channel_name = os.path.basename(CHANNEL_URL)
|
||||
|
||||
await client.start()
|
||||
|
||||
processed_messages = set() # Хранение ID обработанных сообщений
|
||||
|
||||
while True:
|
||||
accounts = []
|
||||
async for message in client.get_chat_history(channel_name, limit=200):
|
||||
text = message.text or message.caption
|
||||
if text and message.id not in processed_messages:
|
||||
pairs = parse_post(text)
|
||||
for login, password in pairs:
|
||||
accounts.append({
|
||||
'username': login,
|
||||
'password': password,
|
||||
'date': message.date.isoformat()
|
||||
})
|
||||
processed_messages.add(message.id)
|
||||
|
||||
if accounts:
|
||||
# Сортируем по дате (от новых к старым)
|
||||
accounts.sort(key=lambda x: x['date'], reverse=True)
|
||||
top_50 = accounts[:50]
|
||||
|
||||
with open('credentials.json', 'w', encoding='utf-8') as f:
|
||||
json.dump({'accounts': top_50}, f, indent=4, ensure_ascii=False)
|
||||
|
||||
logger.info(f"\n✅ Сохранено {len(top_50)} аккаунтов в credentials.json")
|
||||
|
||||
SteamLogin().open_steam_login_page_and_type()
|
||||
|
||||
await asyncio.sleep(30)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(fetch_and_monitor_accounts())
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Pyrogram==2.1.32
|
||||
python-dotenv==1.1.0
|
||||
selenium==4.32.0
|
66
steam_guard.log
Normal file
66
steam_guard.log
Normal file
@ -0,0 +1,66 @@
|
||||
2025-05-14 17:49:36,392 - pyrogram.session.auth - INFO - Start creating a new auth key on DC2
|
||||
2025-05-14 17:49:36,392 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:49:36,395 - pyrogram.connection.connection - INFO - Connected! Production DC2 - IPv4
|
||||
2025-05-14 17:49:38,548 - pyrogram.session.auth - INFO - Done auth key exchange: DhGenOk
|
||||
2025-05-14 17:49:38,549 - pyrogram.connection.connection - INFO - Disconnected
|
||||
2025-05-14 17:49:38,608 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:49:38,610 - pyrogram.connection.connection - INFO - Connected! Production DC2 - IPv4
|
||||
2025-05-14 17:49:38,612 - pyrogram.session.session - INFO - NetworkTask started
|
||||
2025-05-14 17:49:39,404 - pyrogram.session.session - INFO - Session initialized: Pyrogram v2.2.3 (Layer 203)
|
||||
2025-05-14 17:49:39,404 - pyrogram.session.session - INFO - Device: CPython 3.10.0 - Pyrogram 2.2.3
|
||||
2025-05-14 17:49:39,404 - pyrogram.session.session - INFO - System: Windows 10 (en)
|
||||
2025-05-14 17:49:39,404 - pyrogram.session.session - INFO - Session started
|
||||
2025-05-14 17:49:39,419 - pyrogram.session.session - INFO - PingTask started
|
||||
2025-05-14 17:50:28,601 - pyrogram.session.session - INFO - PingTask stopped
|
||||
2025-05-14 17:50:28,602 - pyrogram.connection.connection - INFO - Disconnected
|
||||
2025-05-14 17:50:28,602 - pyrogram.session.session - INFO - NetworkTask stopped
|
||||
2025-05-14 17:50:28,602 - pyrogram.session.session - INFO - Session stopped
|
||||
2025-05-14 17:50:28,632 - pyrogram.session.auth - INFO - Start creating a new auth key on DC1
|
||||
2025-05-14 17:50:28,633 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:50:28,635 - pyrogram.connection.connection - INFO - Connected! Production DC1 - IPv4
|
||||
2025-05-14 17:50:31,168 - pyrogram.session.auth - INFO - Done auth key exchange: DhGenOk
|
||||
2025-05-14 17:50:31,169 - pyrogram.connection.connection - INFO - Disconnected
|
||||
2025-05-14 17:50:31,210 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:50:31,211 - pyrogram.connection.connection - INFO - Connected! Production DC1 - IPv4
|
||||
2025-05-14 17:50:31,212 - pyrogram.session.session - INFO - NetworkTask started
|
||||
2025-05-14 17:50:32,594 - pyrogram.session.session - INFO - Session initialized: Pyrogram v2.2.3 (Layer 203)
|
||||
2025-05-14 17:50:32,595 - pyrogram.session.session - INFO - Device: CPython 3.10.0 - Pyrogram 2.2.3
|
||||
2025-05-14 17:50:32,595 - pyrogram.session.session - INFO - System: Windows 10 (en)
|
||||
2025-05-14 17:50:32,595 - pyrogram.session.session - INFO - Session started
|
||||
2025-05-14 17:50:32,595 - pyrogram.session.session - INFO - PingTask started
|
||||
2025-05-14 17:50:42,818 - pyrogram.dispatcher - INFO - Started 16 HandlerTasks
|
||||
2025-05-14 17:50:43,961 - __main__ - INFO -
|
||||
✅ Сохранено 6 аккаунтов в credentials.json
|
||||
2025-05-14 17:51:08,967 - steam_parser.steam - INFO - Вход для аккаунта enigma2370 не удался. Ошибка: семейный доступ
|
||||
2025-05-14 17:51:21,795 - steam_parser.steam - INFO - Вход для аккаунта enigma2370 не удался. Ошибка: семейный доступ
|
||||
2025-05-14 17:51:34,540 - steam_parser.steam - INFO - Вход для аккаунта enigma2370 не удался. Ошибка: семейный доступ
|
||||
2025-05-14 17:52:16,841 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:52:16,843 - pyrogram.connection.connection - INFO - Connected! Production DC1 - IPv4
|
||||
2025-05-14 17:52:16,846 - pyrogram.session.session - INFO - NetworkTask started
|
||||
2025-05-14 17:52:17,930 - pyrogram.session.session - INFO - Session initialized: Pyrogram v2.2.3 (Layer 203)
|
||||
2025-05-14 17:52:17,931 - pyrogram.session.session - INFO - Device: CPython 3.10.0 - Pyrogram 2.2.3
|
||||
2025-05-14 17:52:17,931 - pyrogram.session.session - INFO - System: Windows 10 (en)
|
||||
2025-05-14 17:52:17,931 - pyrogram.session.session - INFO - Session started
|
||||
2025-05-14 17:52:17,940 - pyrogram.session.session - INFO - PingTask started
|
||||
2025-05-14 17:52:18,579 - pyrogram.dispatcher - INFO - Started 16 HandlerTasks
|
||||
2025-05-14 17:55:18,127 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_date` property is deprecated and will be removed in future updates. Use `message.forward_origin.date` instead.
|
||||
2025-05-14 17:55:18,127 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_from` is deprecated and will be removed in future updates. Use `message.forward_origin.sender_user` instead.
|
||||
2025-05-14 17:55:18,127 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_from_chat` property is deprecated and will be removed in future updates. Use `message.forward_origin.chat.sender_chat` instead.
|
||||
2025-05-14 17:55:18,128 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_from_message_id` property is deprecated and will be removed in future updates. Use `message.forward_origin.message_id` instead.
|
||||
2025-05-14 17:55:18,128 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_sender_name` property is deprecated and will be removed in future updates. Use `message.forward_origin.sender_user_name` instead.
|
||||
2025-05-14 17:55:18,128 - pyrogram.types.messages_and_media.message - WARNING - `message.forward_signature` property is deprecated and will be removed in future updates. Use `message.forward_origin.author_signature` instead.
|
||||
2025-05-14 17:56:26,995 - pyrogram.connection.connection - INFO - Connecting...
|
||||
2025-05-14 17:56:26,998 - pyrogram.connection.connection - INFO - Connected! Production DC1 - IPv4
|
||||
2025-05-14 17:56:27,001 - pyrogram.session.session - INFO - NetworkTask started
|
||||
2025-05-14 17:56:28,096 - pyrogram.session.session - INFO - Session initialized: Pyrogram v2.2.3 (Layer 203)
|
||||
2025-05-14 17:56:28,096 - pyrogram.session.session - INFO - Device: CPython 3.10.0 - Pyrogram 2.2.3
|
||||
2025-05-14 17:56:28,097 - pyrogram.session.session - INFO - System: Windows 10 (en)
|
||||
2025-05-14 17:56:28,097 - pyrogram.session.session - INFO - Session started
|
||||
2025-05-14 17:56:28,105 - pyrogram.session.session - INFO - PingTask started
|
||||
2025-05-14 17:56:28,600 - pyrogram.dispatcher - INFO - Started 16 HandlerTasks
|
||||
2025-05-14 17:56:30,313 - __main__ - INFO -
|
||||
✅ Сохранено 50 аккаунтов в credentials.json
|
||||
2025-05-14 17:57:11,003 - steam_parser.steam - INFO - Вход для аккаунта thb111990 не удался. Ошибка: красная табличка
|
||||
2025-05-14 17:57:25,245 - steam_parser.steam - INFO - Вход для аккаунта lrtts643631 не удался. Ошибка: семейный доступ
|
||||
2025-05-14 17:57:46,616 - steam_parser.steam - INFO - Вход для аккаунта hazer3 не удался. Ошибка: красная табличка
|
||||
2025-05-14 17:58:09,894 - steam_parser.steam - INFO - Вход для аккаунта brbba2063 не удался. Ошибка: красная табличка
|
149
steam_parser/steam.py
Normal file
149
steam_parser/steam.py
Normal file
@ -0,0 +1,149 @@
|
||||
import json
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SteamLogin():
|
||||
def __init__(self):
|
||||
if not os.path.exists('credentials_backup.json'):
|
||||
open('credentials_backup.json', 'w').write(json.dumps({'accounts': []}))
|
||||
|
||||
options = Options()
|
||||
prefs = {
|
||||
"credentials_enable_service": False,
|
||||
"profile.password_manager_enabled": False,
|
||||
"profile.password_manager_leak_detection": False # Отключение проверки утечек паролей
|
||||
}
|
||||
options.add_experimental_option("prefs", prefs)
|
||||
self.driver = webdriver.Chrome(
|
||||
options=options
|
||||
)
|
||||
|
||||
def __wait_get(self, xpath: str, timeout: int = 15):
|
||||
try:
|
||||
return WebDriverWait(self.driver, timeout).until(
|
||||
EC.presence_of_element_located(('xpath', xpath))
|
||||
)
|
||||
except Exception as e:
|
||||
...
|
||||
|
||||
|
||||
def __write_to_json(self, account: dict):
|
||||
with open('credentials_backup.json', 'r') as file:
|
||||
data = json.load(file)
|
||||
data['accounts'].append(account)
|
||||
|
||||
open('credentials_backup.json', 'w').write(json.dumps(data))
|
||||
|
||||
|
||||
def open_steam_login_page_and_type(self):
|
||||
# Открываем страницу входа в Steam
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
|
||||
# Загружаем учетные данные из JSON файла
|
||||
with open('credentials.json', 'r') as file:
|
||||
data = json.load(file)
|
||||
|
||||
with open('credentials_backup.json', 'r') as file:
|
||||
archive = json.load(file)['accounts']
|
||||
|
||||
for account in data['accounts']:
|
||||
|
||||
if account in archive:
|
||||
continue
|
||||
|
||||
time.sleep(30)
|
||||
|
||||
username = account['username']
|
||||
password = account['password']
|
||||
|
||||
# Задержка перед заходом в аккаунт
|
||||
WebDriverWait(self.driver, 30).until(
|
||||
EC.presence_of_element_located(("xpath", '//*[@id="responsive_page_template_content"]/div[1]/div[1]/div/div/div/div[2]/div/form/div[1]/input'))
|
||||
)
|
||||
|
||||
# Вводим имя пользователя
|
||||
self.driver.find_element("xpath", '//*[@id="responsive_page_template_content"]/div[1]/div[1]/div/div/div/div[2]/div/form/div[1]/input').send_keys(username)
|
||||
|
||||
# Вводим пароль
|
||||
self.driver.find_element("xpath", '//*[@id="responsive_page_template_content"]/div[1]/div[1]/div/div/div/div[2]/div/form/div[2]/input').send_keys(password)
|
||||
|
||||
# Нажимаем на кнопку входа
|
||||
self.driver.find_element("xpath", '//*[@id="responsive_page_template_content"]/div[1]/div[1]/div/div/div/div[2]/div/form/div[4]/button').click()
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
is_code = self.__wait_get('//*[@id="responsive_page_template_content"]/div[1]/div[1]/div/div/div/div[2]/form/div/a', 5)
|
||||
if is_code:
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
self.__write_to_json(account)
|
||||
logger.info(f"Вход для аккаунта {username} не удался. Ошибка: требуется код из почты")
|
||||
continue
|
||||
|
||||
is_authed = self.__wait_get('//*[@id="account_pulldown"]', 5)
|
||||
if not is_authed:
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
self.__write_to_json(account)
|
||||
logger.info(f"Вход для аккаунта {username} не удался. Ошибка: не авторизован")
|
||||
continue
|
||||
|
||||
is_family = self.__wait_get('//*[@id="parental_main_content"]/div/div/form/div/div[4]/button', 5)
|
||||
if is_family:
|
||||
self.__wait_get('//*[@id="account_pulldown"]').click()
|
||||
self.__wait_get('//*[@id="account_dropdown"]/div/a[last()]').click()
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
self.__write_to_json(account)
|
||||
logger.info(f"Вход для аккаунта {username} не удался. Ошибка: семейный доступ")
|
||||
continue
|
||||
|
||||
# Проверяем, успешен ли вход, ищем нужный элемент
|
||||
try:
|
||||
self.driver.find_element('xpath', '//*[@id="account_pulldown"]').click()
|
||||
WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located(('xpath', '//*[@id="account_dropdown"]/div/a[2]'))
|
||||
)
|
||||
self.driver.find_element('xpath', '//*[@id="account_dropdown"]/div/a[2]').click()
|
||||
self.driver.find_element('xpath', '//*[@id="main_content"]/div[1]/a[4]').click()
|
||||
WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located(('xpath', '//*[@id="main_content"]/div[2]/div/div[2]/div[3]/div[5]/div[2]/a'))
|
||||
).click()
|
||||
WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located(('xpath', '//*[@id="email_authenticator_form"]/div/div[2]/label'))
|
||||
).click()
|
||||
|
||||
is_red = self.__wait_get('/html/body/div[6]/div/div/div[1]/div/a/span')
|
||||
if is_red:
|
||||
self.__wait_get('//*[@id="account_pulldown"]').click()
|
||||
self.__wait_get('//*[@id="account_dropdown"]/div/a[last()]').click()
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
self.__write_to_json(account)
|
||||
logger.info(f"Вход для аккаунта {username} не удался. Ошибка: красная табличка")
|
||||
continue
|
||||
|
||||
WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located(('xpath', '//*[@id="deauthorize_devices_form"]/div/a/span'))
|
||||
).click()
|
||||
WebDriverWait(self.driver, 10).until(
|
||||
EC.presence_of_element_located(('xpath', '/html/body/div[4]/div[3]/div/div[2]/div[1]'))
|
||||
).click()
|
||||
self.__wait_get('//*[@id="account_pulldown"]').click()
|
||||
self.__wait_get('//*[@id="account_dropdown"]/div/a[last()]').click()
|
||||
logger.info(f"✅ Guard code установлен для аккаунта: {username}")
|
||||
time.sleep(5)
|
||||
|
||||
except Exception as e:
|
||||
# Если элемент не найден, переход к следующему аккаунту
|
||||
logger.info(f"Вход для аккаунта {username} не удался. Ошибка: {str(e)}")
|
||||
|
||||
# Возвращаемся на страницу входа для следующего аккаунта
|
||||
self.__write_to_json(account)
|
||||
self.driver.get("https://steamcommunity.com/login/home/?goto=")
|
||||
|
29
utils/strings.py
Normal file
29
utils/strings.py
Normal file
@ -0,0 +1,29 @@
|
||||
import re
|
||||
|
||||
|
||||
def clean_text(text):
|
||||
# Удаляем табуляции, неразрывные пробелы, кавычки и обратные кавычки
|
||||
text = re.sub(r'[\t\xa0"`]+', ' ', text)
|
||||
text = re.sub(r'\*{2,}', '', text)
|
||||
return re.sub(r'\s+', ' ', text).strip()
|
||||
|
||||
|
||||
|
||||
def parse_post(text):
|
||||
cleaned = clean_text(text)
|
||||
results = []
|
||||
pattern = re.compile(r'(?:логин|login)[\s:]*([^\s\n]+)[^\n\r]*(?:пароль|password)[\s:]*([^\s\n]+)', re.IGNORECASE)
|
||||
alt_login = re.findall(r'(?:логин|login)[\s:]*([^\s\n]+)', cleaned, re.IGNORECASE)
|
||||
alt_pass = re.findall(r'(?:пароль|password)[\s:]*([^\s\n]+)', cleaned, re.IGNORECASE)
|
||||
|
||||
matches = pattern.findall(cleaned)
|
||||
for login, password in matches:
|
||||
if 3 <= len(login) <= 50 and 4 <= len(password) <= 300:
|
||||
results.append((login.strip(), password.strip()))
|
||||
|
||||
if not results and len(alt_login) == len(alt_pass):
|
||||
for login, password in zip(alt_login, alt_pass):
|
||||
if 3 <= len(login) <= 50 and 4 <= len(password) <= 300:
|
||||
results.append((login.strip(), password.strip()))
|
||||
|
||||
return results
|
Loading…
x
Reference in New Issue
Block a user