Closed khabib227 closed 1 year ago
Does it hash the URL of the image? Those are a bit too specific for my taste. I could imagine having a format for any JavaScript code but I don't know if that would help with your case. The code would be super long and you would need a format inside a format. And you would need to escape ] again.
For instance when I search in Tinyeye for the image of my avatar, Tinyeye put in location bar this link:
https://tineye.com/search/fc3ddd62bd192bab61ded61e3092c7cc45bdb8ed?sort=score&order=desc&page=1
instead of something like this:
https://tineye.com/search/https://avatars.githubusercontent.com/u/61421212?s=80&v=4
Tinyeye use the a SHA1 hash of the image instead of the image link, this make impossible to create a redirection to Tinyeye, I guess Tinyeye do this also to difficult this possibility, is not just Tinyeye which do it, another example is Virus Total service, in general services which work with files uploads generaly use hashs on url, I think is not just to difficult redirects but because the hash is better to identify files in this services. So I dont think it specific, is very generic, have a lot of services which use this way, and it can greatly improve your plugin capacity. Just my opnion, I use you plugin often, and it has limiting my possibilities, because it I make this suggestion. Thanks.
Another thing you can add is a option to use "POST requests", because it is really very common,
You can add formats like:
%sha1file or %sha256file
So if has some known file type on url, for instance, jpg, png, example:
www.example.com/photo.jpg
So the plugin use the hash of "photo.jpg"
Is very simple, and very useful.
Are you sure TinEye hashes only the URL string with sha1? If I search https://tineye.com/static/img/robot.d21e95ee.png the sha1 is 92516b5e06b94d7b10ea7fe7e10e6d1aa9af7ea3. While if I hash the URL with sha1, I get 0bbbef5098a228f8b17d0fe4cb30b84f7fb0eaf2. I think it adds something else to the URL.
There's also a redirect for VirusTotal. Well, it doesn't seem to work anymore. I will look if it can be done.
Hashing file contents is probably technically possible, but I would like to keep this addon for addresses only.
I wasn't able to get VirusTotal work without hashing. It sha256 hashes the URL only, so in its case we could get it to work, if we would add %sha256 format.
VirusTotal would work without hashing, if we URL escape the url. GET on this works https://www.virustotal.com/gui/search/https%253A%252F%252Fwww.virustotal.com%252Fgui%252Furl%252F.
This services don't hash the full url but just hash the file, in this case the url:
https://tineye.com/search/92516b5e06b94d7b10ea7fe7e10e6d1aa9af7ea3?sort=size&order=desc&page=1
92516b5e06b94d7b10ea7fe7e10e6d1aa9af7ea3
this is the sha1 of "robot.d21e95ee.png"
If you want to implement it you need look to url, if has some known file type on url, some know file extension, for instance, jpg, png, gif example:
http://www.example.com/photo.jpg
So the plugin use the hash of the file "photo.jpg"
If implemented users can for instance search on TinEye using the redirect-link context menu in a gallery with thumbs without need to open the image, directly from thumbs, or use redirect-link from toolbar for a open image already on cache. This would be nice for redirect-link plugin. About Virus Total I just used it as a second example of a service which use file hashs. If implemented maybe you can just look for static images extensions, and exclude executables for instance:
%sha1image or %sha256image
Because I think to hash an executable you need to download it right? Or not? I don't know. But for static images, many times is already on cache, and if download is needed for instance when using on a photo gallery and with context menu, download a image to get the hash isn't a problem I think. Maybe you can implement it just for static images, which would be very nice.
Has a excellent firefox plugin called "Multithreaded Download Manager" which has a feature to search the download file on a customizable service which the user want, this plugin has a code to hash files to work with Virus Total, so, maybe you can use the code of this plugin to hash image files.
Because I think to hash an executable you need to download it right? Or not? I don't know. But for static images, many times is already on cache, and if download is needed for instance when using on a photo gallery and with context menu, download a image to get the hash isn't a problem I think. Maybe you can implement it just for static images, which would be very nice.
To hash the contents of any file, it needs to be downloaded. Or you could possibly use a web service that downloads the file and gives a hash as a result, but it would be better to download and hash it yourself.
No need implement this, because to search on Tineye, more effective than hash is use a specific bookmarklet on the plugin Search from Popup or ContextMenu (https://addons.mozilla.org/en-US/firefox/user/15076787/).
For instance %sha1, %sha256, %CRC32, %CRC64 etc. So you can create redirects to more sites, for example create a redirect with a image link to tineye.com, this service use a SHA1 hash to search images.