- Xiaomi 17 - még mindig tart
- Samsung Galaxy Watch5 Pro - kerek, de nem tekerek
- Redmi Note 15 Pro+ - több plusz, mint mínusz
- Motorola Edge 50 Fusion - jó fogás
- Válságmódban a Samsung mobildivíziója
- Vége a dalnak: nincs több Samsung harmonikamobil
- Dreame Pilot - Álomhaj, ó!
- Yettel topik
- VoLTE/VoWiFi
- Külföldi prepaid SIM-ek itthon
Ú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
- Xiaomi 17 - még mindig tart
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- PlayStation 5
- Okos otthon - Home Assistant, openHAB és más nyílt rendszerek
- A tajvani chipgyártóknak is beteszi a kaput a Hormuzi-szoros lezárása
- Béta iOS-t használók topikja
- gban: Ingyen kellene, de tegnapra
- Energiaital topic
- Anglia - élmények, tapasztalatok
- LG LCD és LED TV-k
- További aktív témák...
- Keresek Geforce 2-3-4 titánium, GTX 260 kártyákat
- Sennheiser PXC 550-II aktív zajszűrős fejhallgató eladó
- Bowers & Wilkins Dm 303 EISA díjas audiofil hangfal + Lcr 3 center
- Dell ReadyRails A6 1U Rail Kit R210, R210 II, Dx600G, stb. szerverekhez (JWFR6, W6XNW, YNG10)
- Kingston HyperX Fury 2x4GB 2133MHz DDR4 kit / Beszámítás OK! / Akciós Ár!
- Dell UltraSharp 24 USB-C Hub Monitor - U2422HE - 27% ÁFÁs
- Sosemhasznált! HP OmniBook 5 Flip i5-1334U 16GB 1000GB 14" FHD+ áthajtós-érintős Gar.: 1 év
- Ritkaság! Csere-Beszámítás! EVGA FTW3 Ultra RTX 3080 10GB GDDR6X Videokártya!
- LENOVO ThinkPad 13 - i7-7500U, 8GB RAM, 256GB SSD, új akku, számla, 6 hó gar
- Honor X7 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest



