r/pushshift • • Dec 14 '22

I've been getting Response status code 404 since Monday morning. Is this due to the system update? Should I be changing my script someway to access the updated API?

Post image
9 Upvotes

26 comments sorted by

View all comments

Show parent comment

5

u/iruleatants Dec 14 '22

PMAW is struggling to pull results for me still.

It sucks that PSAW is stale because PMAW doesn't include any aggregation by default.

3

u/Security_Chief_Odo Dec 14 '22

Yeah I tried using PMAW, but immediately got an error:

  File "py39_venv/lib/python3.9/site-packages/pmaw/PushshiftAPI.py", line 75, in search_submissions
    return self._search(kind='submission', **kwargs)
  File "py39_venv/lib/python3.9/site-packages/pmaw/PushshiftAPIBase.py", line 251, in _search                                     
    self._multithread(check_total=True)     
  File "py39_venv/lib/python3.9/site-packages/pmaw/PushshiftAPIBase.py", line 86, in _multithread                                 
    with ThreadPoolExecutor(max_workers=self.num_workers) as executor: 
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 143, in __init__      
    if max_workers <= 0:                                              
TypeError: '<=' not supported between instances of 'Reddit' and 'int'

 

If I change out self.num_workers = num_workers in PushShiftAPIBase.py, to self.num_workers = 10 (hard coding it), then that error goes away. But curious as to why it thinks or has assigned the Reddit object to num_workers by default.

 

That and Pushshift still isn't returning proper results for searched on comments or posts, that I KNOW are there and as recently as yesterday, showed up using the same code.

3

u/abelEngineer Dec 14 '22

I'm getting started with PMAW now as well.

You probably did something like this:

api = PushshiftAPI(reddit)

Try this instead, or try leaving out the praw reddit object:

api = PushshiftAPI(praw=reddit)

2

u/Security_Chief_Odo Dec 14 '22

Thanks for the suggestion. I did the second:

reddit = praw.Reddit(<settings here>)

api = PushshiftAPI(reddit, praw=reddit)

3

u/abelEngineer Dec 14 '22

I don't think you need to include reddit twice.

4

u/Security_Chief_Odo Dec 14 '22

Oh, hmm. It didn't complain at me for that :P Weird. I bet that is the error I was hitting with the num_workers int to Reddit object comparison. Thanks.

3

u/abelEngineer Dec 14 '22

I'm still not getting anything out of PMAW. I guess it may be a server issue still.

3

u/Security_Chief_Odo Dec 14 '22

Yeah, I'm getting api 404 issues with psaw, and nothing more than a week or so old , if anything, out of pmaw...

2

u/Undescended_tester Dec 16 '22

yup, I'm getting 0 results with PMAW for a good week or so. I appreciate there's a lot going on with the new data centre, so I've refrained from commenting until that's settled. I'm struggling to keep track as to whether the API itself is stable, even if the data behind it isn't, but I'm tempted to make changes to the PMAW library. Maybe even make a PR on the github repo

1

u/Security_Chief_Odo Dec 16 '22

It's frustrating not being able to search or have some bots not working because of this. On top of the Pushshift API changes at the same time as this cutover; can't be sure what the issue is, just that my searches and bots aren't accurate/working. Not bitching at the author or trying to give them grief though. It's a free service (currently) so I can't really be an entitled prick. I'm just anxiously awaiting the service to be fully operational again.

→ More replies