Anakunda / Image Host Helper

Published:

Version: 1.90.5+243a3b3 updated

Summary: Directly upload local / rehost remote images or galleries to whatever supported image host by dropping/pasting them to target field

Copyright: 2020-21, Anakunda (https://greasyfork.org/users/321857-anakunda)

License: GPL-3.0-or-later

Libraries Used

GM extensions! → Tampermonkey, Violetmonkey, GreaseMonkey...

Script is generic thereby the field of action can be extended to virtually any forum, social network or content sharing platform using standard html elements on it's forms, by adding custom URL matches in script options. On sites implementing 3rd party applets or custom edit controls it certainly won't work.

Supported image hosts:

No interactive UI for choosing where the upload/rehost goes, this works on principle of sequential iteration till first host succeeds. Customization of hosts chain via upload_hosts and rehost_hosts local storage entries (global hostlists). Defaults to all supported platforms. List order is honoured in fallback cascade => to favour/disfavour specific host, move it forwards/backwards within the list, to not use it at all, remove it.
Per-site host lists as storage preference in same format as general hostlists ("www.site.com": "host1, host2, ....") are allowed. Custom hostlist for site found takes precedence over global hostlists.

Any Chevereto-powered site can be chained via chevereto_custom_hosts storage entry. It's value is an array of objects with keys host_name (required), alias (required), types, size_limit, size_limit_anonymous, config_prefix and api_endpoint, api_field_name, api_result_key, json_endpoint, serialized to JSON format. Account credentials are recognized as <alias_in_lowercase>_uid/<alias_in_lowercase>_password and <alias_in_lowercase>_api_key unless overriden by config_prefix. types is an array of MIME subtypes for image/* category; if not set, the precondition test is not performed. Value of alias key should then be manually chained into upload_hosts, rehost_hosts or site custom hostlist.
A definition example for ImgCDN host: The value of chevereto_custom_hosts will be
[{\"host_name\":\"imgcdn.dev\",\"alias\":\"ImgCDN\",\"types\":[\"jpeg\",\"png\",\"gif\",\"bmp\",\"webp\"],\"size_limit_anonymous\":20,\"size_limit\":30}]
and storage keys for optional authentication are imgcdn_uid and imgcdn_password. Since the site provides API interface, imgcdn_api_key config entry can be set to site public key "5386e05a3562c7a8f984e73401540836", then API will be used for uploads instead of web browser emulation. As last step insert alias name ImgCDN to upload_hosts, rehost_hosts or site custom hostlist.

Mouse drop keyboard modifiers:
Ctrl - don't append at the end but rather try to insert at mouse position (doesn't seem to work correctly on some browsers)
Shift - bypass Image Host Helper, do browser's default
Alt enables to choose from more insertion formats

Resolving of image share links to image URLs for rehosting works (inputs like https://www.imdb.com/title/tt8228288/, https://www.deezer.com/album/180803042 or https://imgur.com/a/QcVu2Aj can be feeded). Galleries rehosting support for Imgur, PostImages, Chevereto-based paltforms, ImageVenue, ImgBox, PixHost, Flickr, caps-a-holic.com, Pinterest, Google Photos, 500px.com, Discogs, MusicBrainz.... Something missing? Ask to add it.

Thumbnailed format of images is enabled for all multiline text fields (assumed support of phpBB). For choosing thumbnailed form, hold Alt key while dropping/pasting the content. Available for all Chevereto based paltforms, PixHost, ImgBox, Abload, PimpAndHost, PicaBox at the moment, the list will likely expand later. Not available for PTPimg, Catbox and other sites that don't auto-generate thumbnails.

Reduce image size before upload to preferred host, if too big is possible now. Works only for simple input controls (movie poster, artist photo, user avatar, album cover, etc.). Related storage entry: image_size_reduce_threshold => a positive number as max. size in KiB to leave the image intact, in other case attempt is made to reduce the image size (downsize and (re)convert to JPEG90). having this entry zero, undefined or otherwise non-number deactivates the option. This feature doesn't apply to large text inputs (description, screenshots, comparisons will never reduce). Not active by default, have to activate by manually adding the config entry. More refinements: image_reduce_maxheight(1500), image_reduce_jpegquality(90). Utilized service: Img2Go

[EXPERIMENTAL] Config entry optipng = true activates local and remote PNG images optimization before upload to image host. Unlike bulky image reduction which applies only to single line inputs, optipng applies only to multiline inputs. Off by default. Utilized service: ezgif.com

These user credentials can be set (via local storage):

PTPIMG.me: ptpimg_api_key (auto-configured on first use if logged in)
imgBB.com: imgbb_uid, imgbb_password or imgbb_api_key
Catbox.moe: catbox_userhash (auto-configured on first use if logged in)
ImgBox.com: imgbox_uid, imgbox_password
ImageVenue.com: imagevenue_uid, imagevenue_password
jerking.empornium.ph: jerking_uid, jerking_password
Imgur.com: not implemented for laziness
radikal.ru: radikal_uid, radikal_password
Vgy.me: vgyme_user_key (https://vgy.me/account/details#userkeys)
Gifyu: gifyu_uid, gifyu_password
Slowpoke Pics: slowpoke_uid, slowpoke_password
FunkyIMG: funkyimg_uid, funkyimg_password
SM.MS: smms_api_key (generated in user profile)
CubeUpload: cubeupload_userid, cubeupload_userhash (auto-configured on first use if logged in)
Ra: ra_api_key (auto-generated on first use if logged in, or entered manually)

Experimental support of native API for Chevereto sites: define <imagehost alias>_api_key local storage entry.
Supported sites: ImgBB
Priority flow: api key > user login > anonymous

Site specific extensions:

  • PTP: artist edit - auto fetch photo from IMDb (if missing or invalid)
  • RED, OPS, NWCD, DIC: artist edit - auto lookup photo on Qobuz/Discogs/iTunes/Deezer/YT Music/Last.fm (if missing or invalid)

(both above features can be optionally disabled by adding auto_lookup_artist_image storage entry (false)

Known issues:

  • Progress meter for locally sourced uploads doesn't work on current browsers running Tampermonkey, which is kind of limitation or bug.
  • Google Drive as a service not auto-added to default chains due to existing shortcommings: their API asks for confirming account every new session, doesn't work if automatic popup blocking is active for current site, and direct image links seem not be shown in phpBB code.
  • Violentmonkey (+GM) problems with names hoisting possibly resolved, report fails if any remaining

Rating: 0