Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImgUr uploader broken since April 23st #1045

Open
ofnuts opened this issue May 2, 2024 · 11 comments
Open

ImgUr uploader broken since April 23st #1045

ofnuts opened this issue May 2, 2024 · 11 comments
Labels

Comments

@ofnuts
Copy link

ofnuts commented May 2, 2024

To Reproduce

Steps to reproduce the behavior:

  1. Start ksnip in a terminal to see stdout errors
  2. Shift-U to start upload to ImgUr
  3. After a small delay, upload doesn't occur and in the terminal I see:
Info: Upload result: Network Error(302): Error transferring https://api.imgur.com/3/upload.xml?title=Ofnuts screenshot&description=Ofnuts screenshot - server replied: Bad Request. 

Expected behavior
No error, image is uploaded and link copied to clip board.

Desktop (please complete the following information):

  • OS: Linux
  • Distribution in case of Linux:Kubuntu 22.04
  • Window System in case of Linux: X11
  • ksnip version: 1.10.0 Build: 1-07d6e16
  • How did you install ksnip: .deb

Additional context

Can't see any reason why this would happen. I am a very frequent user (791 uploads since August 2022). Can't think of anything changed on my side that could explain the behavior.

I use anonymous upload. The ClientID is the same as used in a Python script of mine that uses pyimgur and still works.

FWIW, when I use the ImgUr uploader window, the ClientID widget is empty:

image

While it appears in the config file (redacted here):

[Imgur]
AlwaysCopyToClipboard=true
ClientID=eb*******f7
ForceAnonymous=true
OpenLinkDirectlyToImage=true
UploadDescription=Ofnuts screenshot
UploadTitle=Ofnuts screenshot
@DamirPorobic
Copy link
Member

Might be the issue that we are htting rate limit. If you use anonymous you don't use the client ID IIRC. As the internal imgur id that ksnip uses is used by too many users, it might be that we are hitting a rate limit and have been blocked now for a month, see under https://apidocs.imgur.com/ section "Rate Limits". Can you try to setup a real imgur user as explaied here https://github.com/ksnip/ksnip/wiki/Imgur-Uploader and try then?

@Golddouble
Copy link

Golddouble commented May 6, 2024

It is said on https://github.com/ksnip/ksnip/wiki/Imgur-Uploader, that we only need to provide three parameters to register and the name and email address is up to us.

Maybe this was the case once. But now it needs a lot:
grafik

Or do I miss anything?

@DamirPorobic
Copy link
Member

Yeah, the instruction is couple of years old, might be the case that it requires more data now.

@Golddouble
Copy link

Workaround:
I have now typed this command in my terminal:
firefox -P "ProfileName" "https://imgur.com/upload"

It works. It opens a new tab in the opened Firefox.

But when I create the file /home/user/.bin/Ksnip_soll_Imgur_aufrufen.sh and write the path to that script into Ksnip, it does not work:
grafik

I get this message:

Unable to start the process. Check the path and the authorisations.

Any idea, why this does not work?

Would appreciate some answer. Thank you.

@DamirPorobic
Copy link
Member

Is the script executable? Has the users that starts ksnip X rights on the script?

@Golddouble
Copy link

Golddouble commented May 6, 2024

Yes, When I type the path into the terminal it works:

$ /home/user/.bin/Ksnip_soll_Imgur_aufrufen.sh

@DamirPorobic
Copy link
Member

But is the terminal user and the user that start ksnip the same? Can you share the content of the script here?

@Golddouble
Copy link

Golddouble commented May 6, 2024

Yes, I am logged in with "user".

The content of the script is just one line:
firefox -P "ProfileName" "https://imgur.com/upload"

@DamirPorobic
Copy link
Member

Can you try to append "#!/bin/bash" as the top of you script?

@Golddouble
Copy link

Thank you. Now it works. :-)

It's just a little workaround, that starts the Imgur homepage. We than have to look ourselves for the path on our HDD where the picture is saved.

@ofnuts
Copy link
Author

ofnuts commented May 6, 2024

Different for me:

Can't enter a username , the entry field seems disabled.

I appear to have a client ID f this, so I can enter a client ID, a client secret, and a PIN but still no joy.

My python script where I provide a ClientID, still works with just that Client ID and doesn't see to require anything else. In fact I have now configured Ksnip to use this very short python script:

#! /bin/env python3

import os,sys,pyimgur

clientID = "eba********bf7"

file=sys.argv[1]
print(f"Uploading {file}",file=sys.stderr)
im = pyimgur.Imgur(clientID)
upload = im.upload_image(file)
print(f"Uploaded {file} to {upload.link}",file=sys.stderr)
print(upload.link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants