From 5036cc7b44fbd867efcb04c433ffe16aa064dfba Mon Sep 17 00:00:00 2001
From: Alexander Graf <mail@agraf.me>
Date: Sun, 29 Apr 2018 11:22:56 +0200
Subject: [PATCH] main: Ignore profile JSON files as target

It might annoy or be undesired when using Instaloader with a globbed
JSON file list, i.e. instaloader profile/*.json to just update all post
metadata.
---
 instaloader/__main__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/instaloader/__main__.py b/instaloader/__main__.py
index 8d90af8..911f255 100644
--- a/instaloader/__main__.py
+++ b/instaloader/__main__.py
@@ -109,8 +109,8 @@ def _main(instaloader: Instaloader, targetlist: List[str],
                         instaloader.context.log("Attempting to download {} ({})".format(structure, target))
                         instaloader.download_storyitem(structure, os.path.dirname(target))
                     elif isinstance(structure, Profile):
-                        instaloader.context.log("Going to download {} ({})".format(structure.username, target))
-                        profiles.add(structure.username)
+                        raise InvalidArgumentException("Profile JSON are ignored. Pass \"{}\" to download that profile"
+                                                       .format(structure.username))
                     else:
                         raise InvalidArgumentException("{} JSON file not supported as target"
                                                        .format(structure.__class__.__name__))