[auto-b] switching ocr to advanced - ref 1cc33109

This commit is contained in:
G
2021-02-10 11:31:19 -08:00
committed by GitHub
parent 8f935ec9a2
commit 7ebda36e16
4 changed files with 203 additions and 202 deletions
+195 -195
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -16,7 +16,7 @@ function merge_dicts(temp_dict){
return result;
}
async function detect(type, uuid, username, options, site, source = "", screen_shot = "") {
async function detect(type, uuid, username, options, site, source = "", text_only = "", screen_shot = "") {
var all_results = [];
var temp_profile = [];
var temp_detected = [];
@@ -24,7 +24,7 @@ async function detect(type, uuid, username, options, site, source = "", screen_s
await Promise.all(site.detections.map(async detection => {
if (detection.type == "shared") {
var shared_detection = await helper.shared_detections.find(o => o.name === detection.name);
var [val1, val2, val3] = await detect_logic(type, uuid, username, options, shared_detection, source, screen_shot)
var [val1, val2, val3] = await detect_logic(type, uuid, username, options, shared_detection, source, text_only, screen_shot)
temp_profile.push(val1)
temp_detected.push(val2)
detections_count += val3
@@ -36,7 +36,7 @@ async function detect(type, uuid, username, options, site, source = "", screen_s
}));
var [val1, val2, val3] = await detect_logic(type, uuid, username, options, site, source, screen_shot)
var [val1, val2, val3] = await detect_logic(type, uuid, username, options, site, source, text_only, screen_shot)
temp_profile.push(val1)
temp_detected.push(val2)
detections_count += val3
@@ -44,7 +44,7 @@ async function detect(type, uuid, username, options, site, source = "", screen_s
return [merge_dicts(temp_profile),merge_dicts(temp_detected),detections_count]
}
async function detect_logic(type, uuid, username, options, site, source = "", screen_shot = "") {
async function detect_logic(type, uuid, username, options, site, source = "", text_only = "", screen_shot = "") {
var temp_profile = Object.assign({}, helper.profile_template);
var temp_detected = Object.assign({}, helper.detected_websites);
var detections_count = 0;
@@ -100,7 +100,7 @@ async function detect_logic(type, uuid, username, options, site, source = "", sc
temp_detected.false += 1
}
}
} else if (detection.type == "advanced" && text_only != "") {
} else if (detection.type == "advanced" && text_only != "" && text_only != "unavailable") {
if (text_only.toLowerCase().includes(detection.string.replace("{username}", username).toLowerCase())) {
temp_found = "true";
}
+1 -1
View File
@@ -91,7 +91,7 @@ async function find_username_site(uuid, username, options, site) {
title = await driver.getTitle();
text_only = await driver.findElement(By.tagName("body")).getText();
await driver.quit()
var [temp_profile, temp_detected, detections_count] = await engine.detect("slow", uuid, username, options, site ,source, screen_shot)
var [temp_profile, temp_detected, detections_count] = await engine.detect("slow", uuid, username, options, site ,source, text_only, screen_shot)
if (options.includes("ShowUserProfilesSlow")) {
temp_profile["image"] = "data:image/png;base64,{image}".replace("{image}", screen_shot);
}
+2 -1
View File
@@ -842,7 +842,8 @@
random_names = ["sophia","liam","riley","jackson","emma","aiden","ava","elijah","isabella","grayson","aria","lucas","aaliyah","oliver","amelia","caden","mia","mateo","layla","muhammad","zoe","mason","camilla","carter","charlotte","jayden","eliana","ethan","mila","sebastian","everly","james","luna","michael","avery","benjamin","evelyn","logan","harper","leo","lily","luca","ella","alexander","gianna","levi","chloe","daniel","adalyn","josiah","charlie","henry","isla","jayce","ellie","julian","leah","jack","nora","ryan","scarlett","jacob","maya","asher","abigail","wyatt","madison","william","aubrey","owen","emily","gabriel","kinsley","miles","elena","lincoln","paisley","ezra","madelyn","isaiah","aurora","luke","peyton","cameron","nova","caleb","emilia","isaac","hannah","carson","sarah","samuel","ariana","colton","penelope","maverick","lila","matthew"]
$("#string-to-analyze").attr("placeholder", random_names[(Math.random() * random_names.length) | 0]);
//$("#string-to-analyze").attr("placeholder", random_names[(Math.random() * random_names.length) | 0]);
$("#string-to-analyze").attr("placeholder", "johndoe");
var interval_logs;