jdaymude / xbox2local

A command line utility for downloading Xbox screenshots and game clips to local storage
MIT License
8 stars 2 forks source link

json.decoder.JSONDecodeError: Invalid \escape: line 3 column 19 (char 73) #27

Open Aerialflame7125 opened 2 months ago

Aerialflame7125 commented 2 months ago

Description I am trying to download my videos and screenshots taken on my xbox and put them on my pc, because those were first times, happy moments, and more. but keep hitting this error

To Reproduce Steps to reproduce the behavior:

  1. Set up configuration as normal
  2. Run python xbox2local.py --username <My Username>
  3. See "json.decoder.JSONDecodeError: Invalid \escape: line 3 column 19 (char 73)"

Platform Windows-cmd Windows 22631.3447 23H2

jdaymude commented 2 months ago

Hi @Aerialflame7125, thanks for bringing this up. It looks like the response you're getting from the API requests is coming back in a different format than xbox2local expects. Can you copy/paste the entire error message instead of just the last one?

Aerialflame7125 commented 2 months ago

@jdaymude Here is the whole thing

Traceback (most recent call last): File "C:\Users\colin\OneDrive\Desktop\xbox2local-dev\xbox2local.py", line 121, in config = json.load(f_in) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\json\init.py", line 293, in load return loads(fp.read(), File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\json__init.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 3 column 19 (char 73)

LeeTaylor-git commented 2 months ago

I’m having the same issue as well.

jdaymude commented 2 months ago

Oh, that's very odd. That part of the code hasn't changed since the initial release years ago. There seems to be a formatting issue with your users/<user name>/config.json file. Are you both first time users on Windows? I'm wondering if the classic Windows vs. Linux line breaks issue is causing this. I wrote this all on Linux and pushed the example_user/config.json file with \n characters for newlines, whereas Windows expects \r\n.

You may likely fix this issue by creating a new config.json file in a text editor of your choice and then type in the small JSON format yourself (instead of copy/pasting).

LeeTaylor-git commented 2 months ago

Yes, I'm a first time user on Windows. I found the issue. When I copied the path for my media directory into config.json, I copied it like this: "C:\Path\To\Directory." I changed it to this: "C:\Path\To\Directory." Everything works now.

Thank you.

jdaymude commented 2 months ago

@Aerialflame7125 Does the above post also describe your issue? It's true that filepaths on Windows create some ambiguity with backslashes being both escape characters and directory separators, so it's worth being careful about that.