flytaly / reddit-post-notifier

Firefox/Chrome extension that watches for posts in given subreddits or reddit searches
Mozilla Public License 2.0
20 stars 5 forks source link

Fetch error: JSON.parse: unexpected character at line 1 column 1 of the JSON data #45

Closed cramberries closed 10 months ago

cramberries commented 10 months ago

Hi, not sure if this extension is still being supported but on the off-chance that it is, I would like to report this issue.

I first noticed it a few days ago but not sure when it started exactly. I saw a similar thread here that said it's a Reddit issue and that after they waited a day or so, it fixed itself so that's what I did. But that didn't seem to work this time or perhaps I needed to wait a little longer?

Either way, I just thought of reporting it here just in case. Thank you.

Windows 10 64-bit Firefox 120.0.1 Reddit Post Notifier v. 5.1.1

flytaly commented 10 months ago

v.5.1.1

There is a newer version 6, but I didn't upload it to Firefox because it didn't fully support Manifest V3 at the time. I will try to update it then.

About the issue. Can you see JSON endpoints in your browser? Just add .json at the end. For example, if you watch for new posts in r/pics, JSON path would be https://www.reddit.com/r/pics/new.json The extension uses them to fetch new posts. The result should start with something like {"kind": "Listing", "data":

If they work, then try to log out (if you are logged in) from your account and fetch again

image

Also try to check posts once with fetch posts button

image

cramberries commented 10 months ago

@flytaly Hello. Thank you for the quick response!

Can you see JSON endpoints in your browser?

Yes, I can view a JSON "link" in the browser. And after switching to the Raw Data tab, it does show {"kind": "Listing", "data": ... in the first line.

If they work, then try to log out (if you are logged in) from your account and fetch again

I don't have any authorised accounts since I primarily use the extension just to check new posts in certain subreddits but I've tried the fetch buttons as well as the update button on the toolbar dropdown, the error icons still persist.

Also try to check posts once with fetch posts button

Just the "No items" text box shows up after pressing the "fetch posts" button:

image

flytaly commented 10 months ago

The latest version is now available in Firefox. Is this still happening after the update?

cramberries commented 10 months ago

@flytaly Wow, thank you for the quick update!

For some reason, it wouldn't auto-update and I had to reinstall the extension again. After I did and set it up similar to my previous installation, it's now giving back a 403 error whenever I try to fetch posts. Not sure what's causing it but I did allow it permission to access reddit.com.

flytaly commented 10 months ago

403 error can happen when you try to access private subreddits like r/lounge or r/CenturyClub.

image

cramberries commented 10 months ago

@flytaly I only have open subreddits on the list and every single one returns a 403.

But I tried playing around and figured what's causing it, my VPN connection. So, I guess this is an isolated case and I will be closing this thread (though not sure if the VPN was causing the initial issue). I'm sorry for the bother. 😅

But if you don't mind me asking, do you have any idea why the extension suddenly stopped working with a VPN connection? I'm using a VPN with proper software and not just a browser extension if that matters. I never had this problem with Reddit Post Notifier before and everything else in the browser still works as intended.

flytaly commented 10 months ago

Your VPN is probably banned or/and ratelimited. Recently there was relevant discussion about RSS feeds (you can access them the same way as JSON r/aww/new.rss)

r/redditdev: 403 when accessing RSS feeds

In the new version (v6) of the extension, the settings page in the bottom left corner shows ratelimits (only works during updates).

image

cramberries commented 10 months ago

@flytaly Looks like that was it, had to go through a couple countries but it seems to be working again. Thank you so much and sorry for any trouble!