2024-01-18 16:35:17 +01:00
|
|
|
from playwright.sync_api import sync_playwright, expect, Page, BrowserContext
|
2024-01-17 17:22:26 +01:00
|
|
|
from playwright_stealth import stealth_sync
|
2024-01-18 16:35:17 +01:00
|
|
|
from pyvirtualdisplay.smartdisplay import SmartDisplay
|
2024-01-17 17:22:26 +01:00
|
|
|
|
2024-01-18 16:35:17 +01:00
|
|
|
from actions.cards import daily_cards, more_cards, all_cards
|
2024-01-17 17:22:26 +01:00
|
|
|
from actions.login import login
|
|
|
|
from actions.websearch import pc_search
|
2024-01-18 20:15:58 +01:00
|
|
|
from tools.browser_config import create_display, start_browser
|
|
|
|
from tools.config import load_parameters, check_config
|
2024-01-18 16:35:17 +01:00
|
|
|
from tools.logger import *
|
2024-01-18 20:15:58 +01:00
|
|
|
import sys
|
|
|
|
import json
|
2024-01-17 17:22:26 +01:00
|
|
|
|
|
|
|
|
2024-01-18 16:35:17 +01:00
|
|
|
def routine(mail: str, pwd: str, vnc: bool = False) -> None:
|
|
|
|
name = mail.split("@")[0]
|
|
|
|
# display = create_display(vnc)
|
|
|
|
# display.start()
|
|
|
|
page, browser = start_browser(name)
|
|
|
|
login(page, mail, pwd)
|
2024-01-17 17:22:26 +01:00
|
|
|
all_cards(page)
|
|
|
|
pc_search(page)
|
2024-01-18 16:35:17 +01:00
|
|
|
# display.stop()
|
|
|
|
browser.close()
|
2024-01-17 17:22:26 +01:00
|
|
|
|
|
|
|
|
2024-01-18 20:15:58 +01:00
|
|
|
def main():
|
|
|
|
data = load_parameters()
|
|
|
|
check_config(data)
|
2024-01-17 17:22:26 +01:00
|
|
|
|
2024-01-18 20:15:58 +01:00
|
|
|
|
|
|
|
# routine("EMAIL", "PWD", True)
|
|
|
|
# parse_file({"accounts": {"nb": 1, 0: {"mail": "piair338@gmail.com", "pwd": "<PASSWORD>"}}})
|
2024-01-17 17:22:26 +01:00
|
|
|
"""
|
|
|
|
TODO :
|
|
|
|
Fidelity management.
|
2024-01-18 16:35:17 +01:00
|
|
|
Daily search mobile
|
2024-01-18 20:15:58 +01:00
|
|
|
start -> with json config
|
|
|
|
-> allow claiming
|
|
|
|
-> default mode
|
2024-01-18 16:35:17 +01:00
|
|
|
--vnc-- Should work, but not tested with WSL.
|
2024-01-18 20:15:58 +01:00
|
|
|
remove unused imports
|
2024-01-17 17:22:26 +01:00
|
|
|
"""
|