add force retry if first try fails, in cookie stealing

This commit is contained in:
2024-08-23 13:01:20 +02:00
parent c35f43ce8a
commit fa98c36096
5 changed files with 16 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ def findDefaultProfile(path):
else:
return target
def getCookiesFromBrowser(url):
def getCookiesFromBrowser(url,force=False):
DBFILE = "../db/sqlite3.db"
if os.name == 'posix':
homePath = os.path.expanduser('~')
@@ -63,7 +63,7 @@ def getCookiesFromBrowser(url):
cookie += ";"
print("Cookies:",cookie)
if cookie == '':
if cookie == '' and force == False:
if os.name == 'posix':
webbrowser.register("firefox",None,webbrowser.BackgroundBrowser("firefox"))
webbrowser.get('firefox').open(url)