How to Submit Form From Another Page

-1

I am applying Javascript in the address bar, to redirect YouTube video URL to link download "MP3".

Already on link , you need to click the "Convert" button to start the Conversion logo followed by Download .

I've been analyzing the Source Code of the page and I noticed that to start the YouTube Conversion URL it goes to convert.php and then download.php?id= .

  

In other words - It link Download the Youtube video URL - > for convert.php - > then download.php?id= to download the "MP3".

Doubt

  

Would you like to pass this entire process automated to script , without needing the human intervention to click the "Convert" button?

Code

javascript:window.location.href='https://youtubegomp3.com/?u='+encodeURIComponent(location.href)+'&title'+encodeURIComponent(document.title);
    
asked by anonymous 24.07.2016 / 20:22

1 answer

2

It is not allowed to run scripts or gain access to HTML objects under a different domain.

Example, if you execute a JavaScript action from www.foo.bar to access elements of the www.bar.foo site, it will not succeed.

The reason is basic Internet browsing security standards.

One option to solve is to make a direct request with a language such as PHP. To do this, read the HTML code of the target page to find out what parameters and URL you should request.

Another recommended way is to find out if the target website provides some API, so before you start making any gambiarras, check if there is an API (webservice).

    
25.07.2016 / 05:39