def handle_sonarr(torrent):
for index, file in torrent.files().items():
file_path = os.path.join(torrent.downloadDir, file['name'])
if file_path.endswith('rar'):
with tempfile.TemporaryDirectory() as temp_dir:
paths = extract(file_path, temp_dir)
if paths:
# Move extracted files to sonarr drone factory
for path in paths:
shutil.chown(path, group=plex_group)
os.chmod(path, 0o664)
shutil.move(path, drone_factory)
评论列表
文章目录