Requested file in Javascript downloading to the user's computer rather than being read

StackOverflow https://stackoverflow.com/questions/16735281

  •  30-05-2022
  •  | 
  •  

Question

I am trying to perform a hack, what my primary goal is to get the mp4 links of youtube videos. In past, I have been downloading the text file from http://www.youtube.com/get_video_info?video_id=videoidand extracting the links from there, this works in the apps but in browser its not possible because its a cross site request and browsers do not allow it.

To counter this I used easyXDM, now the problem is the file is being downloaded on the user's machine instead of opening in Javascript. Here's the easyXDM code

$(document).ready(function(){  var socket = new easyXDM.Socket({
        remote: "http://www.youtube.com/get_video_info?video_id=PBOBJRto728", // the path to the provider
        onMessage:  getVideo
    }); 
   });

Here's the page http://www.voltsoft.com/default.html, you can go there and see what's happening.

How can I read the data from the file in javascript?

No correct solution

OTHER TIPS

easyXDM is not going to faciliate your needs. In order for easyXDM to function you need it hosted on the two domains you want to communicate between. In this case you need it on both voltsoft.com and youtube.com. You can't use easyXDM here because you can't upload arbitrary HTML/JS content to youtube.com.

Generally the solution in this situation is that you either need to proxy the remote contents server-side or you need the cooperation of the remote server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top