ouioui baguette

This commit is contained in:
piair 2022-02-18 10:57:01 +01:00
parent 9bcfe14527
commit 65b5c9902b

8
V4.py Normal file → Executable file
View File

@ -29,7 +29,7 @@ print("Linux : "+ str(IsLinux))
if not IsLinux : if not IsLinux :
system("") #enable colors in cmd system("") #enable colors in cmd
config_path = "./config" config_path = "/home/pi/MsReward/config"
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(config_path) config.read(config_path)
@ -58,8 +58,8 @@ def resource_path(relative_path): #permet de recuperer l'emplacement de chaque f
return path.join(base_path, relative_path) return path.join(base_path, relative_path)
def FirefoxMobile(Headless = Headless, Os = 2): def FirefoxMobile(Headless = Headless):
MOBILE_USER_AGENT = (f'Mozilla/5.0 (iPhone; CPU iPhone OS 14_1_{Os} like Mac OS X)' MOBILE_USER_AGENT = ('Mozilla/5.0 (iPhone; CPU iPhone OS 14_1_2 like Mac OS X)'
'AppleWebKit/603.1.30 (KHTML, like Gecko)' 'AppleWebKit/603.1.30 (KHTML, like Gecko)'
'Version/14.1 Mobile/14E304 Safari/602.1') 'Version/14.1 Mobile/14E304 Safari/602.1')
options = Options() options = Options()
@ -480,7 +480,7 @@ def BingMobileSearch(override = randint(22,25)):
MobileDriver ="si il y a ca dans les logs, c'est que Mobiledriver n'a pas demarrer " MobileDriver ="si il y a ca dans les logs, c'est que Mobiledriver n'a pas demarrer "
try : try :
try : try :
MobileDriver = FirefoxMobile(Os=hash(_mail)%10) #change device for each account MobileDriver = FirefoxMobile()
except Exception as e : except Exception as e :
sleep(30) sleep(30)
LogError('BingMobileSearch - 1 - echec de la creation du driver mobile') LogError('BingMobileSearch - 1 - echec de la creation du driver mobile')