![]() This will authenticate you and create a credentials file which will be used for future logins ( uploader_credentials.txt).įor me, it failed the first time, because I tried uploading a file that was NOT an AVI. Copy that code, go back to your terminal, and paste the auth code – press Enter. A web page displays two lines of text – the second line is the authentication code. Copy the URL in the error message, and paste it into the browser where you are already logged in to Google as the correct user. It also says: enter the Auth Code or something like that. uploader.py /home/pi/motion-uploader/uploader.cfg /home/pi/test.aviĪ bloody error message displays some text about copying a URL. Note that it will fail if it isn’t an AVI.įrom the command line run the script from the /home/pi/motion-uploader/ directory. I used a renamed JPG I had laying around. Get a test.AVI file from somewhere, or just touch test.avi to create a fake one. The initial authentication script will look like it failed. So open a browser and log in to the target account. You need to be logged in to your Google account for this. # Delete the local video file after the upload # Folder (or collection) in Docs where you want the videos to go Sender = Recipient email address (could be same as from_addr) I created a folder in Google Drive called Motion to match this. Under, set the name of the folder on your Google Drive where you want the videos to be saved and where you want photos to be saved. Make sure the folder is set to where you put the client_secrets.json file and where the script has write credentials. I put mine in /home/pi/motion-uploader/. If you used the git clone command you’ll find the example uploader.cfg file in the motion-uploader directory. ![]() Make uploader.py executable: $ chmod a+x uploader.py Update/install Google Python API: $ sudo pip install -upgrade google-api-python-client The rest of Jeremy’s instructions are pretty close. I hope I captured all the steps, but I might not have. Jeremy’s instructions helped me hobble along, but they were so far off that I blindly felt my way through the process. It displays a download file dialog box – change the file name to client_secrets.json and put it somewhere like /home/pi/motion-uploader. On the right side of the Uploader line, click the Download icon. You will see your API authorization in a list. The OAuth client popup displays your authentication details – you don’t need to copy these, but you can if you want. In the Product name shown to users, enter Uploader.Click Client ID, and then click skip this.Under Google Apps APIs, click Drive API.It will enable the API and automatically send you to the Library tab. Click Dashboard (left menu), if you’re not already on it, and click Enable an API at the top of the page. ![]() At the top of the page, click the dropdown and select Create Project.Log in to the Google account that you’re going to use as a repository.What you really want is to get Google to set up and generate an authentication JSON file for you to download. Since it sounds like Google changes their authentication process every so often, these instructions might go out of date. ![]() You can use the first part (Step 1) of this guide by Google, or follow along. I intend to use it with PiKrellCam – hopefully I can get the two working together. Note that this script is designed to be used with the “Motion” security/surveillance module, which I don’t use. The hardest part was getting the Google Authentication, because the instructions on Jeremy’s Blog are WRONG WRONG WRONG. You can look at the script and see what it’s doing. What I like about it is its simplicity – it uses a single Python script – you don’t have to download a ton of files that you don’t know what they do. I used the uploader.py script written by this guy at Jeremy’s Blog.
0 Comments
Leave a Reply. |