Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')