darkdragn / party

A quick *.party downloader
84 stars 12 forks source link

Error Encountered When Using 'party' Command on macOS #37

Open mitchellchris1 opened 3 months ago

mitchellchris1 commented 3 months ago

Issue Description: I am encountering an error message when using the 'party' command on macOS, specifically when trying commands like 'party coomer patreon', 'party coomer kemono', and even 'party update'. The error message appears as follows:

---

User found: SelfImprovementCourse; parsing posts...https://coomer.su/api/v1/patreon/user/SelfImprovementCourse?o=0&limit=50 https://coomer.su/api/v1/patreon/user/SelfImprovementCourse?o=0&limit=50 Traceback (most recent call last):

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/init.py", line 514, in loads return _default_decoder.decode(s)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/decoder.py", line 386, in decode obj, end = self.raw_decode(s)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/decoder.py", line 416, in raw_decode return self.scan_once(s, idx=_w(s, idx).end())

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/[username]/Library/Python/3.9/bin/party", line 8, in sys.exit(APP())

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/cli.py", line 441, in update pull_user(

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/cli.py", line 155, in pull_user posts = list(user.limit_posts(limit))

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/user.py", line 99, in generate_posts raise e

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/user.py", line 93, in generate_posts posts = resp.json()

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

---

or sometimes i get this error other message:

---

User found: SelfImprovementCourse; parsing posts...https://coomer.su/api/v1/patreon/user/SelfImprovementCourse?o=0&limit=50 https://coomer.su/api/v1/patreon/user/SelfImprovementCourse?o=0&limit=50 Traceback (most recent call last):

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/init.py", line 514, in loads return _default_decoder.decode(s)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/decoder.py", line 386, in decode obj, end = self.raw_decode(s)

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/simplejson/decoder.py", line 416, in raw_decode return self.scan_once(s, idx=_w(s, idx).end())

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/Users/[username]/Library/Python/3.9/bin/party", line 8, in sys.exit(APP())

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/cli.py", line 441, in update pull_user(

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/cli.py", line 155, in pull_user posts = list(user.limit_posts(limit))

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/user.py", line 99, in generate_posts raise e

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/party/user.py", line 93, in generate_posts posts = resp.json()

File "/Users/[username]/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

---

Steps to Reproduce:

  1. Open terminal on macOS.
  2. Execute the command 'party coomer patreon'.
  3. Observe the error message.

Expected Behavior: I expect the 'party' command to execute successfully without encountering JSON decoding errors.

Environment:

  1. Operating System: macOS
  2. Python Version: Python 3.9.6
  3. Command Used: 'party coomer patreon [username]', 'party coomer kemono [username]', 'party update [username]'

Additional Information:

Any assistance or guidance on resolving this issue would be greatly appreciated.

Thank you.

darkdragn commented 3 months ago

Thanks for the report! I noticed some schemas changes last evening that were pretty badly breaking serialization. I'm implementing the changes from my home copy this evening. I'll shoot another message when the new version is up, and you can let me know if it resolved this issue too.

If not I'll try looking into it closer, but I don't have a macos system to test on so I might ask a buddy with a Mac to help me out there.

darkdragn commented 3 months ago

Also, looking at the traceback makes it seem like the site is returning non json data. I took a closer look at your output and saw the targeted user. I'll see what I can do about checking the response and getting a handle on why it's not returning json for you.

mitchellchris1 commented 3 months ago

Also, looking at the traceback makes it seem like the site is returning non json data. I took a closer look at your output and saw the targeted user. I'll see what I can do about checking the response and getting a handle on why it's not returning json for you.

Thank you for looking into the issue! I appreciate your efforts in addressing the schema changes and working on implementing the necessary updates. I will definitely check out the new version once it's up and let you know if the issue is resolved. I understand that testing on macOS can be a bit tricky without access to the system :/

Regarding the non-JSON data response, I'll be curious to see how that aspect unfolds. Please keep me updated, and I'm here to provide any additional information or testing feedback you may need.

Thanks again for your attention to this matter.

Edit - I misclicked and closed this issue, my bad. Hopefully this comment will reopen it back up as the issue is still persisting

darkdragn commented 3 months ago

Hey, I just got around to looking at it and was able to pull both of the users you listed. Which is perplexing. The traceback doesn't match the other issues 0.7.4 should have fixed so I want to look into it more.

Could you post the .party-debug.log from your run directory?

And if that doesn't help me much, I'll make a different branch for you to test with that will give me the requests output and dial up debugging to really pin down the issue.

I'll be waiting for the log or your response. Sorry if this is a headache, man.