title: Problem downloading MEGA files with python
body: <p>I am trying to download a file from my MEGA account using the following code from the <code>mega.py</code> library of Python:</p>
  <pre><code>from mega import Mega
  
  mega = Mega()
  m = mega.login('example@example.com', 'example')
  file = m.find('example.txt')
  m.download(file, 'D:\\Desktop')
  </code></pre>
  <p>However, it is always returning:</p>
  <pre><code> Traceback (most recent call last):
  
    File &quot;D:\Programas\aNaconda\lib\shutil.py&quot;, line 788, in move
      os.rename(src, real_dst)
  
  PermissionError: [WinError 32] The file is already being used by another process: 'C:\\Users\\vrida\\AppData\\Local\\Temp\\megapy_xdste432' -&gt; 'example.txt'
  
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  
    File &quot;&lt;ipython-input-26-c3f75106fafb&gt;&quot;, line 1, in &lt;module&gt;
      m.download(file)
  
    File &quot;D:\Programas\aNaconda\lib\site-packages\mega\mega.py&quot;, line 564, in download
      return self._download_file(file_handle=None,
  
    File &quot;D:\Programas\aNaconda\lib\site-packages\mega\mega.py&quot;, line 745, in _download_file
      shutil.move(temp_output_file.name, output_path)
  
    File &quot;D:\Programas\aNaconda\lib\shutil.py&quot;, line 803, in move
      os.unlink(src)
  
  PermissionError: [WinError 32] The file is already being used by another process: 'C:\\Users\\vrida\\AppData\\Local\\Temp\\megapy_example' 
  </code></pre>
  <p>Actually when I enter in the folder (<em>C:\Users\vrida\AppData\Local\Temp</em>) I find a temporary file like the one I'm wanting to download but named <em>megapy_example</em>.</p>
  <p>I saw that the following site has a discussion to solve the problem:</p>
  <p><a href="https://www.reddit.com/r/learnpython/comments/mw6is2/download_file_from_mega_using_megapy/" rel="nofollow noreferrer">https://www.reddit.com/r/learnpython/comments/mw6is2/download_file_from_mega_using_megapy/</a></p>
  <p>asking to add the following lines to the code:</p>
  <pre><code>try:
        m.download(file, 'D:\\Desktop')
  except PermissionError:
        continue
  </code></pre>
  <p>In my case, the <em>continue</em> command wasn't working so I simply put in the <em>pass</em> command. The code runs, but I don't know if the file is really saved or not.</p>
  <p>Could someone please help me? I really need to download the files and save them.</p>
  <p>If it doesn't work through the <code>mega.py</code> library, you guys would somehow know how to download from the public link like this by Python:
  <a href="http://%20https://mega.co.nz/#!cSZCELDb!5O57KMVMIgrPiH5fnaefWeNPDqoDWzGbY-sZkdTUdNk" rel="nofollow noreferrer">https://mega.co.nz/#!cSZCELDb!5O57KMVMIgrPiH5fnaefWeNPDqoDWzGbY-sZkdTUdNk</a></p>