TobiasPankner / Gleam-giveaway-bot

Python bot to automatically find and complete gleam giveaways.
GNU General Public License v3.0
91 stars 45 forks source link

JSON decode error #22

Closed eliris closed 3 years ago

eliris commented 3 years ago

The bot worked for a while until last night where it gave me the following:

{ Traceback (most recent call last): File "C:\Dev\Python\gleambot\Gleam-giveaway-bot\giveaway_bot.py", line 125, in main() File "C:\Dev\Python\gleambot\Gleam-giveaway-bot\giveaway_bot.py", line 8, in main giveaway.load_json() File "C:\Dev\Python\gleambot\Gleam-giveaway-bot\src\giveaway.py", line 26, in load_json config = json.load(json_data_file) File "C:\Python39\lib\json__init.py", line 293, in load return loads(fp.read(), File "C:\Python39\lib\json\init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python39\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

} I have tried parsing the JSON online and formatting it using an online formatting tool but the problem still persists. I will try to fiddle around with the code and see if I can find an answer.

TobiasPankner commented 3 years ago

Somewhere the quotes are missing

eliris commented 3 years ago

Here is my current JSON file (API keys omitted):

{ "do_playrgg_giveaways": false, "user-data-dir": "C:/Users/Zasti/AppData/Local/Google/Chrome/User Data/", "profile-directory": "C:Users/Zasti/AppData/Local/Google/Chrome/User Data/Profile 3", "twitter_auth": { "consumer_key": "", "consumer_secret": "", "access_token": "", "access_token_secret": "" }, "gleam": { "birth_day": "", "birth_month": "", "birth_year": "", "accept_terms_and_services": true } }

I suspected that the booleans (true/false) needed to be double quoted for some reason but it wasn't the case

TobiasPankner commented 3 years ago

That looks good, and it has been working before? If yes, have you changed anything since?

eliris commented 3 years ago

It has been working before and nothing has changed since, which is the weird part.

eliris commented 3 years ago

Update: I ran it again and randomly it started working again.