Home > database >  She learned a how to download the problem of preventing hotlinking images by PB, it is difficult to
She learned a how to download the problem of preventing hotlinking images by PB, it is difficult to

Time:09-28

Very thank you for your help, I made a download procedures, under normal circumstances can download, including general preventing hotlinking images, but there are some preventing hotlinking images cannot download, strange, open the image directly with IE address, you can open the picture, but failed to download, such as the following address:
http://img8.tianya.cn/photo/2009/10/6/15320302_2404764.jpg
http://img10.tianya.cn/photo/2009/10/6/15321701_2404764.jpg
http://img11.tianya.cn/photo/2008/8/3/9329327_8479309.jpg
http://img13.tianya.cn/photo/2008/7/24/9137790_8479309.jpg
http://img14.tianya.cn/photo/2008/4/30/7761555_8479309.jpg
http://img15.tianya.cn/photo/2009/10/6/15320173_2404764.jpg

Please help to look at, how can achieve with the program to download the pictures? Thank you very much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

Dizzy, the use of PB in download!

Preventing hotlinking is actually using server-side programming, by preventing hotlinking url filtering technology to realize software,
Can forge the Referer
http://topic.csdn.net/u/20070813/00/262cb43a-7515-4a27-8685-2d2192ba4df0.html

CodePudding user response:

Do not understand, help.

CodePudding user response:

PB can be excuse me?

CodePudding user response:

Mainly adopted preventing hotlinking server,

Preventing hotlinking hotlinking is actually using server-side programming, by preventing hotlinking url filtering technology to realize software,
File.uudog.com/test.rar this download address, for example, if no hotlinking prevention, others can easily refer to the address on his website,
If the file.uudog.com server-side programming in this station, such as through file.uudog.com/test.rar? Authcode=xxxxxxxxxxxxxxxx& IP=127.0.0.1 binding IP, can visit this link, through 127.0.0.1 other IP is not allowed,

Site hotlinking prevention system is how to do?
The 2006-05-10 authors: very Long Du finishing reference: yesky editor: Long Du

Hotlinking prevention principle:

HTTP standard protocols have special field records referer

Result can be traced on what an inbound address

Both for resource files, can track to show what his web address,

So all hotlinking prevention methods are based on the Referer field

Online more two

One is using the apache files FileMatch restrictions in HTTPD. The increase in the conf (actually can also be putting into one. The following statement.htaccess file), and placed in the root directory of your website (WWW)/HTML directory, like this, there is no way to steal others even your dongdong ~ ~

SetEnvIfNoCase Referer "^ http://yahoo.com/" local_ref=1

Order to Allow a Deny

Allow the from env=local_ref

Allow the from 127.0.0.1

This convenient ban not allowed to access the URL reference resources file

Please note that the first sentence "^ http://yahoo.com/" to your website, such as my website is: http://www.linji.cn

I should have written this

"^ http://www.linji.cn/
"
The second is to use rewrite, need to increase the apache mode_rewrite, support.htaccess file directory permissions

In the virtual host root increased..htaccess file and description from the orientation, the non image files are from the orientation of local address refer to warning pictures or web site,

Must first confirm your server or server deciphering engine for Apache2 of the space, and support. Htaccess file customer files,

If you have your own server is on the first, please./conf/HTTPD. Conf file to do the following changes

Find: # LoadModule rewrite_module modules/mod_rewrite. So

Throw the # to go in front of the

To find such a AllowOverride None to AllowOverride All

Restart Apache2 server

. Next is to do a.htaccess file, its the.htaccess file content is

RewriteEngine on

RewriteCond % {HTTP_REFERER}! ^ http://aaoo.net/. * $(NC)

RewriteCond % {HTTP_REFERER}! ^ http://aaoo.net$(NC)

RewriteCond % {HTTP_REFERER}! ^ http://www.aaoo.net/. * $(NC)

RewriteCond % {HTTP_REFERER}! ^ http://www.aaoo.net$(NC)

RewriteRule. *. (JPG jpeg | | | PNG GIF | | BMP files rar | | zip exe) $http://down.yoyo.com.ru/err.html [R, NC]

The colored areas are to change to you:

Red: is to provide the download page to your address, that is only through the address provided by you can download dongdong,

Blue: is to protect the file extensions (separated by |), that is, the file extension for these only through red address can access,

Green: if not through the red address access for the extension of the blue the file returned to redirect to address on the green,

This method has a advantage is that a different virtual host with a description of the different definitions,

Next is how to use the.htaccess file for hotlinking prevention,

First need to build two directories on the space (directory name with you, of course), another for a web down,

Web is used to download page (or download the program), is put down, of course, is to put you provide dongdong,

Put the.htaccess file the red part of the change, change to your domain name http:///web, blue

Instead you want to protect the file extensions, green part instead of your domain name http:///web, after save

.htaccess file upload it down directory,

There is a third:

When I was in solving plog banned hotlinking, found a problem, also is a good way,

Plog himself all resource management, using resserver. PHP to dynamically display, unified entrance so convenient to add permission operation,

At the same time cause the above two methods can't use, because is no longer the apache direct access to a resource file, but PHP, read through the file

So can only play in your code: before reading resource files output, add the following judgment code

Refer to

$referer=$_SERVER [' HTTP_REFERER '].

$selfurl=$_SERVER [' HTTP_HOST];

If (false==strpos ($referer, $selfurl))

{

Echo 'illegal hotlinking! ';

exit(1);

}

Here are some lazy, see reference directly address whether to include the host address, but the principle is like this, to determine whether referer site address,

We are often in the download, also met hotlinking website can't download, hotlinking problem, the simplest way is to download this file to referer

Flashget for example, the url below the column of "reference", direct download address is ok

CodePudding user response:

It's hard to look

CodePudding user response:

Access Denied.
Access denied

Of course, you may not be able to download,

CodePudding user response:

If only the reason of guard against theft, you can use the normal can see methods into a temporary directory, then read this file, but a little complicated,
The original time on the Internet also heard a take picture with the method of the screen, it's a good idea, this may be more complicated,
  • Related