title: How can I add a header to urllib.request.urlretrieve keeping my variables?
body: <p>I'm trying to download a file from a website but it looks like it is detecting urllib and doesn't allow it to download (I'm getting the error "urllib.error.HTTPError: HTTP Error 403: Forbidden").</p>
  
  <p>How can I fix this? I found on the internet that I had to add a header but the answers weren't going the way I need (It was using Request and I didn't find anything about an argument to add in urllib.request.urlretrieve() for a header)</p>
  
  <p>I'm using Python 3.6</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import urllib.request
  filelink = 'https://randomwebsite.com/changelog.txt'
  filename = filelink.rsplit('/', 1)
  filename = str(filename[1])
  urllib.request.urlretrieve(filelink, filename)
  </code></pre>
  
  <p>I want to include a header to give me the permission to download the file but I need to keep a line like the last one, using the two variables (one for the link of the file and one for the name that depends of the link).</p>
  
  <p>Thanks already for your help !</p>