Even BETTER destination handling
Create dir (recursively) if it doesnt exist
This commit is contained in:
parent
6d46811732
commit
8843604cea
1 changed files with 4 additions and 2 deletions
|
@ -196,10 +196,12 @@ def main(config_path='config.json', seen_path='seen.txt', dry_run=False, no_seen
|
|||
if rpc and not dry_run:
|
||||
destination = item_config.get('destination')
|
||||
if destination:
|
||||
if not destination.startswith('/'):
|
||||
destination = os.path.join(default_download_dir, destination)
|
||||
destination = destination.format(show=show, torrent=torrent)
|
||||
destination = os.path.expanduser(destination)
|
||||
if not destination.startswith('/'):
|
||||
destination = os.path.join(default_download_dir, destination)
|
||||
if not os.path.exists(destination):
|
||||
os.makedirs(destination)
|
||||
t = rpc.add_torrent(best_entry.link, download_dir=destination or default_download_dir)
|
||||
else:
|
||||
printe("No torrents for {show} pass quality restrictions".format(show=show.name))
|
||||
|
|
Loading…
Add table
Reference in a new issue