eoleedi / TimeTree-Exporter

A Tool for Exporting TimeTree Calendar to iCal / 將 TimeTree 日曆匯出成 iCal 格式
MIT License
21 stars 4 forks source link

JSONDecodeError #36

Open mariushun opened 3 weeks ago

mariushun commented 3 weeks ago

Hi all,

I tried to export my TimeTree calendar via timetree-exporter. So I downloaded it on my MacBook Pro via pip3 and created the .json files out of the "sync" answers via dev tools in Microsoft Edge.

Now, when I tree to run the timetree-exporter tool, it tells me the following error: xxx@xxx bin % ./timetree-exporter /Users/xxx/Desktop/response1.json 2024-06-12 10:00:24 [INFO] Parsing /Users/xxx/Desktop/response1.json Traceback (most recent call last): File "/Users/xxx/Library/Python/3.9/bin/./timetree-exporter", line 8, in sys.exit(main()) File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/timetree_exporter/main.py", line 63, in main events = get_events_from_file(filename) File "/Users/xxx/Library/Python/3.9/lib/python/site-packages/timetree_exporter/utils.py", line 16, in get_events_from_file response_data = json.load(response_file) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/init.py", line 293, in load return loads(fp.read(), File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/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 checked my json file and tried to add double quotes to the value in line 1 column 2, not working. What else can I do?

Thanks in advance! Marius

eoleedi commented 3 weeks ago

I suppose that you didn't copy the correct response(Perhaps copied in another format). Does the content of the JSON file look like the following format(After Prettyifier)?

{
    "since": null,
    "chunk": null,
    "events": [
        {
            "id": null,
            "primary_id": null,
            "calendar_id": null,
            "uuid": null,
            "category": null,
            "type": null,
            "author_id": null,
            "author_type": null,
            "title": null,
            "all_day": null,
            "start_at": null,
            "start_timezone": null,
            "end_at": null,
            "end_timezone": null,
            "label_id": null,
            "location": null,
            "location_lat": null,
            "location_lon": null,
            "url": null,
            "note": null,
            "lunar": null,
            "attendees": [],
            "recurrences": [],
            "recurring_uuid": null,
            "alerts": [],
            "parent_id": null,
            "link_object_id": null,
            "link_object_id_string": null,
            "row_order": null,
            "attachment": {},
            "like_count": null,
            "files": [],
            "deactivated_at": null,
            "pinned_at": null,
            "updated_at": null,
            "created_at": null
        },
        ... more events
    ]
}