[nodebb-plugin-imgur] Imgur Plugin

  • @baris to be fair it seems to work just uploading images but when I was using a plugin from @Schamper which set avatars it always seemed to error out. (Only the imgur plugin though, not his).

    I'll give it a go with the updated dependencies.

  • Plugin & Theme Dev

    @baris @Chris to add to that, it's regarding setting a user avatar using a url.

  • NodeBB

    Took a look into this, it is caused by this change https://github.com/NodeBB/NodeBB/commit/969c3a77cf3eb3327402df731c9152ac8cd626e2.

    The plugins for filter:uploadImage doesn't send the passed in data as is but only returns an object that is {url: 'uploaded url', name: 'file name if any'} This is quite different than other plugins that pass back whatever is sent in. Obviously that doesn't work for upload plugins. For example you pass in a file object that points to a tmp file on disk and get back an url.

    I'll revert that change for now and use the correct data.url property.

  • Plugin & Theme Dev

    @baris I'm not even calling the hook directly, but piggybacking it from the user.uploadProfileImageFromUrl socket endpoint.

  • NodeBB

    Well SocketUser.uploadProfileImageFromUrl was crashing, it shouldn't crash now.

  • Is there any way to change this so this so the end result is simply a URL without all the markdown? When combined with the other image embed plugin there isnt a need for it, so it would be a bit cleaner looking to the end user. Thanks.

  • Updated to latest tonight and getting an error again. @baris was anything changed?

     1/12 22:01 [18479] - error: [plugins] Problem executing hook: filter:uploadImage err: Error
    at Request._callback (/srv/forums/node_modules/nodebb-plugin-imgur/index.js:104:15)
    at Request.self.callback (/srv/forums/node_modules/request/request.js:372:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (/srv/forums/node_modules/request/request.js:1317:14)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/srv/forums/node_modules/request/request.js:1265:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:943:16
    at process._tickDomainCallback (node.js:463:13)

  • Anyone know if something was changed that would cause that error?

  • NodeBB

    Works for me on latest master with the 0.1.2 version of the plugin.

  • I tried installing this plugin today but I am getting this error as soon as I hit the install button:

    Failed to parse json Unexpected token <

    This is on NodeBB v0.5.7 hosted on nodebb.com

    EDIT: after upgrading to 0.6.0 it is working

  • NodeBB

    Updated to 1.0.0, switched to oauth and uploading to accounts/albums.

  • do images ever expire on imgur?

  • NodeBB

    I think they used to delete if the image was not accessed at least once every six months. But they changed it so they never delete an image unless requested.

  • @baris said:

    I think they used to delete if the image was not accessed at least once every six months. But they changed it so they never delete an image unless requested.

    Can confirm. Imgur indeed doesn't delete unless requested. The screenshots I made and uploaded by ShareX from 3 months ago are still able to be seen.

  • Hello all!

    First of all, english isnt my native language,

    I am trying to use this plugin nodebb-plugin-embed-imgur, i have passed 2 days trying and is impossible πŸ˜•

    He is giving this error :

    3/9 18:45 [6470] - error: /admin/plugins/imgur/oauth
    TypeError: Cannot call method 'hasOwnProperty' of undefined
    at appendFormValue (/home/XX/nodebb/node_modules/request/request.js:340:17)
    at Request.init (/home/XX/nodebb/node_modules/request/request.js:354:11)
    at new Request (/home/XX/nodebb/node_modules/request/request.js:140:8)
    at request (/home/XX/nodebb/node_modules/request/index.js:55:10)
    at Function.post (/home/XX/nodebb/node_modules/request/index.js:63:12)
    at authorize (/home/XX/nodebb/node_modules/nodebb-plugin-imgur/index.js:68:11)
    at Layer.handle [as handle_request] (/home/chollodiario/nodebb/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/XX/nodebb/node_modules/express/lib/router/route.js:131:13)
    at Route.dispatch (/home/XX/nodebb/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/XXX/nodebb/node_modules/express/lib/router/layer.js:95:5)


  • NodeBB

    @donorom What version of the plugin?

  • This is a crazy contingency question; I doubt it'd ever happen but what if Imgur closed down and we were told to download our images from their server, could we dump them all into a folder on our own server and somehow get them to display?

  • @henrywright that is why I host images on my server. The other reason is that I can put the images through some software to make them smaller in kilobytes.

  • @prog I use Digital Ocean and storage seems to be 20GB on the plan I have. For 40GB I'd need to quadruple what I currently pay per month. I'd love to host images direct on my server but I can't afford it 😞

  • @prog also I think Imgur has a setting which allows images to be reduced in file size on upload which speeds up loading times

Suggested Topics

| |