Better pylint invocation
This commit is contained in:
parent
1543baf034
commit
b1f4fd2788
@ -8,4 +8,4 @@ python:
|
|||||||
install:
|
install:
|
||||||
- pip install pylint requests
|
- pip install pylint requests
|
||||||
script:
|
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
|
||||||
|
@ -184,6 +184,9 @@ def get_session(user, passwd, EmptySessionOnly=False, session=None):
|
|||||||
|
|
||||||
def download(name, username = None, password = None, sessionfile = None, \
|
def download(name, username = None, password = None, sessionfile = None, \
|
||||||
ProfilePicOnly = False, DownloadVideos = True, FastUpdate = False, SleepMinMax=[0.25,2]):
|
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)
|
session = load_object(sessionfile)
|
||||||
data = get_json(name, session=session)
|
data = get_json(name, session=session)
|
||||||
if len(data["entry_data"]) == 0:
|
if len(data["entry_data"]) == 0:
|
||||||
@ -211,14 +214,14 @@ def download(name, username = None, password = None, sessionfile = None, \
|
|||||||
if not status:
|
if not status:
|
||||||
raise DownloaderException("aborting due to login error")
|
raise DownloaderException("aborting due to login error")
|
||||||
data = get_json(name, session=session)
|
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) \
|
or len(data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]) == 0) \
|
||||||
and not ProfilePicOnly:
|
and not ProfilePicOnly:
|
||||||
raise DownloaderException("no pics found")
|
raise DownloaderException("no pics found")
|
||||||
totalcount = data["entry_data"]["ProfilePage"][0]["user"]["media"]["count"]
|
totalcount = data["entry_data"]["ProfilePage"][0]["user"]["media"]["count"]
|
||||||
if not ProfilePicOnly:
|
if not ProfilePicOnly:
|
||||||
count = 1
|
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"]:
|
for node in data["entry_data"]["ProfilePage"][0]["user"]["media"]["nodes"]:
|
||||||
log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
|
log("[%3i/%3i] " % (count, totalcount), end="", flush=True)
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user