ThoughtfulDev / EagleEye

Stalk your Friends. Find their Instagram, FB and Twitter Profiles using Image Recognition and Reverse Image Search.
Do What The F*ck You Want To Public License
4.19k stars 559 forks source link

Does it work in windows 10? #5

Closed fiuderazes closed 6 years ago

fiuderazes commented 6 years ago

I`ve tried the code, but it gives is me this error when starting it: c:\Python3\osint\EagleEye>py -3 eagle-eye.py Traceback (most recent call last): File "eagle-eye.py", line 9, in import utils.config as cfg File "c:\Python3\osint\EagleEye\utils\config.py", line 8, in cfg = json.load(json_data) File "C:\Users..........\AppData\Local\Programs\Python\Python36\lib\json__init.py", line 299, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "C:\Users.........\AppData\Local\Programs\Python\Python36\lib\json\init__.py", line 354, in loads return _default_decoder.decode(s) File "C:\Users.........\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users.........\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 355, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 8 column 20 (char 154)

Any idea if I can solve it? Thanks!

ThoughtfulDev commented 6 years ago

In theory yes. BUT especially the dlib package was designed for Linux and its a pain in the ass for compiling dlib for windows. Here seems to be a tutorial In short to install dlib:

  1. install cmake and and it to path
  2. install boost lib 3 compile dlib and install the python bindings. Sounds simply but thats a pain in the ass.

So the answer is a maybe. I suggest that you spin up a Ubuntu VM which should work. Sry.

fiuderazes commented 6 years ago

Thank you. Ive managed to start the program after resolving other issued problems ( like cairosvg package error) After the faceook search is made, it crushes again:) Ill put here tomorrow the error and I`ll try solve it

ThoughtfulDev commented 6 years ago

You managed to install it on Windows? Thats awesome haha :+1:

Sure i'll be happy to help. The google image search should come after the fb search. i dont see how a error could happen there. But i'll be happy to help if you posted the logs ;)

ThoughtfulDev commented 6 years ago

Instagram changed its Data Structure. So the instaLooter package broke for a bit. I fixed it by using the dev version of the package. This break the Windows compatibility because i'm using a bash script to launch instaLooter. ( i might add a powershell script later)

fiuderazes commented 6 years ago

==> Enter the persons name to find on FB: temisan ==> How many jitters, higher is better [max 100]: 100 ==> Opening Webdriver -> Collecting Image URLs...(Page 1) -> Collecting Images URLs...(Page 2) -> Collecting Images URLs...(Page 3) -> Collecting Images URLs...(Page 4) -> Collecting Images URLs...(Page 5)

:: Starting Face Recognition ==> Loading known faces Traceback (most recent call last): File "eagle-eye.py", line 204, in main(skipFB=args.skipfb, skipIR=args.skipir, skipY=args.skipyandex) File "eagle-eye.py", line 95, in main r.loadKnown(name) File "c:\Python3\osint\EagleEye\face_recog.py", line 26, in loadKnown console.subtask('Loading {0}'.format(p_str.split('/')[1])) IndexError: list index out of range

I`m stuck here right now :)

fiuderazes commented 6 years ago

==> Enter the persons name to find on FB: aurelian temisan ==> How many jitters, higher is better [max 100]: 100 ==> Opening Webdriver -> Collecting Image URLs...(Page 1)

:: Starting Face Recognition ==> Loading known faces Traceback (most recent call last): File "eagle-eye.py", line 204, in main(skipFB=args.skipfb, skipIR=args.skipir, skipY=args.skipyandex) File "eagle-eye.py", line 95, in main r.loadKnown(name) File "c:\Python3\osint\EagleEye\face_recog.py", line 26, in loadKnown console.subtask('Loading {0}'.format(p_str.split('/')[1])) IndexError: list index out of range

ThoughtfulDev commented 6 years ago

Thats because a Unix path uses forward slashes ('/') but windows uses "\" so it cannot get the filename by splitting via '/' change that to console.subtask('Loading {0}'.format(p_str.split('\\')[1]))

its just a print by the way so you could even comment that out.

I hope that you dont pull the latest changes since it completly break windows compatibility because of a unix shell script. i try to add a powershell script.

ThoughtfulDev commented 6 years ago

I just pushed a fix. Since instagram changed something make sure to reinstall the requirements(actually just instaLooter) Download the new version of the repo (or clone it). So:

pip3 uninstall instalooter
pip3 install -r requirements.txt

Thank you for testing on Windows ;)

fiuderazes commented 6 years ago

I`m stuck here now :) :: Google Reverse Image Search ==> Opening Webdriver ==> New Image: https://scontent-otp1-1.xx.fbcdn.net/v/t1.0-1/p100x100/29178550_10213724586740659_33221308 -> Inserting Image URL Traceback (most recent call last): File "eagle-eye.py", line 204, in main(skipFB=args.skipfb, skipIR=args.skipir, skipY=args.skipyandex) File "eagle-eye.py", line 108, in main g.collectLinks(img) File "c:\Python3\osint\EagleEye\grabber\google.py", line 38, in collectLinks input.send_keys(img_url) File "C:\Users......\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys 'value': keys_to_typing(value)}) File "C:\Users............\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute return self._parent.execute(command, params) File "C:\Users......\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute self.error_handler.check_response(response) File "C:\Users..........\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string

