I am using Jsoup in my app to scrape data from a site. Everything was fine until I came across the 'download' part of the app. It would be easy if the download link is in the href value but this site uses a javascript function
Here's how the site is layed out:
This is the link to the file:
<a href="javascript:download(11848,'d915f46123');">Ai Ai Ai ni Utarete Bye Bye Bye</a>
Below is the javascript download function. It accepts a songid and a key, builds a string with the passed arguments and sets it as the form's action attribute, and calls the form's submit method:
function download(songId, key)
{
var form = document.getElementById('dlForm'); form.action = '/download/zephzeph/' + key + '/' + songId + '.mp3';
form.submit();
}
Below is the form:
<form id="dlForm" action="/amusic/download.php" method="POST"></form>