Comments (11)
This issue has been brought to the attention of the platform team at Reddit where it would seem there was a recent code change impacting this old endpoint. No ETA on resolution at the moment.
from praw.
So here's a summary of my findings: (TL;DR Reddit broke something in their /api/morecomments
endpoint and there isn't much we can do about it at the moment)
When you call replace_more
PRAW will start replacing all MoreComments
instances with its children comments. These can be either Comment
or MoreComments
instances. In posts with a bunch of comments (1k+ comments), the last comment will basically be the overflow of the rest of the comments (which is a MoreComments
instance itself). This last instance of MoreComments
can have thousands of children comments. Normally, this isn't an issue because you will just need to request the comments for that instance with the /api/morecomments
endpoint and you'll get back more comments (which can be a mixture of Comment
and MoreComment
instances) and the last one will be another large MoreComments
instance. This continues until all the instances are replaced or the limit
(the number of MoreComments
it will replace, by default this is 32) in the replace_more
is reached. Side note, the reason why many people are seeing this is because PRAW starts with the biggest MoreComments
first.
Now here is where it falls apart, the first time PRAW takes this last MoreComments
and hits the /api/morecomments
endpoint to fill those in. It gets the expected comments back, however, the last child of that response is another MoreComments
instance (notice the count of 17524) that is corrupted/incomplete:
{
"json": {
"data": {
"things": [
...,
{
"data": {
"children": [],
"count": 17524,
"depth": 0,
"id": "s",
"name": "t1_s",
"parent_id": "t3_2nbslo"
},
"kind": "more"
}
]
},
"errors": []
}
}
The assertion that everyone is seeing is there to make sure there is children to actually fetch. And with this incomplete MoreComments
instance, this will prevent PRAW from fetching the majority of the comments (basically PRAW can get the first and second page of comments you can see on the site).
We have a few solutions to this:
- Remove the assertion
- this will result in an error later on because PRAW tries to fetch an empty set of comments and it isn't written to handle that
- Remove the bad
MoreComments
instance- This will cause the
replace_more
to only replace a small subset ofMoreComments
.
- This will cause the
Both of these solutions are not good and our best bet is that Reddit will fix this bug, and soon. I suspect Reddit has made a change without considering the public API because the website seems unaffected by this and there appears to be different format (c1:t1_c60n8gi,t1_xxxxx,t1_xxxxx,
) that Reddit is requesting from the /api/morecomments
endpoint.
It seems @bboe beat me to the punch on my comment but it just confirms my findings.
from praw.
This appears to be fixed in my testing earlier today. Though, I couldn't test fully to 100% confirm it is fixed.
from praw.
I'm also having this issue, and "This code has previously worked as intended": Yes
from praw.
I'm also having this issue, it works for submissions with small number of comments, but fails with larger ones (~1400 comments) which have previously worked with no errors.
from praw.
Similarly, it is impossible to get comments, this error constantly appears. Is there any workaround?
from praw.
Literally just started digging into this like 4 minutes ago lol. I report back with my findings.
from praw.
Long story short: there is a point in the building of the forrest that PRAW gets invalid/corrupted data from Reddit.
I'll investigate if this is in response to PRAW sending invalid/corrupted data to Reddit.
from praw.
This is a new bug with Reddit. Reddit is returning a response that has the last child's ID truncated to 1 character. @bboe would you mind taking a look?
from praw.
In case you receive some update on the ETA, can you inform the thread. I'd be good to know, in case this is long term.
from praw.
We certainly will!
from praw.
Related Issues (20)
- Check Subreddit Supported Post Types HOT 4
- Support for new reddit share link HOT 7
- Throw rate limit exception when wait time is greater than X seconds HOT 16
- Missing scope "modnote" in Reddit OAuth2 Scopes documentation HOT 4
- 404 for submission.mod.undistinguish() HOT 2
- How to check if post contains video HOT 3
- Praw submit_image/submit_video with websockets failing as of 3:06 pm Central on Sep. 29, 2023 HOT 27
- subreddit.hot() has no time_filter option HOT 1
- `reddit.subreddits.popular()` yields `Iterator[Unknown]`
- Title-only submissions HOT 2
- AttributeError: '_NotSet' object has no attribute 'lower' HOT 5
- Adding date filter HOT 3
- Installing praw from source or sdist fails due to importing runtime deps at build time HOT 6
- Get submission view count HOT 1
- SubredditHelper.__call__() got an unexpected keyword argument 'other_subreddits' HOT 4
- Comment not iterable HOT 3
- Subreddit post_requirements() returns 404 HOT 2
- Get posts in different languages HOT 1
- Add ability to instantiate praw with access_token HOT 12
- Profile pages match `submission.id_from_url` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from praw.