diff --git a/lib/helpers.py b/lib/helpers.py index 0c4f1cd..272d9f4 100644 --- a/lib/helpers.py +++ b/lib/helpers.py @@ -233,7 +233,7 @@ def getCookiesFromBrowser(url): cmd_read_cookies = f"""SELECT name,value FROM moz_cookies WHERE host like ?;""" print(cmd_read_cookies) cursor = connection.cursor() - cursor.execute(cmd_read_cookies,('%'+url+'%',)) + cursor.execute(cmd_read_cookies,(urlToDomain(url),)) while len(rows)!=0: rows = cursor.fetchmany(25) for row in rows: @@ -249,13 +249,13 @@ def getCookiesFromBrowser(url): def urlToDomain(url): pos = patternSearch(url,"https://") urlCut = dropBeforePos(url,pos) - print("url cut",urlCut) - posDot = skipAfterChar(urlCut,'.') + posDot = skipAfterChar(urlCut,'.') - 1 urlCut = dropBeforePos(urlCut,posDot) - print("url after cut dot:",urlCut) - posDot = skipAfterChar(urlCut,'.') + posDot = skipAfterChar(urlCut,'/') urlCut = dropAfterPos(urlCut,posDot) print("url after cut dot:",urlCut) + return urlCut + def patternSearch(url,pattern): x = 0 for a,i in enumerate(url):