nickpettican / InstaBot

:robot: Automate your Instagram activity with InstaBot, a customisable bot that likes, follows and comments
Apache License 2.0
224 stars 51 forks source link

Problem parsing profile.json #18

Closed newsum closed 7 years ago

newsum commented 7 years ago

When I run python run.py I get the following error:

[ 2017-10-21 04:52:57 ] Trying to sign in as [username]... successfully signed in! Traceback (most recent call last): File "run.py", line 45, in main() File "run.py", line 41, in main instabot = InstaBot(profile, data = data) File "/root/InstaBot/src/instabot.py", line 135, in init self.init_profile() File "/root/InstaBot/src/instabot.py", line 209, in init_profile self.profile.import_profile(check_user(self.pull, self.insta_urls['user'], self.params['username'])) File "/root/InstaBot/src/instaprofile.py", line 55, in import_profile self.profile = json.load(data_file) File "/usr/lib/python2.7/json/init.py", line 291, in load **kw) File "/usr/lib/python2.7/json/init.py", line 339, in loads return _default_decoder.decode(s) File "/usr/lib/python2.7/json/decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

Any ideas? Seems like it is unable to load my Instagram profile.

Server: Digital Ocean Ubuntu 16

nickpettican commented 7 years ago

Hi @newsum, yes it's unable to load the object for some reason - did you open it and tamper with it in any way? Have a look at issue #2, there's some code there to test the JSON file. Try to get the profile object to open properly, otherwise you'll have to delete it and Instabot will make you a clean one.

newsum commented 7 years ago

thanks. Had to remove the empty profile.json file.