ShareX / ShareX

ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
https://getsharex.com
GNU General Public License v3.0
28.27k stars 3.11k forks source link

Picasa API is deprecated #3884

Closed Zaczero closed 5 years ago

Zaczero commented 5 years ago

The error occurs while trying to upload a photo to Google Photos.

Message:

The remote server returned an error: (400) Bad Request.

Request URL:

https://picasaweb.google.com/data/feed/api/user/default/albumid/xxx

Response:

The Picasa API is deprecated. See https://developers.google.com/picasa-web/ for more details and the migration guide.

Stack trace:

at System.Net.HttpWebRequest.GetResponse() at ShareX.UploadersLib.Uploader.GetResponse(HttpMethod method, String url, Stream data, String contentType, Dictionary`2 args, NameValueCollection headers, CookieCollection cookies, Boolean allowNon2xxResponses)

lucario commented 5 years ago

I am currently rewriting our uploader to fix this.

Rewrite done, please install a dev build.

thelastfantasy commented 5 years ago

Also hope for video support of new Google Photos API

LordPicard commented 5 years ago

Following this - I have this issue ;)

From https://github.com/ShareX/ShareX/issues/3887

lucario commented 5 years ago

PR open here #3890

lucario commented 5 years ago

Also hope for video support of new Google Photos API

Video is supported, tested mp4.

jdcollier1968 commented 5 years ago

@matthewburnett Any idea what the turnaround time would be to complete a rewrite of the uploader to make uploading to Google Photos operational again?

lucario commented 5 years ago

@jdcollier1968 It should be done in the next few days, then you can grab a dev build with the operational patch, as a release with this rewrite will probably be a long time from now.

Abu3safeer commented 5 years ago

too bad, links generated using this api are short, I like them. currently I am uploading images manually to Google Photos, links are too long. can't wait to see how new api will perform.

lucario commented 5 years ago

This is how links will look https://photos.app.goo.gl/JbEtgfronvdKsdPW9

Abu3safeer commented 5 years ago

This is how links will look https://photos.app.goo.gl/JbEtgfronvdKsdPW9

Oh no, no more hotlinking! too bad, I liked this service, looks like it is time for another service.

lucario commented 5 years ago

Try Google Cloud Storage https://getsharex.com/docs/google-cloud-storage

Abu3safeer commented 5 years ago

It is very good alternative with cheap prices, but to be honest, I wanted something free, because I store images for use on forums or services that does not proved image uploading feature, I was using imgur but it is blocked in some websites, and as you know forums only allow hotlinked images, I cannot embed images there.

beside imgur reduces image quality, while Google photos never touches the image.

Sirosky commented 5 years ago
Message:
The remote server returned an error: (400) Bad Request.

Request URL:
https://www.googleapis.com/oauth2/v4/token

Response:
{
  "error": "invalid_grant",
  "error_description": "Bad Request"
}

Stack trace:
   at System.Net.HttpWebRequest.GetResponse()
   at ShareX.UploadersLib.Uploader.GetResponse(HttpMethod method, String url, Stream data, String contentType, Dictionary`2 args, NameValueCollection headers, CookieCollection cookies, Boolean allowNon2xxResponses)

Refresh access token failed.

Not sure if this is a separate issue. But ShareX is still failing to upload to Google Photos. I've re-authenticated but problem persists. Seems a bit different from the error code in the OP.

sniff122 commented 5 years ago

Do we know when this will be working again, quite annoying that i cant upload to gphotos. i see there are active edits being made just waiting for the release to be pushed out.

Pharaoh2k commented 5 years ago

+1

Jaex commented 5 years ago

You guys not gonna like that new API. It not gives direct link to image. Requires creating album for each upload to make it shareable. Which also requires 4 different requests according to @matthewburnett. So it is nothing like Picasa API.

Sirosky commented 5 years ago

Wait so you can't just have it upload to a specific public album? You're kidding... err does anyone know of any good free alternatives that support direct links?

lucario commented 5 years ago

The differences are:

As long as you understand the above, the uploader will be fine. It’s not a bad uploader, just more unavoidable limitations because Google wants stricter security. Alternatives would be Google Drive or Google Cloud Storage if you like to stay in the ecosystem.

Abu3safeer commented 5 years ago

Since Google Cloud Storage is paid service, I can understand why it allow hotlinking, but Google Drive does not allow hotlinking, I know that hotlinking from Google Drive was possible, but now cannot find any way to use it, do you think it is possible?

Zaczero commented 5 years ago

@Abu3safeer @matthewburnett maybe after getting album id send a get request to it and fetch the hotlink from HTML. This is a really dirty solution though.

sniff122 commented 5 years ago

It could be a possible solution but as you said, it will be dirty.

Jaex commented 5 years ago

Wait so you can't just have it upload to a specific public album? You're kidding... err does anyone know of any good free alternatives that support direct links?

It gives this error with Google Photos API:

"message": "No permission to add media items to this album."

So unlike Picasa API, not even possible to upload to any albums not created by app. Which is weird.

sniff122 commented 5 years ago

That will probably be due to the Picasa API being deprecated.

Abu3safeer commented 5 years ago

If the app created an album, can it upload to same album which created through the api? I mean if that possible, then in settings menu in ShareX while authenticating google photos account, the app could prompt user to create an album to upload images inside it.

sniff122 commented 5 years ago

I haven't looked at the new API but by the limitations of the API, possibly not

lucario commented 5 years ago

