Skip to content

feat(reddit): robust JSON extraction, gallery support, and RSS fallback - #296

Closed
deadrat-in wants to merge 1 commit into
you-apps:mainfrom
deadrat-in:feat/reddit-robust-extractor
Closed

feat(reddit): robust JSON extraction, gallery support, and RSS fallback#296
deadrat-in wants to merge 1 commit into
you-apps:mainfrom
deadrat-in:feat/reddit-robust-extractor

Conversation

@deadrat-in

Copy link
Copy Markdown

Summary of Changes

  • Primary JSON Extraction: Uses Reddit's JSON listing endpoint (/r/{sub}/{sort}.json?raw_json=1) to retrieve full-resolution image assets and post metadata.
  • Reddit Gallery Support: Parses media_metadata and gallery_data to unpack multi-image gallery posts into individual wallpapers.
  • XML Entity Cleanup: Automatically unescapes preview URLs (& -> &) and extracts image dimensions (width x height) when available.
  • Stable Pagination: Uses Reddit's cursor token (data.after) for consistent multi-page browsing.
  • RSS Fallback: Automatically falls back to an enhanced RSS parser if unauthenticated JSON requests are throttled (HTTP 403 / 429).
  • Session Provider Hook: Adds a cookieProvider lambda hook to RedditApi so callers can provide session cookies if desired.
  • Testing: Added JUnit test suite RedditApiTest to verify JSON parsing and gallery extraction.

Verification

All unit tests in :wallpaper-apis:test pass successfully.

…RSS fallback

- Add Reddit JSON API endpoint support with automatic RSS fallback
- Support multi-image gallery posts parsing from media_metadata
- Extract original resolution and clean unescaped XML preview links
- Provide cookieProvider hook for optional session management
- Add unit tests for Reddit API response deserialization and gallery parsing
@Bnyro

Bnyro commented Sep 6, 2026

Copy link
Copy Markdown
Member

This project does not allow AI contributions.

@Bnyro Bnyro closed this Sep 6, 2026
@deadrat-in

Copy link
Copy Markdown
Author

Alright. I am trying to do it without any ai. thanks.

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

Successfully merging this pull request may close these issues.

2 participants