Skip to content

Conversation

@NohamR
Copy link
Contributor

@NohamR NohamR commented Nov 4, 2025

Replaces the dynamic extraction of the JWT token from the page meta tag with a hardcoded token, as the previous method stopped working. The token is sourced from Apple's own JavaScript and is valid until January 26, 2026.

Replaces the dynamic extraction of the JWT token from the page meta tag with a hardcoded token, as the previous method stopped working. The token is sourced from Apple's own JavaScript and is valid until January 26, 2026.
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Pull request artifacts

Bridge Context Status
AppleAppStore 1 untitled (current) Bridge returned error 0! (20408)
Type: Exception
Message: JWT token not found in page content
AppleAppStore 1 untitled (pr) ✔️

last change: Sunday 2025-11-16 13:59:24

Removed the getJWTToken() method and inlined the hardcoded JWT token directly into getAppData(). Updated HTTP headers for API requests to better mimic browser behavior and improve compatibility.
Replaced the hardcoded JWT token and its reference to the latest version from Apple's JavaScript source.
@Mynacol
Copy link
Contributor

Mynacol commented Nov 16, 2025

Without knowing the technical details here, I dislike hardcoding a credential like that. Is there a reasonable way to extract constantly fresh JWT tokens from another Apple page? How is the app store webpage doing it?
I appreciate you fixing the bridge anyhow.

@dvikan dvikan merged commit 9e2727d into RSS-Bridge:master Nov 16, 2025
13 checks passed
@NohamR
Copy link
Contributor Author

NohamR commented Nov 17, 2025

You’re absolutely right, hardcoding a credential like this isn’t ideal, and I dislike it too. The problem is that this JWT isn’t issued dynamically: Apple actually embeds it directly in the JavaScript bundle of the App Store webpage, as a constant:

const TQ = "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlU4UlRZVjVaRFMifQ.eyJpc3MiOiI3TktaMlZQNDhaIiwiaWF0IjoxNzYyOTkwMTA3LCJleHAiOjE3NzAyNDc3MDcsInJvb3RfaHR0cHNfb3JpZ2luIjpbImFwcGxlLmNvbSJdfQ.IrZxlIHsZBiBLZPw1UZYkyqwbPDPmzcj8U57M3w252i3A4TRzASKx2aGAoXJ0WtuNihmyyopREeVqpJlpjq0fw";

So the bridge isn’t really "spoofing" anything, it’s just using the exact token that Apple’s own frontend uses. The issue is that this token changes whenever Apple rebuilds the web app, meaning the asset filename changes (e.g. index~BMeKnrDH8T.js), and so the hardcoded token eventually goes stale.
The proper solution would indeed be to automatically load the App Store HTML page, parse the <script type="module"> tag to find the current JS bundle URL, fetch that JS file, extract the const XXX = "" string dynamically.

Unfortunately, I’m not familiar enough with PHP to implement that cleanly myself. For now, the only workaround I can offer is keeping the token updated when I notice it changes, but that obviously isn’t ideal for you either, since it would require merging PRs every time Apple pushes a new build.

If you know a better approach or if someone more experienced in PHP wants to help with scraping the token dynamically, that would definitely be the long-term fix. (I can implement that in Python if needed)

@NohamR
Copy link
Contributor Author

NohamR commented Nov 17, 2025

I used an IA to implement the JWT extraction. Please review my code before merging it. See my new PR: #4824. Sorry, I don't know much about PHP.

wrobelda pushed a commit to wrobelda/rss-bridge that referenced this pull request Nov 18, 2025
* Use hardcoded JWT token in AppleAppStoreBridge

Replaces the dynamic extraction of the JWT token from the page meta tag with a hardcoded token, as the previous method stopped working. The token is sourced from Apple's own JavaScript and is valid until January 26, 2026.

* Refactor AppleAppStoreBridge to simplify token handling

Removed the getJWTToken() method and inlined the hardcoded JWT token directly into getAppData(). Updated HTTP headers for API requests to better mimic browser behavior and improve compatibility.

* Split long JWT token string for readability

* Fix long JWT token string concatenation style

* Disable and re-enable PHPCS rule for token assignment

* Update hardcoded Apple App Store token

Replaced the hardcoded JWT token and its reference to the latest version from Apple's JavaScript source.
wrobelda pushed a commit to wrobelda/rss-bridge that referenced this pull request Nov 18, 2025
* Use hardcoded JWT token in AppleAppStoreBridge

Replaces the dynamic extraction of the JWT token from the page meta tag with a hardcoded token, as the previous method stopped working. The token is sourced from Apple's own JavaScript and is valid until January 26, 2026.

* Refactor AppleAppStoreBridge to simplify token handling

Removed the getJWTToken() method and inlined the hardcoded JWT token directly into getAppData(). Updated HTTP headers for API requests to better mimic browser behavior and improve compatibility.

* Split long JWT token string for readability

* Fix long JWT token string concatenation style

* Disable and re-enable PHPCS rule for token assignment

* Update hardcoded Apple App Store token

Replaced the hardcoded JWT token and its reference to the latest version from Apple's JavaScript source.
wrobelda pushed a commit to wrobelda/rss-bridge that referenced this pull request Nov 18, 2025
* Use hardcoded JWT token in AppleAppStoreBridge

Replaces the dynamic extraction of the JWT token from the page meta tag with a hardcoded token, as the previous method stopped working. The token is sourced from Apple's own JavaScript and is valid until January 26, 2026.

* Refactor AppleAppStoreBridge to simplify token handling

Removed the getJWTToken() method and inlined the hardcoded JWT token directly into getAppData(). Updated HTTP headers for API requests to better mimic browser behavior and improve compatibility.

* Split long JWT token string for readability

* Fix long JWT token string concatenation style

* Disable and re-enable PHPCS rule for token assignment

* Update hardcoded Apple App Store token

Replaced the hardcoded JWT token and its reference to the latest version from Apple's JavaScript source.
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.

3 participants