Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always getting 403 Forbidden when using DefaultPaginator #296

Open
Retopia opened this issue Aug 24, 2019 · 1 comment
Open

Always getting 403 Forbidden when using DefaultPaginator #296

Retopia opened this issue Aug 24, 2019 · 1 comment

Comments

@Retopia
Copy link

Retopia commented Aug 24, 2019

I used the code from the github website of JRAW, the login information for credentials is correct as well.
`UserAgent userAgent = new UserAgent("bot", "megabigsad.megabigsad.Megabigsad", "v0.1",
"megabigsadd");

    // Create our credentials
    Credentials credentials = Credentials.script("username", "password",
            "id", "id");

    NetworkAdapter adapter = new OkHttpNetworkAdapter(userAgent);

    RedditClient reddit = OAuthHelper.automatic(adapter, credentials);

    DefaultPaginator<Submission> paginator = reddit.frontPage()
            .limit(50) // 50 posts per page
            .sorting(SubredditSort.TOP) // top posts
            .timePeriod(TimePeriod.ALL) // of all time
            .build();

    Listing<Submission> top50MostPopular = paginator.next();

    System.out.println(top50MostPopular.get(0).getAuthor());`

This is the response I get 200 application/json: '{"kind": "Listing", "data": {"modhash": null, "dist": 50, "children": [{"kind": "t3", "data": {"approved_at_utc": null, "subreddit": "movies", "selftext": "", "autho(...) serventofgaben

@Artraxon
Copy link

having the same/similar problem with my bot https://github.com/Artraxon/unexBot. I sometimes get a 403 Forbidden, but sometimes not. I can't pinpoint exactly under which conditions it happens and when not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants