niqdev/packtpub-crawler

How to open browser for googledrive verification?

markusrudolf opened this issue · 6 comments

Hi, the crawler runs on my headless raspi via SSH, so no X Session or anything. How am I supposed to "open a browser" and "enter verfication code" in the process? Any hints?

Hi,
actually I don't remember now, it should prompt or print on console a url, if yes just copy and paste the url and do it manually, this step is mandatory only for the first time to generate auth_token.json.
Alternatively you can do it from your laptop and copy the file directly.
Let me know if it works,
Thanks

Actually it doesn't print an URL (that would be easy) but just prints "open browser" and then wants the verification code.
screenshot 2017-04-30 20 39 13

Sorry I didn't remember, so yes you have to run the script the first time on your local machine, then it will open the browser automatically and then you will have to scp the file.
This is due to the python Drive library.

OK. I give it a shot, but I'm afraid my Ubuntu is already on Python 3.XX. Is it maybe possible to just put a debug line in the code that prints the URL on the console? I'm not so fluent in python unfortunately.

Thanks for pointing it out anyways

You can have both versions installed at the same time, usually on ubuntu are both already installed.
Let me know if you succeed or you need more help

Got it running so far.