Should I change here in google.py file the Unix // with Windows \ at line 33-36 ? "the elems = driver.find_elements_by_xpath('//[@id="qbi"]')[0] elems.click() time.sleep(1) input = driver.find_elements_by_xpath('//[@id="qbui"]')[0]"

Thank you for your support, too!

ThoughtfulDev commented 6 years ago

So does the browser open on the reverse image search? does he insert the image url? could you please describe what happens in the browser?

fiuderazes commented 6 years ago

Yes, browser opens the reverse image search but it doesn't load/ insert the image url itself It remains blocked waiting for an image to be loaded

ThoughtfulDev commented 6 years ago

So it does successfully click on the Camera Icon on the page right? So it fails focusing the Input Box for the URL and then i cant insert text ofcourse.

fiuderazes commented 6 years ago

It seems very fine to me to load the image image

ThoughtfulDev commented 6 years ago

So ok. send_keys fails and it says the image is undefined but the debug message "==> New Image" clearly states that the url is a string...

try the following: in grabber/google.py between line 37 and 38 change it so that it looks like the following

input = driver.find_elements_by_xpath('//*[@id="qbui"]')[0]
print(img_url)
input.clear()
input.send_keys("")
input.send_keys(img_url)
input.send_keys(Keys.RETURN)

this will try to print every image url it tries to insert. I believe that some of the image urls in the list are "undefined" thats why it cant type a undefined variable. Try that and it should print "None" or "undefined" at some point. If thats true then i will add a check to ensure that we only enter strings.

fiuderazes commented 6 years ago

I`ve made the changes in google.py line 37 - 38.. now I have:

" def collectLinks(self, img_url): console.task('New Image: {0}'.format(img_url.strip()[:90]))
driver = self.driver driver.get("https://www.google.com/imghp") console.subtask('Inserting Image URL') elems = driver.find_elements_by_xpath('//[@id="qbi"]')[0] elems.click() time.sleep(1) input = driver.find_elements_by_xpath('//[@id="qbui"]')[0] print(img_url) input.clear() input.send_keys("") input.send_keys(img_url) input.send_keys(Keys.RETURN) console.subtask('Searching for Image...') time.sleep(cfg.timeout()) "

The generated error is:

:: Google Reverse Image Search ==> Opening Webdriver ==> New Image: https://scontent-otp1-1.xx.fbcdn.net/v/t1.0-1/p100x100/29178550_10213724586740659_33221308 -> Inserting Image URL https://scontent-otp1-1.xx.fbcdn.net/v/t1.0-1/p100x100/29178550_10213724586740659_3322130830564927756_n.jpg?_nc_cat=0&oh=6f223647feb73d5dd88f57706e3883f4&oe=5B728F02 Traceback (most recent call last): File "eagle-eye.py", line 204, in main(skipFB=args.skipfb, skipIR=args.skipir, skipY=args.skipyandex) File "eagle-eye.py", line 108, in main g.collectLinks(img) File "c:\Python3\osint\EagleEye\grabber\google.py", line 39, in collectLinks input.send_keys("") File "C:\Users.........\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys 'value': keys_to_typing(value)}) File "C:\Users........\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute return self._parent.execute(command, params) File "C:\Users..........\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute self.error_handler.check_response(response) File "C:\Users.........\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string

ThoughtfulDev commented 6 years ago

You can undo the changes. It has to do with firefox. so ok i found something that has todo with firefox. Make sure to use the latest Firefox version and download the Geckodriver seperatly and change the path in config.json

fiuderazes commented 6 years ago

58.0.2 Firefox Release

February 7, 2018

geckodriver-v0.20.0-win64

ThoughtfulDev commented 6 years ago

and you changed the path in config.json?

fiuderazes commented 6 years ago

yes, Ive changed. Otherwise it wouldnt open the browser, the facebook image download and recognition phase work very nice. It crushes when loading the imgs urls. I think the script doesn`t get/paste the img urls from the temporary folder created into the browser window

ThoughtfulDev commented 6 years ago

I know that. Some people had problems regarding the selenium send_keys function with a incompatible math of firefox and the geckodriver version by the way the latest firefox version is 59.0.1 atleast on Linux. Try updating yours.

If that doesnt help then i have no idea...the last resort would be to spin up a Linux VM with Ubuntu which should work since it was tested by me.

fiuderazes commented 6 years ago

I ve made all updates..still not working. I'll try further to find a solution to the send_key problem. May some older versions are working šŸ˜‰ meanwhile..I'm sure that future Chrome version of your script will work as a charm. Whenever it's possible, of course .

fiuderazes commented 6 years ago

Final results is that it`s working on windows 10! Problem was the geckodriver version!

ThoughtfulDev commented 6 years ago

So which geckodriver did you choose? ;) I'm curious of how you installed dlib on windows

fiuderazes commented 6 years ago

I had multiple versions of python installed, each one with own selenium, webdriver and geckodriver using. Finally I found that the first geckodriver launching was an older version for python 2.7... Ive made updates to the latest 0.20 version for all python versions and everything works fine now. Dlib can be installed on windows , even it takes some time and patience. Ill check again in next days which solution really worked because I`ve tried many in a whole day :)

ThoughtfulDev commented 6 years ago

Thats awesome. If you want you cant write a short tutorial or link a tutorial which worked for dlib so i can add it so windows users can enjoy this tool too ;) Or you can make a Pull Request haha