Make check_id() exceptions Non-fatal
The check_id() step, including the get_username_by_id(), which is used to determine whether a profile's account name has changed since the last download using it's unique id when Instaloader is operating logged-in, is actually optional and should not cause termination in any case.
This commit is contained in:
parent
dc748a0541
commit
a7d1c5bbb0
@ -40,6 +40,9 @@ class NonfatalException(InstaloaderException):
|
||||
class ProfileNotExistsException(NonfatalException):
|
||||
pass
|
||||
|
||||
class ProfileAccessDeniedException(NonfatalException):
|
||||
pass
|
||||
|
||||
class ProfileHasNoPicsException(NonfatalException):
|
||||
pass
|
||||
|
||||
@ -91,8 +94,8 @@ def get_username_by_id(session: requests.Session, profile_id: int) -> str:
|
||||
"you (id: " + str(profile_id) + ").")
|
||||
else:
|
||||
if test_login(session):
|
||||
raise ConnectionException("Username could not be determined due to connection error" +
|
||||
" (id: "+ str(profile_id) +").")
|
||||
raise ProfileAccessDeniedException("Username could not be determined due to error {0} (id: {1})."
|
||||
.format(str(resp.status_code), str(profile_id)))
|
||||
raise LoginRequiredException("Login required to determine username (id: " +
|
||||
str(profile_id) + ").")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user