How to use the pyexpander.extract.extract_all function in pyexpander

To help you get started, we’ve selected a few pyexpander examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github omerbenamram / py-expander / src / pyexpander / torrent_handler.py View on Github external
def expand_torrent(torrent_path):
    logger.info('Processing torrent %s' % torrent_path)
    torrent_path = os.path.abspath(torrent_path)

    if os.path.isdir(torrent_path):
        torrent_path = os.path.join(torrent_path, '')
        extract_all(torrent_path)
        process_folder(torrent_path)
        cleanup_temp(torrent_path)
    else:
        process_file(shutil.move, os.path.splitext(os.path.basename(torrent_path))[0], torrent_path)

    logger.info('Done')