Why can't I load images from imgur?#
Simply put, it's because of IP blocking. Imgur is inaccessible in mainland China, so we need to use a scientific method to access it. At this point, your node's IP may be on imgur's blacklist, preventing it from loading. Specifically, accessing i.imgur.com
(direct image link) will return 429
, and accessing imgur.com
will return:
So what can I do?#
The simplest method is to change to a different node.
However, I found that after trying all my existing nodes (including self-hosted ones), none of them can be accessed normally!!!
Some netizens say that many data center IPs have been blacklisted by imgur. Unfortunately, I don't want to look for more options at this point, so I thought of trying something on my own.
Inspiration 1#
Many websites are slow to access or blocked in mainland China. In such cases, some people create mirror sites for public welfare, such as the mirror site HF-Mirror for Hugging Face.
So I thought, is there a mirror site for imgur?
Answer: I couldn't find one.
However, there are some websites that provide image mirror caching services. They can cache direct links to image hosting sites and forward them to users. You can refer to this article for more details.
Taking https://img.noobzone.ru/getimg.php?url=
as an example, you can directly add the imgur image link you want to access to the end of the URL (as a parameter) to access it without the need for a scientific method.
For example: https://img.noobzone.ru/getimg.php?url=https://i.imgur.com/TbWS0cZ.png
Inspiration 2#
I thought of Header Editor (google.com), a browser extension that can redirect requests that meet certain conditions.
So I wrote a regex to match URLs with i.imgur.com
as the domain and redirect them to https://img.noobzone.ru/getimg.php?url=
.
Update: Thanks to a helpful netizen's reminder, it seems that the image caching website has enabled anti-leeching measures. To solve this, we can create another rule to remove the referer
header in the request, and then we can successfully retrieve the images.
After installing the extension, you can refer to the configuration I wrote, or directly import it from:
After importing, enabling the rule should take effect.
Limitations#
This method only works in browsers. If you need to access imgur in other software, you may need to use other proxy software, which is beyond the scope of this discussion. Interested readers can explore and implement it on their own.
References#
- 图片防盗链最终解决方案,超级简单实用的方法 | 爱淘数字资源馆 (1itao.com)
- imgur 办掉了所有的乌龟壳 ip 访问图片 - 美国 VPS 综合讨论 - 全球主机交流论坛 - Powered by Discuz! (hostloc.com)
Thanks#
To the anonymous netizen "游客" for providing additional solutions.