Wget: How to bypass “hotlinking” protected image
-
06-07-2021 - |
Question
Is it possible to bypass "hotlink" image protection? i'm not trying to post it on other sites just to download. when i download the following image, using wget:
http://comicsbook.ru/upload/%D0%9A%D0%BE%D0%BC%D0%B8%D0%BA%D1%81-Trollface-%D0%9D%D0%B0-%D0%B1%D0%BE%D1%80%D1%82%D1%83-70813.jpg
I'm getting redirected to:
http://comicsbook.ru/trollface/70813?na-bortu
I have no idea where to start. What I've tried so far:
curl "http://comicsbook.ru" -s -L -b cookie.c -c cookie.c -b "$COOKIEPAR" > index.$TEMP
wget http://comicsbook.ru/upload/%D0%9A%D0%BE%D0%BC%D0%B8%D0%BA%D1%81-Trollface-%D0%9D%D0%B0-%D0%B1%D0%BE%D1%80%D1%82%D1%83-70813.jpg
Solution
You can use the --refer=URL
option of wget
.
Perhaps you could try:
wget --referer=http://comicsbook.ru http://comicsbook.ru/upload/%D0%9A%D0%BE%D0%BC%D0%B8%D0%BA%D1%81-Trollface-%D0%9D%D0%B0-%D0%B1%D0%BE%D1%80%D1%82%D1%83-70813.jpg
OTHER TIPS
To download this image, run the following curl command :
curl -e 'http://comicsbook.ru/trollface/70813?na-bortu' -A "Mozilla/5.0" -L -b /tmp/c -c /tmp/c -s 'http://comicsbook.ru/upload/%D0%9A%D0%BE%D0%BC%D0%B8%D0%BA%D1%81-Trollface-%D0%9D%D0%B0-%D0%B1%D0%BE%D1%80%D1%82%D1%83-70813.jpg' > image.jpg
All the magic is in -e
switch : the referer
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow