Passing encoded url (%3A <-> :)

Hi,

My issue is that I’m trying to automatize a process where I need to append a fully url encoded link (to an image) to the end of an other link (doesn’t need to be encoded, it’s a reverse image search engine).

The url I need to append the other link to:

https://saucenao.com/search.php?db=999&url=

The link to the picture comes from the Public folder of my DropBox account, e.g.

https://dl.dropboxusercontent.com/u/XXXX/Sauce/Sauce.jpg

It needs it to be passed as

https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2FXXXXXX%2FSauce%2FSauce.jpg

otherwise the site can’t process it. However, when I put

https://saucenao.com/search.php?db=999&url=https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2FXXXXXX%2FSauce%2FSauce.jpg

in KM, https%3A%2F%2F is replaced by https:2F%2F which will obviously not work.

Is there any workaround or solution for this or am I doing something wrong?

Thanks

Keyboard Maestro sees %3A% as a text token.

You need to encode each % as %%

But as with any encoding, it depends on exactly where it is going to be decoded.

For example, you could do this:

Set variable SubURL to "https://dl.dropboxusercontent.com/u/XXXX/Sauce/Sauce.jpg"
Search and Replace variable SubURL : with %%3A
Search and Replace variable SubURL / with %%2F
Open URL https://saucenao.com/search.php?db=999&url=%Variable%SubURL%

Something like that anyway.

1 Like

Perfect, thanks!