diff --git a/.travis.yml b/.travis.yml index ce0c1d6..1713272 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,4 @@ python: install: - pip install pylint requests script: - - python3 -m pylint -r n -d bad-whitespace,bad-continuation,missing-docstring,anomalous-backslash-in-string,invalid-name,multiple-imports,dangerous-default-value --max-args=8 --max-locals=16 --max-branches=20 --max-nested-blocks=6 instagram + - python3 -m pylint -r n -d bad-whitespace,bad-continuation,missing-docstring,anomalous-backslash-in-string,invalid-name,multiple-imports,dangerous-default-value,locally-disabled instagram diff --git a/instagram.py b/instagram.py index b2fc615..ad33c25 100755 --- a/instagram.py +++ b/instagram.py @@ -184,6 +184,9 @@ def get_session(user, passwd, EmptySessionOnly=False, session=None): def download(name, username = None, password = None, sessionfile = None, \ ProfilePicOnly = False, DownloadVideos = True, FastUpdate = False, SleepMinMax=[0.25,2]): + # pylint:disable=too-many-arguments,too-many-locals,too-many-nested-blocks,too-many-branches + # We are aware that this function has many arguments, many local variables, many nested blocks + # and many branches. But we don't care. session = load_object(sessionfile) data = get_json(name, session=session) if len(data["entry_data"]) == 0: @@ -211,14 +214,14 @@ def download(name, username = None, password = None, sessionfile = None, \ if not status: raise DownloaderException("aborting due to login error") data = get_json(name, session=session) - if (not "nodes" in data["entry_data"]["ProfilePage"][0]["user"]["media"] \ + if ("nodes" not in data["entry_data"]["ProfilePage"][0]["user"]["media"] \ or len(data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]) == 0) \ and not ProfilePicOnly: raise DownloaderException("no pics found") totalcount = data["entry_data"]["ProfilePage"][0]["user"]["media"]["count"] if not ProfilePicOnly: count = 1 - while not get_last_id(data) is None: + while get_last_id(data) is not None: for node in data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]: log("[%3i/%3i] " % (count, totalcount), end="", flush=True) count = count + 1