kill3rbko 12 Posted August 24, 2019 Report Share Posted August 24, 2019 Hello, I have tried to use the exbrowser loading several profile with multithreading and do not seem to work.The browsers are launched, but all threads are working inside the first browser only.Is this function abble to be multithread?Regards Quote Link to post Share on other sites
Bot-Factory 602 Posted August 24, 2019 Report Share Posted August 24, 2019 Hello, I have tried to use the exbrowser loading several profile with multithreading and do not seem to work.The browsers are launched, but all threads are working inside the first browser only.Is this function abble to be multithread?Regards Hi.Yes it's possible. 1. Profiles need to be separated. Each thread needs it's own profile directory (Chome)2. You need to be aware of thread IDs, And your commands need to be executed in the right thread context. This can be a bit tricky to understand when you use threads first time with ubot. But there are some free examples and training available in the forum and from some other members. If you post your code (simple version please), we can probably take a look and guide you. But don't post 100 lines of code :-) CheersDan 1 Quote Link to post Share on other sites
kill3rbko 12 Posted August 25, 2019 Author Report Share Posted August 25, 2019 (edited) Thank you for your reply Teacher.I think the multithread is working, but not in the way i would like.I do not want to multithread different profiles.I just need to multithread 5 chrome browser with the same profile but opening different urls.The result i have is opening 5 browser but only 1 browser seems to make the threads.If EB could open tab and in thread and execute the thread code for this tab, may be i can avoid opening multiple browsers?I will try to post a resume code to show it.Thanks a lot Edited August 25, 2019 by kill3rbko 1 Quote Link to post Share on other sites
kill3rbko 12 Posted August 25, 2019 Author Report Share Posted August 25, 2019 Hello Mastas, here is resumed code i am using.I confirm that without loading profile in EB this code is working very well.My objective with the profile was to use inside a vpn addon set to specific country, then login with the specific account and surf ads.Each account would have a chrome profile "country".In the below code i did not make yet the loop for changing profile, i just need to open multiple browser with the same profile in threads. loop($list total(%Jobs)) { set(#threadcounter,0,"Global") Login() set(#Finished,"false","Global") loop while($comparison(#Finished,"= Equals","false")) { plugin command("ExBrowser.dll", "ExBrowser CleanUp", "No") wait(1) set(#log,"Opening browser...","Global") plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "{$plugin function("ExBrowser.dll", "$ExBrowser Specify Binary Location", "{$special folder("Application")}\\Chrome\\chrome.exe")}{$plugin function("ExBrowser.dll", "$ExBrowser Position Window", 800, 0)}{$plugin function("ExBrowser.dll", "$ExBrowser Window Size", 800, 600)}{$plugin function("ExBrowser.dll", "$ExBrowser Load Chrome Profile", "{$special folder("Application")}\\Profile.{#country}")}") set(#log,"Loading Ads page...","Global") wait(5) plugin command("ExBrowser.dll", "ExBrowser Navigate", "http://www.myadsiteurl.fr/ptc.php") plugin command("ExBrowser.dll", "ExBrowser Load Cookies", "{$special folder("Application")}\\cookies.txt") wait(0.5) plugin command("ExBrowser.dll", "ExBrowser Navigate", "http://www.myadsiteurl.fr/ptc.php") set(#Balance,$plugin function("ExBrowser.dll", "$ExBrowser Scrape Element", "//*[@id=\"content\"]/div/div[2]/div[1]/div[2]/h3[1]"),"Global") set(#i,0,"Global") clear list(%Ads) add list to list(%Ads,$plugin function("ExBrowser.dll", "$ExBrowser Scrape List Elements Attribute", "//a[contains(@href,\"visite.php?id_campagne=\")]", "href"),"Delete","Global") set list position(%Ads,0) set(#Total,$list total(%Ads),"Global") set(#log,"Total ads : {#Total}","Global") set(#threadcounter,0,"Global") if($comparison(#Total,"> Greater than",0)) { then { set(#EndAds,"false","Global") set(#Finished,"false","Global") increment(#nloop) if($comparison(#nloop,"> Greater than",4)) { then { set(#Finished,"true","Global") } else { } } } else { set(#EndAds,"true","Global") set(#Finished,"true","Global") } } set(#j,0,"Global") if($comparison(#Finished,"= Equals","false")) { then { plugin command("ExBrowser.dll", "ExBrowser Close") } else { } } loop while($comparison(#EndAds,"= Equals","false")) { loop while($comparison(#threadcounter,">= Greater than or equal to",#Thread)) { wait(2) } increment(#threadcounter) increment(#i) increment(#j) set(#log,"Viewing Ad {#i} / {#Total} ...","Global") set(#log1,"Loading Page {#i}...","Global") set(#MyUrl,$next list item(%Ads),"Global") SurfAds(#MyUrl) wait(1) } } set(#log1,"Job {#Job} finished !","Global") set(#log2,"","Global") } plugin command("ExBrowser.dll", "ExBrowser CleanUp", "No") Now Surfad code : define SurfAds(#MyAd) { thread { plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "{$plugin function("ExBrowser.dll", "$ExBrowser Specify Binary Location", "{$special folder("Application")}\\Chrome\\chrome.exe")}{$plugin function("ExBrowser.dll", "$ExBrowser Position Window", 800, 0)}{$plugin function("ExBrowser.dll", "$ExBrowser Window Size", 800, 600)}{$plugin function("ExBrowser.dll", "$ExBrowser Load Chrome Profile", "{$special folder("Application")}\\Profile.{#country}")}") wait(0.5) plugin command("ExBrowser.dll", "ExBrowser Navigate", #MyAd) set(#credit,"false","Local") if($contains(#MyAd,"id_campagne=6&")) { then { set(#id,"id=6","Global") set(#credit,"true","Global") set(#log2,"id=6 Waiting 15 s...","Global") wait(15) } else { } } if($contains(#MyAd,"id_campagne=7&")) { then { set(#id,"id=7","Global") set(#credit,"true","Global") set(#log2,"id=7 Waiting 15 s...","Global") wait(15) } else { } } // lot of loop like previous one here if($comparison(#credit,"= Equals","false")) { then { set(#id,"id=???","Global") set(#credit,"true","Global") set(#log2,"id=? Waiting 40 s...","Global") wait(40) } else { } } set(#log2,"Closing {#id}","Global") decrement(#threadcounter) plugin command("ExBrowser.dll", "ExBrowser Close") } } Quote Link to post Share on other sites
kill3rbko 12 Posted August 25, 2019 Author Report Share Posted August 25, 2019 Hello again, Here is the result, all browsers are opened, but the threads are executed in 1 browser only. (see screenshot) https://imge.to/i/WiOJW Quote Link to post Share on other sites
Bot-Factory 602 Posted August 26, 2019 Report Share Posted August 26, 2019 Every instance of Chrome needs it's own profile. Otherwise it doesn't work. Chrome can't load the same profile from multiple browsers. Give that a try and see if that works better then. Dan 2 Quote Link to post Share on other sites
kill3rbko 12 Posted August 26, 2019 Author Report Share Posted August 26, 2019 Every instance of Chrome needs it's own profile. Otherwise it doesn't work. Chrome can't load the same profile from multiple browsers. Give that a try and see if that works better then. DanOMG, i got you now lol.Even if i use the same copy of the profile it should work?Let me try it!Thanks 1 Quote Link to post Share on other sites
Misha 5 Posted August 26, 2019 Report Share Posted August 26, 2019 OMG, i got you now lol.Even if i use the same copy of the profile it should work?Let me try it!Thanks Please, if this help you, write here! I had similar problems. Quote Link to post Share on other sites
Bot-Factory 602 Posted August 26, 2019 Report Share Posted August 26, 2019 OMG, i got you now lol.Even if i use the same copy of the profile it should work?Let me try it!ThanksYes you can copy it, It's just that the files are locked from the windows operating system because the chrome process accesses it. Then another process can't access the same files for read/write access.Dan 2 Quote Link to post Share on other sites
kill3rbko 12 Posted August 26, 2019 Author Report Share Posted August 26, 2019 (edited) Great will try it tonight.By the way i have made 10 copy of the profile's folder each one is 160 Mb.I s there any way to keep the just necessary files for the profile? i am just using 2 vpn extensions inside.Thanks in advance Dan Edited August 26, 2019 by kill3rbko Quote Link to post Share on other sites
kill3rbko 12 Posted August 26, 2019 Author Report Share Posted August 26, 2019 Fantastic working like a charm Envoyé de mon ONEPLUS A6003 en utilisant Tapatalk 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.