mattbdean/JRAW

Always getting 403 Forbidden when using DefaultPaginator

Opened this issue · 1 comments

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

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.