Tuesday, 29 December 2015

RavenPlus Version 1.0.507 - Picture Uploads To PicasaWeb Via OAuth2

I know some of you have been waiting for this. So here it is: RavenPlus version 1.0.507, which contains the fix for uploading pictures to PicasaWeb via the Google OAuth2 protocol.

I have been testing this version out for over the last couple of weeks and I believe I have a stable version that is fit for release. Pictures in my last 3 blog postings (totalling 17 in all) were uploaded to PicasaWeb with this version and I did not notice anything out of the ordinary. They all went through smoothly as far as I could tell. Even my edited pictures were detected by RavenPlus and they got updated on PicasaWeb when I subsequently republish my blog post.

Not tested though is video uploads to PicasaWeb - simply because I do not have the bandwidth nor any videos to share.

If you do not upload pictures to PicasaWeb, you can safely ignore this version.

Version 1.0.507 only works for existing users of Raven and RavenPlus. New users will have to wait a little while as I haven't started work on making a clean import of blogs hosted on Google's Blogger/Blogspot yet. That's next on the to-do list.

What I Did

As I have said, I had problems interfacing between RavenPlus and Google GData Photo API previously.

After having spent many hours and getting nowhere, I decided in the end to modify the GData API itself (by creating a local copy within the RavenPlus source tree). I created a few new methods in the class GDataService (in gdata_service.py) and PhotoService (in photos/service.py) that return the PicasaWeb meta-data in the format that RavenPlus expects. To say the least, it works perfectly - luckily.

Change Log

