0

I am creating an tampermonkey userscript which grabs all the direct links of anime episodes and puts them into a textarea so I can easily import them with Internet Download Manager.

However they have recently put a redirector in place of the video direct download link, this is what happens with my ajax request now. Response

This is the code I am using:

$.ajax({
    type: "GET",
    url: "http://kissanime.com/Re?id=anZ2cnU8MTFuajUwaXFxaW5nd3VndGVxcHZncHYwZXFvMUNmUXtHT01aXGpyZTVLWmVuY0t7WlYyW3pMZG03bUljSlM7RllcbHE3aT9vNTk%3d"
}).error(function(XMLHttpRequest, textStatus, errorThrown) {
    console.log(XMLHttpRequest.getResponseHeader('Location'));
    // Gives me null ^
});

I somehow need to get the location it redirects me to so I can get the direct link instead of its redirector. How can I do this?

Mike
  • 127
  • 12
  • An ajax request will [always follow the redirect](http://stackoverflow.com/questions/282429/returning-redirect-as-response-to-xhr-request/2573589#2573589), so that's probably not the real issue. What's the error you're getting ? – adeneo Apr 06 '15 at 22:08
  • [Previous answer][1] on handling redirects. [1]: http://stackoverflow.com/questions/1804928/handle-jquery-ajax-redirect – Mark S. Apr 06 '15 at 22:10
  • @adeneo it gives me a 301 error which is not a problem but I need the location of the page that gives me the 301, because that is the direct video link. It is an origin error. – Mike Apr 06 '15 at 22:49

0 Answers0