title: Downloaded File Has 0 Bytes
body: <p>I'm trying to download a <code>.mp3</code> music file from <a href="https://www.youtube.com/audiolibrary_download?vid=d0a68933f592c297" rel="nofollow noreferrer">this URL</a> to the project root directory but the downloaded file always has 0 bytes in size (it is blank). The download also immediately stops.</p>
  
  <p>I'm using the following code:</p>
  
  <pre><code>import java.io.File;
  import java.io.IOException;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  import org.apache.commons.io.FileUtils;
  
  public class MusicDownloader
  {
      public static void main(String[] arguments) throws MalformedURLException, IOException
      {
          download("https://www.youtube.com/audiolibrary_download?vid=d0a68933f592c297", "Ponies and Balloons");
      }
  
      public static void download(String url, String fileName) throws MalformedURLException, IOException
      {
          FileUtils.copyURLToFile(new URL(url), new File(fileName + ".mp3"));
      }
  }
  </code></pre>
  
  <p>In a browser, downloading the file manually works flawlessly. A download link from another website e.g. <a href="http://freedownloads.last.fm/download/569264057/Get%2BGot.mp3" rel="nofollow noreferrer">this one</a> had no problems to be processed by the code. What could be the problem here?</p>
  
  <p><a href="https://stackoverflow.com/questions/25630202/couldnt-download-image">Sending a valid user-agent String</a> doesn't work either.</p>