tuxity / insta-unfollower

An Instagram script to unfollow accounts who doesn't follow-you-back
MIT License
381 stars 89 forks source link

AttributeError: 'dict' object has no attribute 'text' #65

Closed narzero closed 2 years ago

narzero commented 2 years ago

I just ran this with Docker via

docker pull tuxity/insta-unfollower:latest
docker run -d -v $(pwd)/cache:/usr/src/insta-unfollower/cache --env INSTA_USERNAME=myusername --env INSTA_PASSWORD=mypassword tuxity/insta-unfollower:latest

First run - after 3 successful unfollows I get this error:

Error while trying to unfollow XYZ. Retrying in a bit...
Traceback (most recent call last):
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 289, in <module>
    main()
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 280, in main
    while unfollow(user) == False:
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 199, in unfollow
    print('ERROR: {}'.format(response.text))
AttributeError: 'dict' object has no attribute 'text'

And the container stops.

Second run - a different error (#64 & #49) when trying to unfollow the same user as before:

Unfollowing XYZ...
Traceback (most recent call last):
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 289, in <module>
    main()
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 280, in main
    while unfollow(user) == False:
  File "/usr/src/insta-unfollower/insta-unfollower.py", line 195, in unfollow
    response = json.loads(response.text)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days