summaryrefslogtreecommitdiff
path: root/lib/sounds-auth.php
diff options
context:
space:
mode:
authorjade (winter)2026-09-07 18:20:29 +0100
committerjade (winter)2026-09-07 18:20:29 +0100
commitd528de4fb965ab338cd8ab80de5f6841bf520f11 (patch)
treed1357bec4260f8d2f3751989eaa72ae4503dc07d /lib/sounds-auth.php
parentc34ce636639654be1862e3c39bda9be50e0fcd6e (diff)
fix live playbackHEADmain
no need to scrape next data anymore, i found the rms endpoint that just gives you the token lmfao by the way i think the magic number 1d590d3 in the previous code was actually the next 'build id' and it broke because the build id changed ? maybe?
Diffstat (limited to 'lib/sounds-auth.php')
-rw-r--r--lib/sounds-auth.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/sounds-auth.php b/lib/sounds-auth.php
index 91e2599..9a333bf 100644
--- a/lib/sounds-auth.php
+++ b/lib/sounds-auth.php
@@ -1,15 +1,7 @@
<?php
-// where does 1d590d3 come from? i have no clue
-const SOUNDS_NEXT_DATA_BASE = 'https://www.bbc.co.uk/sounds/_next/data/1d590d3';
-const SOUNDS_NEXT_DATA_LIVE = '/play/live/{service}.json';
-
-function sounds_fetchPageData(string $path) {
- return json_decode(file_get_contents(SOUNDS_NEXT_DATA_BASE . $path));
-}
+require_once __DIR__ . '/rms.php';
function sounds_getLiveBearerToken(string $service) {
- return sounds_fetchPageData(
- str_replace('{service}', $service, SOUNDS_NEXT_DATA_LIVE)
- )->pageProps->jwtToken;
+ return rms_fetch(RMS_SOUNDS_TOKEN_BASE . "/$service")->token;
}