tensojka / instastories-backup

Backup your friends' Instagram Stories forever and get to keep them even after 24 hours.
MIT License
85 stars 20 forks source link

JSONDecodeError: Expecting ',' delimiter: line 9 column 65 (char 229) #1

Closed verafide closed 6 years ago

verafide commented 7 years ago
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    prefs = json.load(json_data)
  File "/usr/lib/python3.5/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 9 column 65 (char 229)

I've added the cookie and IDs of a couple users but am just presented with what you see above. Perhaps Instagram has made changes to stories that's broken the script?

tensojka commented 7 years ago

Judging from what I can see from the stack trace, there is a problem with parsing prefs.json.

When you list objects in JSON, you have to put a comma in between objects, but not after the last: "ids": { "25025320": "instagram", "150514": "pketron" },

Are you sure that you put a comma after every pair except the last?

If you keep getting the error, please post your prefs.json.

verafide commented 7 years ago

@hoschiCZ I've found my problem! My cookie contained this s_network=""; Between the quotes is apparently where the error was expecting , I removed that part entirely and it ran perfectly from what I can tell.

verafide commented 7 years ago

@hoschiCZ Thanks for your work on this script so far. Instagram has made some changes which seem to have broken it. As far as you know is it still functional or is this just a problem on my end again? I can post the very long error if necessary.

tensojka commented 7 years ago

Still works for me. Post the error, please.

hopkinskong commented 6 years ago

@verafide Try not to remove that part, but escaping the required data. For example, if the cookie string contains ", replace with \".

tensojka commented 6 years ago

@verafide Have you resolved the problem? If you haven't yet and the error is different from the "json.decoder.JSONDecodeError" you posted earlier, please open a new issue.

tensojka commented 6 years ago

The error was probably https://github.com/hoschiCZ/instastories-backup/issues/2 , now suddenly I am able to reproduce too.

tensojka commented 6 years ago

See #2 for fix of your latter problem.

Darren-Li commented 6 years ago

if the string is stored in an object, how to debug this?

tensojka commented 6 years ago

@Darren-Li Could you elaborate?

nikdev007 commented 5 years ago

i am also getting same error . Below is the Dictionary that i am trying b'{\n "emp_id":"3",\n\t"Name":"Hari",\n\t"Age""26,\n\t"Location":["USA"]\n}'

but i am getting error Expecting ':' delimiter:

avazula commented 5 years ago

@nikdev007 I believe there's a ":" missing between "Age" and 26