title: In Python, urllib.urlretrieve downloads a file which says "Go away"
body: <p>I'm trying to download the (APK) files from links such as <a href="https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=215041" rel="nofollow noreferrer">https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=215041</a>. When you enter the link in your browser, it brings up a dialog to open or save the file (see below).</p>
  
  <p><a href="https://i.stack.imgur.com/4CfDP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4CfDP.png" alt="enter image description here"></a></p>
  
  <p>I would like to save the file using a Python script. I've tried the following:</p>
  
  <pre><code>import urllib
  
  download_link = 'https://www.apkmirror.com/wp-content/themes/APKMirror/download.php?id=215041'
  download_file = '/tmp/apkmirror_test/youtube.apk'
  
  if __name__ == "__main__":
      urllib.urlretrieve(url=download_link, filename=download_file)
  </code></pre>
  
  <p>but the resulting <code>youtube.apk</code> contains only the words "Go away".</p>
  
  <p>Since I am able to download the file by pasting the link in my browser's address bar, there must be some difference between that and <code>urllib.urlretrieve</code> that makes this not work. Can someone explain this difference and how to eliminate it?</p>