Redirect Rapidshare links through CGI Proxy

in Ideas and script requests
Subscribe to Redirect Rapidshare links through CGI Proxy 20 posts, 6 voices



mgforce User

Hi Guys,
I am a total n00b with no programming background.. I am interested in a script which will modify the
Rapidshare links appearing on a web page such that when I click on them to open in background the url address

is modified from

http://rapidshare.com/files/123456/download.rar

to

http://freeproxy.com/nph-proxy.cgi/000010A/http://rapidshare.com/files/123456/download.rar

As you can see I want to append proxy server link before the RS link.

After reading forums I tried using re-direction script as following but no success

 // ==UserScript==
// @name           RS Link Redirect
// @include        http://rapidshare.com/files/*
// ==/UserScript==

document.location.replace(document.location.href.replace(/\/http://rapidshare.com/files/\//, "/http://freeproxy.com/nph-proxy.cgi/000010A/http://rapidshare.com/files//"))

Can someone pls help me in making this script? I think it a simple one but due to lack of programming knowledge I am unable to make it work.

Thnx in advance

 
DMaster Scriptwright

amm... try this.. it helped me.. :
http://userscripts.org/scripts/show/37638
.
Kudos to avg for the revised edition !

 
mgforce User

DMaster thnx for the reply but script doesn't help me at all...

I need to access rapidshare via cgi proxy as direct access to RS is blocked at my place..

Thats why I need some small script customizing the RS links

 
smk Scriptwright

thanks to avg!
never knew there was a revived version

 
mgforce User

Can someone pls help me in writing this script to redirect files to cgi proxy?

 
Aquilax Scriptwright

Use one of the following sites:
http://www.filterbypasser.com
http://webproxiez.com
http://www.warptraffic.com

 
znerp Scriptwright

I don't know why everyone seems to have ignored the original post.

@mgforce: Try this..

document.location.replace(document.location.href.replace(/http:\/\/rapidshare\.com\/files\//, "http://freeproxy.com/nph-proxy.cgi/000010A/http://rapidshare.com/files/"))

Although it might be easier to simply do this..

location.replace("http://freeproxy.com/nph-proxy.cgi/000010A/" + location.href)

 
mgforce User

Thanks znerp...

I will try it & update you on the results..

Update 1
It doesn't seem to work..Its going to the normal rapidshare download page..

I tried both.. is it because I have other RS scripts installed?

Update 2
I removed all RS scripts.. now the second one seems to be working.

first it opens the normal RS download page.. after few seconds it gets redirected. Can something be done to avoid opening RS page & bypassing that & redirectto the proxy only.

Thanks a ton

 
znerp Scriptwright
Can something be done to avoid opening RS page & bypassing that & redirectto the proxy only.

Greasemonkey scripts only run after the page has loaded fully, hence why you're experiencing this lag. It would be possible to remove this though if you change the link on the page you're coming from. Of course, this could mean that you'll slow down every page this script runs on. Anyhow, you can do that like this..

var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--)
  rapidshareLinks.snapshotItem(i).href = "http://freeproxy.com/nph-proxy.cgi/000010A/" + rapidshareLinks.snapshotItem(i).href;
 
mgforce User

ok.. if thats the case then I am more than happy to use the same script.

one last request.. is it possible that for these RS links I can get option to open the links in background page rather than same page.

Thanks again for all the help znerp

 
dob Scriptwright

Change the last line to the following:


rapidshareLinks.snapshotItem(i).addEventListener("click", function(e) {
   e.preventDefault();
   e.stopPropagation();
   GM_openInTab("http://freeproxy.com/nph-proxy.cgi/000010A/" + this.href);
}, false);

 
mgforce User

Thanks dob

In case I am using following script

location.replace("http://freeproxy.com/nph-proxy.cgi/000010A/" + location.href)

can I still use the code mentioned by you??

I am not using last script posted by znerp bcoz he mentioned it will slow page loading

 
dob Scriptwright

Go ahead and use znerps script. it won't be all that slow.
I just changed "location.href" to "this.href", because it's working on one link.

The function GM_openInTab() needs some href as a parameter, in this case it's the link's href that is clicked. If you want to use it otherwise, you still need to launch it if something happens (event).

 
mgforce User

OK.. this is what I tried

var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--)
  
rapidshareLinks.snapshotItem(i).addEventListener("click", function(e) {
   e.preventDefault();
   e.stopPropagation();
   GM_openInTab("http://freeproxy.com/nph-proxy.cgi/000010A/" + this.href);
}, false);

but doesn't seem to be working.. any idea why ?

The link just opens as usual as Rapidshare download... no redirect to proxy even after 10 seconds

 
mgforce User

can anyone help me pls ?

 
smk Scriptwright

code works find on my firefox
however freeproxy.com seems to be a dead link
why not just change the href rather than adding an event listner?

 
mgforce User

yes.. the link used just as example...

so you are saying that on using that code rapidshare links are opening in background tab??? but in my firefox they open is same page.

 why not just change the href rather than adding an event listner?

and how can that be done.. pls excuse me for my ignorance but I have no programming knowledge.

 
dob Scriptwright

you could also do this:

var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, 6, null);

for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--) {
 rapidshareLinks.snapshotItem(i).href = "http://freeproxy.com/nph-proxy.cgi/000010A"+rapidshareLinks.snapshotItem(i).href;
 rapidshareLinks.snapshotItem(i).target = "_blank";
}

 
mgforce User

Thanks dob.. I will try it & let you know whether it works or not..

the one suggested yesterday is not working

 
mgforce User

Ok.. I tried it.. but same as earlier...

the rapidshare link is opening in the same page.. I am using following..

 // ==UserScript==

// @name           RS via CGI

// @namespace      1

// @description    Redirects RS links to open through CGI proxy

// @include        http://rapidshare.com/files* 

// ==/UserScript==



var rapidshareLinks = document.evaluate('//a[starts-with(@href, "http://rapidshare.com/files/")]', document, null, 6, null);

for (i = rapidshareLinks.snapshotLength - 1; i >= 0; i--) {
 rapidshareLinks.snapshotItem(i).href = "http://freeproxy.com/nph-proxy.cgi/000010A"+rapidshareLinks.snapshotItem(i).href;
 rapidshareLinks.snapshotItem(i).target = "_blank"; 

ok.. got my mistake.. @ include selection was wrong.. I changed from http://rapidshare.com/files* to http://*

Now working.. thanks to all for the help & time

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel