Topic: Bluesky "original" direct image

Posted under General

mapachito

Privileged

Is there an UserScript for Bluesky that automatically replaces the direct image url you get with right click to the "original" CDN servers direct image url for whitelisted direct upload?
It's too time consuming to manually check all the <CDN server name>.<geographical location> to get the "original" direct image for the artists that only post on Bluesky.

For example this post
post #5082539

The source is https://bsky.app/profile/muzzable.bsky.social/post/3l4zw5tgnba2x
The urls you get with right click are https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:j36op6ahcc3nld5sirlmhold/bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm@jpeg
https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:j36op6ahcc3nld5sirlmhold/bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm@jpeg

Following the URL format at the wiki and manually checking all the CDN servers one by one https://e621.net/wiki_pages/31895#bluesky
The Direct image ("Original") of that post that is whitelisted for direct upload is https://porcini.us-east.host.bsky.network/xrpc/com.atproto.sync.getBlob?did=did:plc:j36op6ahcc3nld5sirlmhold&cid=bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

If the <CDN server name>.<geographical location> is not the correct for the image you get a {"error":"RepoNotFound","message":"Could not find repo for DID: did:plc:j36op6ahcc3nld5sirlmhold"} error https://maitake.us-west.host.bsky.network/xrpc/com.atproto.sync.getBlob?did=did:plc:j36op6ahcc3nld5sirlmhold&cid=bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

I wonder if is possible an UserScript for Bluesky that automatically replaces the url similar to the one for Twitter that automatically replaces the url and adds orig

Quick link to wiki for convenience
Yes, you use the Direct image ("Original", old) version:

https://bsky.social/xrpc/com.atproto.sync.getBlob?did=<decentralized identifier>&cid=<IPFS content identifier>

and use that to direct upload

So for your example, we get the relevant info from the bsky download link: https://av-cdn.bsky.app/img/feed_thumbnail/plain/<decentralized identifier>/<IPFS content identifier>@jpeg

and identify the decentralized identifier as did:plc:j36op6ahcc3nld5sirlmhold and IPFS content identifier as bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

And the link we create is https://bsky.social/xrpc/com.atproto.sync.getBlob?did=did:plc:j36op6ahcc3nld5sirlmhold&cid=bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

Which you can check leads to the right place, and works with the URL uploading form

And to borrow shamelessly from gattonero in the other thread

gattonero2001 said:

For example Bluesky requires a userscript that can be applied through the Tampermonkey browser extension

BSky Redirect
// ==UserScript==
// @name         BSky Redirect
// @namespace    http://tampermonkey.net/
// @version      2024-05-26
// @description  Redirect you to the best version available from bluesky
// @author       You
// @match        https://cdn.bsky.app/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bsky.app
// @grant        none
// ==/UserScript==

(async function () {
  'use strict';

  let url = window.location.pathname.split("/")

  if (url.length < 6) return

  let did = url[4]
  let cid = url[5].slice(0, url[5].lastIndexOf("@"))

  if (did && cid) {
    window.location.href = `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=${did}&cid=${cid}`
  }
})();

Updated

mapachito

Privileged

snpthecat said:
Quick link to wiki for convenience
Yes, you use the Direct image ("Original", old) version:

https://bsky.social/xrpc/com.atproto.sync.getBlob?did=<decentralized identifier>&cid=<IPFS content identifier>

and use that to direct upload

So for your example, we get the relevant info from the bsky download link: https://av-cdn.bsky.app/img/feed_thumbnail/plain/<decentralized identifier>/<IPFS content identifier>@jpeg

and identify the decentralized identifier as did:plc:j36op6ahcc3nld5sirlmhold and IPFS content identifier as bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

And the link we create is https://bsky.social/xrpc/com.atproto.sync.getBlob?did=did:plc:j36op6ahcc3nld5sirlmhold&cid=bafkreidvjgqvla72qclk7xqyecqnkn5q6zlmshazigy42togikghrnelzm

Which you can check leads to the right place, and works with the URL uploading form

And to borrow shamelessly from gattonero in the other thread

Thank you for the tampermonkey script!
I didn't know the Direct image ("Original", old) version still worked but it's much better using a UserScript

  • 1