HoloArchivists / twspace-dl

A python module to download twitter spaces.
GNU General Public License v2.0
473 stars 78 forks source link

`--keep-files` doesn't actually work #71

Closed fireattack closed 2 years ago

fireattack commented 2 years ago

Describe the bug --keep-files flag doesn't work, at least not in a way I expected (there is no description; but I assume it means to keep all the temp files).

From the code:

        finally:
            if not args.keep_files and os.path.exists(twspace_dl.tempdir.name):
                twspace_dl.tempdir.cleanup()

It is supposed to only cleanup() if not args.keep_files, but twspace_dl.tempdir is going to automatically clean itself either way due to the nature of how TemporaryDirectory works.

To Reproduce python -m twspace_dl -U XXX --keep-files

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Ryu1845 commented 2 years ago

Ah yes I should use mkdtemp probably