Flickr如何阻止人们从网站下载图像?

时间:2022-11-11 22:07:13

Just wondering how does Flickr prevent people from downloading images from its site? What are they using?

只是想知道Flickr如何阻止人们从其网站下载图像?他们在用什么?

2 个解决方案

#1


18  

Transparent .gif over the image. You can still download the actual image by viewing the HTML source and finding the image's actual URL.

图像上的透明.gif文件。您仍然可以通过查看HTML源并查找图像的实际URL来下载实际图像。

For example, a random image: http://www.flickr.com/photos/34285128@N00/4300352607/

例如,随机图像:http://www.flickr.com/photos/34285128@N00/4300352607/

<img style="position:absolute;top:0px;left:0px;display:block" src="http://l.yimg.com/g/images/spaceball.gif" alt="" width="500" height="366">

That's the transparent image on top.

这是顶部的透明图像。

<img src="http://farm5.static.flickr.com/4057/4300352607_edcc5a4a9e.jpg" alt="Say It With Flowers by *sido* (back in a few days)." title="" width="500" height="366" class="reflect">

That's the actual image, which is displayed below spaceball.gif.

这是实际的图像,显​​示在spaceball.gif下面。

#2


0  

Not to thread dump, but conceptually if you are really trying to lock out downloading an image, you could (i think). Using a framework like asp.net mvc, you could tag the image with a unique key, storing the key either in memory or some other form of persistence and pass it down to the client with the id as the filename. On the returning end, upon request for the file, you could intercept the request for the image and perform a lookup on the key matching it to the actual file. Once you have the file, you return the image as a custom result with the appropriate meta tags (at least in mvc, not sure how you'd do it elsewhere). Before you return it though, you flag the result as being viewed.

不是线程转储,但从概念上讲,如果你真的试图锁定下载图像,你可以(我认为)。使用像asp.net mvc这样的框架,您可以使用唯一键标记图像,将密钥存储在内存或其他形式的持久性中,并将其传递给客户端,并将id作为文件名。在返回端,根据文件请求,您可以拦截对图像的请求,并对与实际文件匹配的密钥执行查找。获得文件后,将图像作为自定义结果返回,并附带相应的元标记(至少在mvc中,不知道如何在其他地方执行此操作)。在您返回之前,您将结果标记为正在查看。

It would be a great deal of work on the server, but it would require a great deal of effort for anyone to snag the image if you utilized Flickr's transparent gif technique in conjunction with it.

这将是服务器上的大量工作,但如果你将Flickr的透明gif技术与它结合使用,那么任何人都需要付出很大的努力来阻止图像。

The idea being that a single request would be issued on a normal view and any further attempts to view the image directly (by viewing source and grabbing the url) would be blocked.

这个想法是在普通视图上发出单个请求,并且任何进一步尝试直接查看图像(通过查看源和抓取URL)都将被阻止。

<./threadump>

Sorry, just had the idea and wanted to add it to the already answered question (sleep deprevation and all that jazz).

对不起,刚刚有了想法,想把它添加到已经回答的问题(睡眠匮乏和所有爵士乐)。

#1


18  

Transparent .gif over the image. You can still download the actual image by viewing the HTML source and finding the image's actual URL.

图像上的透明.gif文件。您仍然可以通过查看HTML源并查找图像的实际URL来下载实际图像。

For example, a random image: http://www.flickr.com/photos/34285128@N00/4300352607/

例如,随机图像:http://www.flickr.com/photos/34285128@N00/4300352607/

<img style="position:absolute;top:0px;left:0px;display:block" src="http://l.yimg.com/g/images/spaceball.gif" alt="" width="500" height="366">

That's the transparent image on top.

这是顶部的透明图像。

<img src="http://farm5.static.flickr.com/4057/4300352607_edcc5a4a9e.jpg" alt="Say It With Flowers by *sido* (back in a few days)." title="" width="500" height="366" class="reflect">

That's the actual image, which is displayed below spaceball.gif.

这是实际的图像,显​​示在spaceball.gif下面。

#2


0  

Not to thread dump, but conceptually if you are really trying to lock out downloading an image, you could (i think). Using a framework like asp.net mvc, you could tag the image with a unique key, storing the key either in memory or some other form of persistence and pass it down to the client with the id as the filename. On the returning end, upon request for the file, you could intercept the request for the image and perform a lookup on the key matching it to the actual file. Once you have the file, you return the image as a custom result with the appropriate meta tags (at least in mvc, not sure how you'd do it elsewhere). Before you return it though, you flag the result as being viewed.

不是线程转储,但从概念上讲,如果你真的试图锁定下载图像,你可以(我认为)。使用像asp.net mvc这样的框架,您可以使用唯一键标记图像,将密钥存储在内存或其他形式的持久性中,并将其传递给客户端,并将id作为文件名。在返回端,根据文件请求,您可以拦截对图像的请求,并对与实际文件匹配的密钥执行查找。获得文件后,将图像作为自定义结果返回,并附带相应的元标记(至少在mvc中,不知道如何在其他地方执行此操作)。在您返回之前,您将结果标记为正在查看。

It would be a great deal of work on the server, but it would require a great deal of effort for anyone to snag the image if you utilized Flickr's transparent gif technique in conjunction with it.

这将是服务器上的大量工作,但如果你将Flickr的透明gif技术与它结合使用,那么任何人都需要付出很大的努力来阻止图像。

The idea being that a single request would be issued on a normal view and any further attempts to view the image directly (by viewing source and grabbing the url) would be blocked.

这个想法是在普通视图上发出单个请求,并且任何进一步尝试直接查看图像(通过查看源和抓取URL)都将被阻止。

<./threadump>

Sorry, just had the idea and wanted to add it to the already answered question (sleep deprevation and all that jazz).

对不起,刚刚有了想法,想把它添加到已经回答的问题(睡眠匮乏和所有爵士乐)。