- Samsung Galaxy Z Fold7 - ezt vártuk, de…
- Google Pixel topik
- A készlethiány jelezheti, jön az iPhone 16e és iPad Air utódja
- Redmi Note 15 Pro+ - több plusz, mint mínusz
- iPhone topik
- Realme GT 2 Pro - papírforma
- Azonnali mobilos kérdések órája
- Milyen okostelefont vegyek?
- Apple iPhone 13 mini - miért nem veszik elegen?
- Google Pixel 9 Pro XL - hét szűk esztendő
Új hozzászólás Aktív témák
-
Hege1234
addikt
Sziasztok!
hogyan tudnék kilépni ebből a loopból?
a firefox log fájljában kerestetek 10 token-t
a fájlok nem egyből kerülnek bele a mappába, hanem folyamatosan
és minden 100MB adat után csinál egy új fájlt
log.txt.moz_log.0
log.txt.moz_log.1
log.txt.moz_log.2így elképzelhető, hogy valamelyik token majd csak a 2. vagy 3. fájlban lesz megtalálható..
script:
import re
import time
import glob
log_file_pattern = ".\\firefox-log\\log.txt.moz_log.*"
tokens_to_find = 10
tokens_found = 0
processed_files = set()
while tokens_found < tokens_to_find:
log_files = glob.glob(log_file_pattern)
for file_path in log_files:
cutted_file_path = re.findall(r'\\([^\\]+)$', file_path)[0].strip()
if file_path not in processed_files:
try:
with open(file_path, 'r') as file:
tdata = file.read()
app_key = re.findall(r"header=.app_key..value=.(.*)..merge=0]", tdata)[0].strip()
azukiapp = re.findall(r"E/nsHttp...AzukiApp:.(.*)", tdata)[0].strip()
azukiststoken = re.findall(r"E/nsHttp...AzukiSTSToken:.(.*)", tdata)[0].strip()
natcho = re.findall(r"E/nsHttp.uri=.*natco_key=(.*)&device_type=WEB&channel_number=", tdata)[0].strip()
Device_Id = re.findall(r"header=.Device-Id..value=.(.*)..merge=0]", tdata)[0].strip()
bff_token = re.findall(r"header=.bff_token..value=.(.*)..merge=0]", tdata)[0].strip()
sess_id = re.findall(r"https://.*wv_getlicense.*session_uid=(.*?)&", tdata)[0].strip()
acc_ount = re.findall(r"E/nsHttp.uri=.*user_token=(.*)&session", tdata)[0].strip()
try:
azudrm = re.findall(r'D/n.*?AzukiApp.*?[^.].*?[^.]\"AzukiDRM\" value=\"(.*?)\"', tdata)[0].strip()
except:
azudrm = re.findall(r"E/nsHttp...AzukiApp:..*.*[^?].*[^?.].*[^?.]E/nsHttp...AzukiDRM:.(.*)", tdata)[0].strip()
get_lic = re.findall(r"E/nsHttp uri=(.*wv_getlicense.*token.*)", tdata)[0].strip()
print(f"Token found in {cutted_file_path}: app_key: {app_key}\n")
print(f"Token found in {cutted_file_path}: azukiapp: {azukiapp}\n")
print(f"Token found in {cutted_file_path}: azukiststoken: {azukiststoken}\n")
print(f"Token found in {cutted_file_path}: natcho: {natcho}\n")
print(f"Token found in {cutted_file_path}: Device_Id: {Device_Id}\n")
print(f"Token found in {cutted_file_path}: bff_token: {bff_token}\n")
print(f"Token found in {cutted_file_path}: sess_id: {sess_id}\n")
print(f"Token found in {cutted_file_path}: acc_ount: {acc_ount}\n")
print(f"Token found in {cutted_file_path}: azudrm: {azudrm}\n")
print(f"Token found in {cutted_file_path}: get_lic: {get_lic}\n")
tokens_found += 1
processed_files.add(file_path)
except (IndexError, FileNotFoundError):
print(f"Token not found in {cutted_file_path}. Waiting for the next attempt.")
except Exception as e:
print(f"Error processing {cutted_file_path}: {e}")
time.sleep(2)
print(f"All tokens found! Press Enter to exit.")
stopsdf = input('\stop now!')még a loopban lévő print:
Token not found in log.txt.moz_log.0. Waiting for the next attempt.
Token not found in log.txt.moz_log.0. Waiting for the next attempt.
Token not found in log.txt.moz_log.0. Waiting for the next attempt.
Token found in log.txt.moz_log.0: app_key: ex****k
Token found in log.txt.moz_log.0: azukiapp: 3**
Token found in log.txt.moz_log.0: azukiststoken: AuthTok****
Token found in log.txt.moz_log.0: natcho: T****0P
Token found in log.txt.moz_log.0: Device_Id: 95d6****a4
Token found in log.txt.moz_log.0: bff_token: AuthTok****
Token found in log.txt.moz_log.0: sess_id: e4ab****f91
Token found in log.txt.moz_log.0: acc_ount: 100****001
Token found in log.txt.moz_log.0: azudrm: bd****C0=
Token found in log.txt.moz_log.0: get_lic: htt****lsemajd miután a log.txt.moz_log.0 betelt és létrejön a log.txt.moz_log.1 a mappában
elkezdi azt is csekkolni több száz sort nem teszek be róla, de az így néz ki:Token not found in log.txt.moz_log.1. Waiting for the next attempt.
.
.
Token not found in log.txt.moz_log.1. Waiting for the next attempt.
Token not found in log.txt.moz_log.1. Waiting for the next attempt.
.
.
Token not found in log.txt.moz_log.1. Waiting for the next attempt.
Token not found in log.txt.moz_log.2. Waiting for the next attempt.
Token not found in log.txt.moz_log.3. Waiting for the next attempt.
Token not found in log.txt.moz_log.1. Waiting for the next attempt.azt nem értem, hogy a loop-ból miért nem tud kilépni amikor a mostani helyzetben már az 1. fájlban megtalál minden token-t amit kerestetek és a print jelzi is..

lehet kellene valahova egy break és az, hogy megadom hogy 10 tokent találjon meg az nem elég a kilépéshez?
vagy más ok miatt mehet mégis a következő fájlra?
Új hozzászólás Aktív témák
- NIOH 3
- Gitáros topic
- Samsung Galaxy Z Fold7 - ezt vártuk, de…
- Milyen program, ami...?
- Borotva, szakállnyíró, szakállvágó topic
- exHWSW - Értünk mindenhez IS
- Telekom TV SmartBox: szolgáltatói set-top box alacsony korlátokkal
- Életlen svájcibicska: Teszten az LG 45GX90SA okos gamer monitor
- Luck Dragon: Asszociációs játék. :)
- Google Pixel topik
- További aktív témák...
- Apple iPad Pro 13 M4 256GB Wi-Fi használt, szép állapot 98% akku (113 ciklus)
- MinisForum HM80 mini PC - Ryzen 7 4800 / 16GB / 512 GB SSD / Win 11
- REFURBISHED és ÚJ - Lenovo ThinkPad Ultra Docking Station (40AJ)
- Ryzen 5 5600 + WIFI-s GIGABYTE lap azonnal vihető
- Xiaomi 12 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest



