Xientraa/The-Sims-Resource-Downloader

Problems with the tool

Closed this issue · 2 comments

119z commented

Maybe it's because I have 0 knowledge of python apart from running scripts, but I can't seem to get this to work.
When pasting my path file, I get this error in VS Code.
image

When trying to run the tool despite it, I get this:

C:\Users\danie\Documents\Dani\TS4\Programs\The-Sims-Resource-Downloader-0.2.0>python src/main.py
Traceback (most recent call last):
File "C:\Users\danie\Documents\Dani\TS4\Programs\The-Sims-Resource-Downloader-0.2.0\src\main.py", line 2, in
from TSRDownload import TSRDownload
File "C:\Users\danie\Documents\Dani\TS4\Programs\The-Sims-Resource-Downloader-0.2.0\src\TSRDownload.py", line 7, in
CONFIG: CONFIG_DICT = json.load(
^^^^^^^^^^
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Invalid \escape: line 2 column 29 (char 30)

I looked up the VS Code error, and it said I should use forward slashes instead of backslashes, but then I get this:

[INFO] Found valid url in clipboard: https://www.thesimsresource.com/downloads/details/category/sims4-hair-hairstyles-female/title/ye-medieval-isabelle-hairstyle/id/1640584/
Process SpawnPoolWorker-1:
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\pool.py", line 114, in worker
task = get()
^^^^^
File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\queues.py", line 367, in get
return _ForkingPickler.loads(res)
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Can't get attribute 'processTarget' on <module 'mp_main' from 'C:\Users\danie\Documents\Dani\TS4\Programs\The-Sims-Resource-Downloader-0.2.0\src\main.py'>

Any suggestions? I'd love to be able to DL things without waiting 10 miserable seconds, and not being allowed to change my tab.

Regarding your first issue, the way strings are handled backslashes are used to escape the character after it, as an example, if you wanted to use a quotation mark inside a string, but you are already using quotes to encase the string, you can escape the quotation mark:

print("\"Hello There!\"") # Outputs: "Hello There!"

As for the second Issue, I believe I've resolved it, it seems to be an issue with how multiprocessing works on Windows compared to Linux. If you could see if it works for you: https://github.com/Xientraa/The-Sims-Resource-Downloader/tree/windows-multiprocessing-issue

My apologies for the issues, I didn't end up testing the script on Windows before releasing.

119z commented

Just tried out your fix, and it worked! Thanks for your help, I'm excited to use this. I appreciate this tool and the work you put behind it<3