Issue
Some messengers (the ones with the browser inside) give a blob url when trying to copy an image. I would think that this data can only be accessed from the same browser, because I couldn't get the data either with wget
or by pasting the url into a normal web browser (like chromium). But the thing is that Telegram accesses this data just fine when I press Ctrl-V in the input field. So I'm wondering how it does this, and how I can do something similar in my bash script to save the image to disc.
url examples:
- from Cinny: blob:tauri://localhost/a38968fd-3d9c-441f-a70e-e6a0e6c71ea8
- from Element: blob:vector://vector/86021249-50df-45e6-ad4b-eb3d49136bc4
Solution
Chances are, the URLs that you see are just the text of the clipboard when you copy an image from one of those clients. But the clipboard (at least on Linux, but probably on other OS's as well) can have multiple types at the same time.
E.g. these are the data formats that are in my clipboard on Ubuntu after copying an image from the Slack desktop client:
$ xclip -o -t TARGETS 23:59:12 2024-01-13 !3647
TIMESTAMP
TARGETS
SAVE_TARGETS
MULTIPLE
STRING
TEXT
UTF8_STRING
text/plain
text/plain;charset=utf-8
Similarly, this is what LibreOffice shows when I attempt to special-paste that image:
So, if you want to access that data in the clipboard (with my assumption about different OS's in mind), you have to ask the clipboard for a different data format.
Answered By - Eugene Pakhomov Answer Checked By - Gilberto Lyons (WPSolving Admin)