niqdev / packtpub-crawler

Download your daily free Packt Publishing eBook https://www.packtpub.com/packt/offers/free-learning
MIT License
755 stars 178 forks source link

How to open browser for googledrive verification? #67

Closed markusrudolf closed 7 years ago

markusrudolf commented 7 years ago

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?

niqdev commented 7 years ago

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

markusrudolf commented 7 years ago

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

niqdev commented 7 years ago

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.

markusrudolf commented 7 years ago

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

niqdev commented 7 years ago

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

markusrudolf commented 7 years ago

Got it running so far.