The New Picasa Settings Dialog Box

  • Picture uploads to PicasaWeb is now authenticated via Google's OAuth2.

  • I have removed the "password" field (now redundant with OAuth2) in the "Edit Picasa Settings" dialog box (in the Main Window under Tools -> Media Storage Settings -> New Storage). This dialog box now looks like in the picture above. The "Google Account Email" field is still required though - GData API actually uses it.

  • Error handling during the picture uploads is a little crappy. No error is reported (via a dialog box, for example) even though picture uploads failed. Because of this, I have made some changes so that errors during picture uploads, if any, is logged in the RavenPlus's background tasks log. You can be viewed this log file via RavenPlus's Tools -> Background Tasks ... in the main window. I can only think of two reasons that will cause an upload failure:

    • there is no Internet connection;
    • the "Google Account Email" address is incorrect (you will see a [404, 'Not Found', 'Unable to find user with email ... @gmail.com ] error in the log file);

    Also worth mentioning is some problems that I had, though not serious, when creating a new album while testing. The following error was registered in the background tasks log:

    sslerror instance has no attribute 'getMessage'

    I am not sure why? I can only speculate that perhaps I had been doing a repeated create-delete PicasaWeb album of the same name. By renaming the album to something else, the problem went away.

Backups

Changes will be made to your Picasa Media Storage registry when uploading pictures to PicasaWeb. So do remember to backup your Raven/RavenPlus data before you begin. The instructions for backing up your Raven/RavenPlus data is available at How To Backup Your Data at the Zoundry Raven development blog.

Download Link

I have uploaded RavenPlus Version 1.0.507 to my Google Drive and you can download the ZIP file here. Do read the Disclaimer below before downloading.

To install, just unzip the downloaded Zip file into a directory, and copy your existing RavenPlus's "profiles.xml" file into this new versions profiles directory.

Granting Access

Granting PicasaWeb Access To RavenPlus

Login credentials to PicasaWeb uses the user's Google Email Address and password previously. But with OAuth2 authentication, this no longer applies. Instead, Google login credentials now is contained in the file "client_secrets.json".

If you are now using an OAuth2 aware version of RavenPlus, you should already have this file in the Raven/RavenPlus data directory/folder - there is nothing for you to do.

Otherwise, you will have to download "client_secrets.json" from the Google Developer Console and save it in the Raven/RavenPlus data directory/folder.

On your first picture upload to PicasaWeb, your default web browser will get launched and you will be prompted to login to your Google account if you have not login previously. The screen above will then be displayed in your web browser. Just click on the "Allow" button, and the login credentials for PicasaWeb will then be downloaded and stored in the file "picasa.dat" in the Raven/RavenPlus data directory/folder - the place where "client_secrets.json" is located (see picture below). RavenPlus will then begin to upload your picture files to PicasaWeb.

The Location Of The File "picasa.dat"

Note:

  • In the "RavenPlus would like to:" screen above, I think you have to click on the "Allow" button within a certain time limit. If your picture upload failed or the "picasa.dat" file was not created, just repeat the process again i.e. just republish your blog post.

  • To upload pictures to PicasaWeb, you will need to have a Picasa Media Storage defined and assigned to your blog in RavenPlus. If you have been happily blogging and uploading pictures to PicasaWeb from Raven or RavenPlus prior to the introduction of OAuth2 authentication back in 28th May 2015, you should already have one defined. If what I am saying doesn't make sense, just leave a comment below and I will explain.

Happy Blogging.

Disclaimer:
This software is provided "as is" WITHOUT WARRANTY OF ANY KIND, either express or implied. You, the user, accept the full responsibility for the usage of this application RavenPlus, excluding the developer, ie. me the owner of this blog, from any liability and any consequence that may derive. Remember to do an Anti-virus scan of the downloaded ZIP file before unzipping it into a folder. You might want to consider doing a full backup of your computer hard drive with Acronis True Image or Norton Ghost before installing and running this application.









36 comments:

  1. THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Is perfect!!!!!!!!!!! I can upload my photos without any problem
    THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    You're a genious!!!!!!!!!!!!!!!

    ReplyDelete
    Replies
    1. I suppose I can stop biting my nails now. I'm a nervous wreck.

      Delete
    2. You did it T.C.! You´re the best. I can work again with my blog at 100%. Thanks

      Delete
    3. Thank you for your feedback Nancy Dorcys.

      Delete
    4. I can´t believe it!!! Picasa is working again!!! Thanks T.C.!!! I love you! You make me very happy.

      Delete
    5. Thanks for the feedback Laura.

      Delete
  2. There is an issue when attempting to edit an existing downloaded post. Raven uses the Metaweblog api 'getRecentPosts' call to get the list of posts which in many cases only provides a summary of the blog content, not the entire post. Apparently Raven uses this summary to edit that post instead of using a Metaweblog api 'getPost' call.

    ReplyDelete
    Replies
    1. Which blog server platform are you referring to?

      To be honest, on the blog publishing side, I have only looked at Google's Blogger API V3. I only fix what-I-need/what-I-have-to to get me going again, and share what I have patched on my blog here.

      Delete
    2. It is a custom Metaweblog integration for Exponent CMS. For the getRecentPosts call we only return a summary of the posts since some editors (MS Word) choke if the returned data set is too large. Both the MS Word blog post editor and Windows LiveWriter/OpenWriter make a specific call to 'getPost' when the blog post is edited.

      Delete
    3. Actually, never mind, I've updated our code and the other editors now seem to deal with large amounts of data where they errored out in the past.

      Delete
  3. Yupi! Is perfect! I love you! :)

    Please when you have time remember to do what we talk here in August: http://chuahtc.blogspot.com.ar/2015/08/ravenplus-version-10506-post-scheduling.html, you answer us "To all: Point noted"

    Align image icon: center like default
    Size icon: possibility to change the dafault size
    Download more than 5000 posts

    Thanks for your time and work

    ReplyDelete
    Replies
    1. Yikes. You are making me nervous. You are making me breaking out in cold sweat.

      Delete
  4. Thanks, thanks, thanks and thanks.....
    ......
    .....
    .....
    and more thanks!!!!!!!!! :)

    ReplyDelete
  5. Hi, Fantastic work on Ravenplus! I have a question about uploading images on Wordpress.com blogs. If an image in the post is clicked, nothing happens. A link to the full image needs to be included by changing a setting in the WP editor. I'm wondering if code in the Ravenplus editor could take care of this during the upload itself. Thanks!

    ReplyDelete
    Replies
    1. Thanks for the kind words.

      Fixes and customization of Raven+ are based on my needs. I am releasing the compiled version of the software as it is.

      Delete
  6. nice job @T.C. Chuah, may you add some feature or option to publish multiple post simultaneously

    many thanks and great job

    ReplyDelete
    Replies
    1. I don't have a need for such feature; so it's a no for the moment.

      Delete
  7. T.C.: Hi!!!

    I need your help, please. From January 26 I can not upload images with Picasa with Raven. In Picasa forum there are a lot of people with the same problem and they say that Picasa has not more support. Google still don´t give any answer.

    Please can you make something to upload images with Google photos???. I love your Raven+, it's the best and I need it for my work.

    Flickr has many problem and not make thumbnails for home or JSON scripts

    Please help us!!

    ReplyDelete
    Replies
    1. I had the same problem myself when I published my latest blog post on the 28th Jan 2017. It took me 3 tries before my 2 pictures were finally uploaded, which is what I suggest you do - just keep trying.

      Sorry but I can't do anything on my end. There is no Google Photo API when I last looked a few days ago.

      Problem seems to coincide with Google+ desktop going offline. I wonder if there is a connection?

      Delete
    2. Thanks T.C.! Yes! Was a problem connection and Google fix it!!!

      If you want can you read it in the forum https://productforums.google.com/d/msg/picasa/-6qGYNiNXKA/QzDyngOsBwAJ

      And is good to know that is not a Google Photo API

      Thanks for ypur time

      Delete
    3. Thank you for the updates Estevaniz.

      There is no announcements of any kind from Google but I sense that something is brewing on their end, possibly between the Google+ and Google Photo integration. If your livelihood depends on your blogs, it is not a bad idea of you to start planning now on moving off Google's Blogger and onto your own blog server where you have more control over your picture and blog post uploads.

      Time is a little tight on my end these days. If Google were to pull the plug again on Picasa Web uploads, and replace it with some new API, it would be months again before I could roll out a fix for Raven+.

      Delete
    4. I really prefer Blogger. I was in WP and I don´t like it. And I can not buy a server.

      I really prefer wait for you perfect work several months like the first time (fix Raven and fix Picasa) that moving off Google's Blogger.

      I hope for you and for me that Google don't make any API change

      Thanks a lot!!!

      Delete
    5. The Picasa API from Google is actually quite old - almost 10 years, if I am not mistaken. With Google having announced, not too long ago, about retiring Picasa, it quite obvious that a change in API is imminent in the future. The question is when.

      Delete
  8. Hi T.C.!
    I have a problem, PLEASE HELP ME!

    I need to know if you can upload images with Raven. I can not fron today:

    Problem: The image is not uploading

    My test: I make new client_secrets.json and new picasa.dat (this is make it by itself without any problem) but the problem is the same.

    I can use Raven WITHOUT problems, but I can not upload images.

    Do you have the same problem?

    THanks!

    Nancy

    ReplyDelete
    Replies
    1. I just did a test: I cannot upload images either. It was working fine a few days ago. This is the error that I got from Raven's log:

      [ZUploadContentPrePublishHandler] Failed to upload file 1 of 1 (F:\Temp\TEST_RAVEN.JPG)
      [EXCEPTION][ZUploadContentPrePublishHandler] ZBlogAppException [Failed to upload file 'TEST_RAVEN.JPG'.([500, 'Internal Server Error', 'Internal error, try again later'])]

      Not sure what the error means. I think we had had this similar problem last year; it just went away a few days later.

      Delete
    2. Just did a quick search: there is still no Google Photos API. All that is out there is still the old PicasaWeb API - updated to version 3 last February 2017 with some features removed (creating an album is one of them, one that I use annually).

      To conclude, there is nothing I could do with this current problem.

      Delete
    3. Thanks T.C. for answer me so soon!!!! Now I know that is not only me.

      I hope is fixed soon

      About yours photos: "Flock Of Birds" is really a beautiful Wallpaper. And your text "But mind your steps mister. We want you back alive" in Selfie really made me laugh a lot

      Thanks T. C.
      I will write you again with good o bad news. The problem star today Monday

      Delete
    4. About your search, do you wanna say that is not any Google change? I ok what I understand? Is all the same?
      Thanks for use your time making this search for me!!!

      Delete
    5. To be honest, I don't know as there is no official statement from Google.

      If you depend on your blog for your livelihood, it is not a bad idea to move off Google's Blogger and off to your own server. Over the last couple of years, I find Google to be undependable - they just do as they please.

      Delete
  9. I look my log, but the message is different:

    [ZUploadContentPrePublishHandler] process: Has Mediastore: True
    [ZUploadContentPrePublishHandler] uploadContent: store: LD Album 5[000001544767b7f900c900d5000000997ff0c1d6]
    [ZUploadContentPrePublishHandler] About to upload file 1 of 1
    [ZUploadContentPrePublishHandler] Bypass registry - False
    [ZUploadContentPrePublishHandler] Uploading to media store LD Album 5[000001544767b7f900c900d5000000997ff0c1d6] file 1 of 1 (zrtn_002n71513799_tn.jpg), 4825 bytes
    [ZUploadContentPrePublishHandler] Failed to upload file 1 of 1 (D:\Mis Documentos\Mis bases de datos\Zoundry Raven Bazar\thumbnails\zrtn_002n71513799_tn.jpg)
    [EXCEPTION][ZUploadContentPrePublishHandler] UnicodeDecodeError instance has no attribute 'getMessage'
    [ZUploadContentPrePublishHandler] Done uploading file 1 of 1 (D:\Mis Documentos\Mis bases de datos\Zoundry Raven Bazar\thumbnails\zrtn_002n71513799_tn.jpg), 4825 bytes
    [EXCEPTION][ZUploadContentPrePublishHandler] UnicodeDecodeError instance has no attribute 'getMessage'
    Publishing document.
    Publishing entry...

    ReplyDelete
    Replies
    1. Is there a thread in the forum with the problem.
      https://productforums.google.com/forum/#!topic/photos/eDspX3gvFuo
      The specialists not understand what's happen and ask"... when using an API to upload photos, then please take a look at our Official Picasa Web Albums Data API website for more information" https://developers.google.com/picasa-web/

      Can you tell me if you see any change in the API? 'Cause is not I want write in the forum that if is not any change the problem is from Google.

      Thanks

      Delete
  10. FORGET MY LAST MESSAGE T.C.! Don't loose your time!!!
    One person in the thread wrote that I want to write and to know:
    He wrote
    "I wan to add that I have been using previous google Picasa API and now Google Photos API for more than 4-5 years. I have never had such problems with uploading photos to Google Photos before. I was uploading successfuly photos on Saturday 20th Feb and Sunday 21st Feb 2018. Now I am not able to upload anything. It is not the problem with my code, because it didn`t change for more than one year. Google Photos API didn`t change either so far. Dear Google, please Google don`t think that this is customers problem, because the problem is YOURS - IT IS A GOOGLE PROBLEM.
    What do you think about it that so many people write here about the issue in their various softwares which was working properly so far, and now it doesn`t work fine and gives the same error code and error description!!!!
    We don`t have any other error, we all have the same error. Please be so kind and fix it, it is already 2-3 days after the error occurred."

    He was perfect! Now I hope that Google fix it!! :)

    ReplyDelete
    Replies
    1. Do try again. I just managed to upload a photo via Raven+ a moment ago - TIME: 9:16 GMT.

      Delete
  11. Is working again!!!!!!!
    Thanks for your time!!!!
    A saw you in the forum. Thanks for help and patience!!!!!!

    ReplyDelete

Note: Comments without a valid Blogger/Google+/WordPress/LiveJournal/TypePad/AIM/OpenID profile may be ignored.

Related Posts Plugin for WordPress, Blogger...