mega.py
mega.py copied to clipboard
Fix MAC computation performance issue; add CLI entrypoint script for quickly downloading files without logging in
Hi, as the subject says, the main modifications in this PR are:
- A performance fix (i.e. fixes high CPU usage) in the MAC computation step for each chunk
- An entrypoint script (meganz) which accepts a mega.nz link, and optionally a destination path, for comfortably downloading links without login (indeed, this was the main feature I needed when I started modifying this code, because it seems the guys of youtube-dl have no intention of adding mega.nz support)
- A progress bar for download, using the tqdm library
- A fix to correctly close and flush buffers of the temporary file used for downloading, before moving it to the destination directory (spurious errors were given on Windows - e.g. file is used by another process - and empty files were created on linux in the destination directory, instead of moving the actual output, in case of few-bytes files)
- Follow redirects (e.g. from URL shortening services) till a mega link is found
Regards
could you add file archive support like youtube-dl?