Sometimes you can’t get to an image host because it is down or has exceeded it’s allotted bandwidth. If the host has a mirror (many do these days), you can use this Greasemonkey script to pass requests to the mirror automatically.
Just replace “originalimagehost” and “newmirror” with the correct names and replace “domain” with the name of the sites you want the script to run on and it should work. Most mirrors I have seen have a script path so add that in under “scriptpath” if yours does or remove it if it doesn’t:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// ==UserScript== // @name imagehost redirect // @namespace imagehost redirect // @description Replaces all primary image host links with mirror links // @include http://*.domain.com/* // @include http://domain.com/* // ==/UserScript== var a = document.getElementsByTagName('a'); for (i=0;ia.length;i++) { p = /originalimagehost\.com\/([A-Za-z0-9]+)/; res = p.exec(a[i]); if (res!=null) { a[i].href = 'http://www.newmirror.com/scriptpath/?' + res[1] + '.jpg'; } } |
Jason Samuel is a visionary product leader and trusted advisor with a proven track record of shaping strategy and driving technology innovation. With extensive expertise in enterprise end-user computing, security, cloud, automation, and virtualization technologies, Jason has become a globally recognized authority in the IT industry. His career spans consulting for hundreds of Fortune 500 enterprises across diverse business sectors worldwide, delivering cutting-edge digital solutions from Citrix, Microsoft, VMware, Amazon, Google, and NVIDIA that seamlessly balance security with exceptional user experiences.
Jason’s leadership is amplified by his dedication to knowledge-sharing as an author, speaker, podcaster, and mentor within the global IT and technology community. Recognized with numerous prestigious awards, Jason’s contributions underscore his commitment to advancing technology and empowering organizations to achieve transformative results. Follow him on LinkedIn.