@Abu3safeer When you upload publicly, sharex will created a shared album specifically for that image, so when you share the link, you are only sharing the image, and not other images you would rather be private. It's just the way Google decided it to work, public images are technically images in a single shared album.

Abu3safeer commented 5 years ago

Then I will have many albums, each album contains one image. Uploading image manually and copy the link will be much effective! looks like Google hates Third party apps too much.

lucario commented 5 years ago

@Abu3safeer Uploading manually, then clicking "Get public link" will place that image into its own shared album, try it for yourself. The API works exactly how the UI does, you can't work around this by doing it in the UI.

sniff122 commented 5 years ago

As usual, companies can't leave working stuff alone.

Abu3safeer commented 5 years ago

I looked over Blogger API, I cannot find any image API there, because I found very old images using Blogger image browser, and they didn't count toward my Drive quota.

Abu3safeer commented 5 years ago

@matthewburnett You are right, a new Album each image, what a mess!

ghost commented 5 years ago

I am currently rewriting our uploader to fix this

This was 5 days ago. Has it been fixed yet?

Abu3safeer commented 5 years ago

@panthersdude2001 Rewriting means making everything from the beginning, that means it would take weeks to be working properly.

ghost commented 5 years ago

@panthersdude2001 Rewriting means making everything from the beginning, that means it would take weeks to be working properly.

Ok, So I will have to go back to the old method of using OneDrive. Just uninstalled it. 😑😑😑😑😑😑😑😑🀬🀬😠😠😠😠😠😠😠😾

Abu3safeer commented 5 years ago

That is bad attitude @panthersdude2001 , it is FREE tool, the developers spend their time for you, and you don't pay them anything, shame on you, if you want to blame someone, go blame Google, they have disabled the API, not ShareX developers.

Beside you have several image hosts available to use, beside you can customize your own image host there.

ghost commented 5 years ago

That is bad attitude @panthersdude2001 , it is FREE tool, the developers spend their time for you, and you don't pay them anything, shame on you, if you want to blame someone, go blame Google, they have disabled the API, not ShareX developers.

Beside you have several image hosts available to use, beside you can customize your own image host there.

Sorry. Didn't mean to have an attitude. 😣

Abu3safeer commented 5 years ago

You can use one of the built in image destinations: image Or you can use on of the "FREE" image hosts available in Chavareto list image Or you can go beyond them and customize yourself a host using Custom uploaders image

All these options are just for images!

Jaex commented 5 years ago

Merged @matthewburnett PR.

lucario commented 5 years ago

For everyone who has the google photos issue, try a dev build https://getsharex.com/docs/dev-builds

darkufo commented 5 years ago

Thanks Matt, Dev build is working great with Google Photos now. Thank you.

aaronbrooks-gh commented 5 years ago

Thanks Matthew. It works perfectly functionally, but it's not quite the same as it used to be. I imagine this is due to google's changes and nothing can be done, but I will elaborate.

Prior I could upload an image to a private album and sharex would give me the direct link to that image which would be publicly accessible. Now, I need to create a public album (with reduced permissions, however I think this means someone can still view the "index" of all the images in that album which is absolutely not what I want) and the uploaded image is presented within google's frame. That's not really what I want from the image host, so despite your great effort here I think I'll need to find a different host.

Zaczero commented 5 years ago

Thanks Matthew. It works perfectly functionally, but it's not quite the same as it used to be. I imagine this is due to google's changes and nothing can be done, but I will elaborate.

Prior I could upload an image to a private album and sharex would give me the direct link to that image which would be publicly accessible. Now, I need to create a public album (with reduced permissions, however I think this means someone can still view the "index" of all the images in that album which is absolutely not what I want) and the uploaded image is presented within google's frame. That's not really what I want from the image host, so despite your great effort here I think I'll need to find a different host.

yeah.. but I can understand the Google's move. They are not providing a free image hosting so steps had to be made

Sirosky commented 5 years ago

Image

Can you guys see the image? I uploaded it using ShareX to Google Photos. Had to manually get the direct link though.

Also, is there any way to upload to a public album? Not seeing that option even though I have the dev build. Right now it creates a new album every time it uploads, which is pretty messy.

ghost commented 5 years ago

Image

Can you guys see the image? I uploaded it using ShareX to Google Photos. Had to manually get the direct link though.

Also, is there any way to upload to a public album? Not seeing that option even though I have the dev build. Right now it creates a new album every time it uploads, which is pretty messy.

Yes sir i can. Is there a download link for the beta of the new ShareX? Greenshot is Okay...

Sirosky commented 5 years ago

https://getsharex.com/docs/dev-builds

Here you go. If there is no way to upload directly to a public album might have to find another image provider. Gets to messy with a new album everytime I take a screenshot.

ghost commented 5 years ago

https://photos.google.com/lr/photo/ACCQMIEfSasSZCEhevtFP7gMbHEH1usWWDN-Qf4lRqj1UiiBC_bGFzjdduWBmBNoCryc0G6XoWDM546ucdUNfrOnejvE54oeYQ It finally works!!! Thanks ShareX team!

moakdesigns commented 5 years ago

I can't try the dev-builds because I don't have that button at all.

However I do see my photos are being uploaded into the Google photos, it just throws the error because it's using the deprecated API.

image

ghost commented 5 years ago

Did you try uninstalling and reinstalling? I have it.

Abu3safeer commented 5 years ago

@moakdesigns You don't see the button? what version of ShareX are you using? image

Sirosky commented 5 years ago

Are you using the Steam version? @moakdesigns I had to uninstall the Steam version and switch over to the Desktop version.