MsRewards/V7/V7.py

44 lines
1.1 KiB
Python

from playwright.sync_api import sync_playwright, expect, Page, BrowserContext
from playwright_stealth import stealth_sync
from pyvirtualdisplay.smartdisplay import SmartDisplay
from actions.cards import daily_cards, more_cards, all_cards
from actions.login import login
from actions.websearch import pc_search
from tools.browser_setup import create_display, start_browser
from tools.config import load_parameters, check_config
from tools.logger import *
import sys
import json
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)
all_cards(page)
pc_search(page)
# display.stop()
browser.close()
def main():
data = load_parameters()
check_config(data)
# routine("EMAIL", "PWD", True)
# parse_file({"accounts": {"nb": 1, 0: {"mail": "piair338@gmail.com", "pwd": "<PASSWORD>"}}})
"""
TODO :
Fidelity management.
Daily search mobile
start -> with json config
-> allow claiming
-> default mode
--vnc-- Should work, but not tested with WSL.
remove unused imports
"""