colinhartigan / valorant-skin-cli

command line interface to manage and randomize VALORANT skins
MIT License
127 stars 22 forks source link

json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1) #8

Closed axsddlr closed 3 years ago

axsddlr commented 3 years ago
Traceback (most recent call last):
  File "main.py", line 6, in <module>
    from src.cli.command_prompt import Prompt
  File "/mnt/e/Programs/gitrepos/valorant-skin-cli/src/cli/command_prompt.py", line 18, in <module>
    from .validator import Command_Validator
  File "/mnt/e/Programs/gitrepos/valorant-skin-cli/src/cli/validator.py", line 4, in <module>
    commands = Completer.generate_completer_dict()
  File "/mnt/e/Programs/gitrepos/valorant-skin-cli/src/cli/completer_generator.py", line 19, in generate_completer_dict
    skin_data = Loader.fetch_skin_data()
  File "/mnt/e/Programs/gitrepos/valorant-skin-cli/src/flair_loader/skin_loader.py", line 217, in fetch_skin_data
    return json.load(f)
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
colinhartigan commented 3 years ago

try the latest commit

axsddlr commented 3 years ago

try the latest commit

works now but selecting skins and such creates this error:

Traceback (most recent call last): File "main.py", line 34, in <module> Onboarder(client) File "E:\Programs\gitrepos\valorant-skin-cli\src\utility\onboarding.py", line 41, in __init__ self.run() File "E:\Programs\gitrepos\valorant-skin-cli\src\utility\onboarding.py", line 57, in run returned = item["method"]() File "E:\Programs\gitrepos\valorant-skin-cli\src\flair_loader\skin_editor.py", line 40, in select_weapon_type Editor.select_weapon(skin_data,type_choice) File "E:\Programs\gitrepos\valorant-skin-cli\src\flair_loader\skin_editor.py", line 59, in select_weapon Editor.select_skin(skin_data,weapon_choice) File "E:\Programs\gitrepos\valorant-skin-cli\src\flair_loader\skin_editor.py", line 91, in select_skin weapon_data['skins'][skin_choice] = Editor.set_skin_preferences(weapon_skin_data) File "E:\Programs\gitrepos\valorant-skin-cli\src\flair_loader\skin_editor.py", line 135, in set_skin_preferences skin_data['levels'][preference.removeprefix('level_')]['enabled'] = True AttributeError: 'str' object has no attribute 'removeprefix'

IIIBlueberry commented 3 years ago

What version of Python did you use? IINC you need Python 3.9.x

colinhartigan commented 3 years ago

removeprefix was introduced with 3.9 (i think), this won't be a problem once the exe is out

axsddlr commented 3 years ago

Funny enough, I downgraded to 3.8 just incase it was a compatibility issue

On Thu, Jul 1, 2021 at 11:38 PM colinh @.***> wrote:

removeprefix was introduced with 3.9, this won't be a problem once the exe is out

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colinhartigan/valorant-skin-cli/issues/8#issuecomment-872688507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO5EM2DUQKNGRVXS52GOILTVUYELANCNFSM47TUWATA .

axsddlr commented 3 years ago

removeprefix was introduced with 3.9 (i think), this won't be a problem once the exe is out

updated to python 3.9, runs but doesnt work in game

image

colinhartigan commented 3 years ago

runs but doesnt work in game

elaborate?

axsddlr commented 3 years ago

runs but doesnt work in game

elaborate?

cli picks up the guns and skins yes, however:

image

colinhartigan commented 3 years ago

run modify and set up which guns you want in the randomizer pool

axsddlr commented 3 years ago

also closing and re-runnning script while game is open is causing Typerror:

File "E:\Programs\gitrepos\valorant-skin-cli\src\flair_loader\skin_loader.py", line 128, in generate_skin_data
    level_already_exists = skin_previously_owned and level["uuid"] in existing_skin_data[weapon_uuid]["skins"][skin_uuid]["levels"]
TypeError: 'NoneType' object is not subscriptable

maybe try/except may bypass this

colinhartigan commented 3 years ago

can you attach your skin_data.json file?

axsddlr commented 3 years ago

can you attach your skin_data.json file?

https://gist.github.com/Rehkloos/f7f4ecc53af8675f068d6721281b3c55

also even running modify, receiving same no skins in pool verbose

colinhartigan commented 3 years ago

looks like none of the skins are actually enabled, make sure you toggle the skin_enabled bool while modifying

https://streamable.com/wzmoid

axsddlr commented 3 years ago

looks like none of the skins are actually enabled, make sure you toggle the skin_enabled bool while modifying

https://streamable.com/wzmoid

seems like youre using a cmd prompt ascii colorizer, maybe also my issue

colinhartigan commented 3 years ago

i was going to recommend you try in a different terminal (windows terminal, some IDE's integrated terminal) if it's still not working

axsddlr commented 3 years ago

vscode terminal it is lol

colinhartigan commented 3 years ago

vscode works!

axsddlr commented 3 years ago

all good to go! just waiting for enable all button lol

axsddlr commented 3 years ago

good work, ill contribute when i can

colinhartigan commented 3 years ago

thank you!