google-drive-upload
google-drive-upload copied to clipboard
Unable to access verification v4.4
- Connects through a terminal by pressing gupload xxxx.json
- Info: Account names can only contain alphabets / numbers / dashes.
- Tap a backup name
- Refresh Token - enter
- Visit the below URL, follow the instructions and then come back to commandline
- Opening a Chrome browser and copying a link Error: This site cannot be accessed Could not connect to localhost. You should try: check the connection ERR_CONNECTION_REFUSED
Have you tried this script ?
https://raw.githubusercontent.com/Akianonymus/google-drive-upload/master/release/bash/gupload
If still not solved, then run with -D flag and send logs
Doesn't work in the script you sent I can't access localhost through the terminal Is it possible? Why does it point to localhost?
I don't see the ERR_CONNECTION_REFUSED
in logs as you said before
It is creating a localhost server to grab the code from the browser.
I will give you a new script with more debug options soon, for now run this python script and see if server is started successfully or not.
from http.server import BaseHTTPRequestHandler, HTTPServer
class handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
if "/?code" in self.path:
message = "Go back to command line"
self.wfile.write(bytes(message, "utf8"))
with HTTPServer(("", 8080), handler) as server:
server.handle_request()
Copy this to a file, let's say a.py
then, python a.py, a http server should
Visit http://localhost:8080/?code=4/0AdQt8qi-y9VMjWL7SQAxdxlbvDZr9S6NN8gqE8_9LupN4R3Cvp-r5Vc0U2VE1hSy0cZoRQ&scope=https://www.googleapis.com/auth/drive and see if a page appears in browser. Also see what is the output of the python script after visiting the url.
log a.py:
File "/home/pi/a.py", line 13, in <module>
with HTTPServer(("", 8080), handler) as server:
File "/usr/lib/python3.9/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/lib/python3.9/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
- I changed port 8080 to port 9797 and the a.py script seems to work
- I replaced localhost with my pi address
- I was able to access from a browser the address you sent in the following format:
http://192.168.1.253:9797/?code=4/0AdQt8qi-y9VMjWL7SQAxdxlbvDZr9S6NN8gqE8_9LupN4R3Cvp-r5Vc0U2VE1hSy0cZoRQ&scope=https://www.googleapis.com/auth/drive
How do we continue from here?
You were not able to open with localhost ?
No...
I have same problem on v4.5. I think python http server is not working.
Same issue here!
~~It works for me and I get the the token after ?code=
until &
however when I paste in the command line, it doesn't work "Invalid refresh token".~~
I figured it out:
- Follow the download steps in the Installation and the Initial Setup
- When prompted to go to the URL:
- Go to URL
- Keep clicking ok and login - if you see unauthorized click on go to site at the bottom left of the page, continue until the localhost page
- If you are doing this from a VM, change
localhost
in the URL to the IP address of the VM (this was the issue for me since I wasn't setting it up on my computer but on a VM so localhost would point to my computer instead of the VM) - You should see the message prompt to back to CLI (you don't need to copy paste anything)
- In the CLI, press enter
- Setup the root folder for when uploading to Google Drive
Complete 🚀
I would have appreciated if it was specifically stated to go to the IP address of the VM instead of localhost:) Hope this helps someone who is also new to bash scripts