Closed garret1317 closed 4 months ago
some mobile web apis
make sure to set Referer: https://radiko.jp/mobile
or itll reject you
https://radiko.jp/_next/data/nLQsA4EHzwfgk-EvAu-Nj/mobile.json for front page
https://radiko.jp/_next/data/nLQsA4EHzwfgk-EvAu-Nj/mobile/events/8475499.json - "event" - single episode https://radiko.jp/_next/data/nLQsA4EHzwfgk-EvAu-Nj/mobile/search/events.json?q=%E8%A7%92%E6%9D%BE%E6%95%8F%E7%94%9F+my+blues+life - search with no query also gives results, though not sure what theyre supposed to be
https://radiko.jp/_next/data/nLQsA4EHzwfgk-EvAu-Nj/mobile/r_seasons/10012903.json?rSeasonId=10012903 for a programme
(oh look, it has an isSingleStation
key, thats useful)
https://radiko.jp/_next/data/nLQsA4EHzwfgk-EvAu-Nj/mobile/r_seasons/10013635.json?rSeasonId=10013635 - another programme page, this one on multiple stations
annoyingly it doesnt say which other stations it's actually on though
nothing new for streams, https://radiko.jp/v3/station/stream/MobileWebTrial/TBS.xml the 3 mins limitation is just an end time value
the nLQsA4EHzwfgk-EvAu-Nj
is hardcoded, i think
5436: function(e, t, r) {
var i = "undefined" != typeof window ? window : void 0 !== r.g ? r.g : "undefined" != typeof self ? self : {};
i.SENTRY_RELEASE = {
id: "nLQsA4EHzwfgk-EvAu-Nj"
}, i.SENTRY_RELEASES = i.SENTRY_RELEASES || {}, i.SENTRY_RELEASES["annex-frontend@radiko"] = {
id: "nLQsA4EHzwfgk-EvAu-Nj"
}
},
^ (from _app.js) implies its some kind of (sentry) analytics thing
mobile should probably be a different extractor/plugin tbh its a pain in the ass, so that plugin will probably not be made by me im afraid
mobile app and mobile web give programmes their own pages so you can see all available episodes easily, and be recommended other similar ones
extracting these would be very good indeed - won't have to use a convoluted search query to download weekly episodes (and other stuff that happens to match 🚎)
here's a show page on mobile web https://radiko.jp/mobile/r_seasons/10001894
note- you need a japanese ip/vpn (rajiko deliberately doesnt work), and to spoof your user agent to something mobile or just use curl :p
it appears to be next.js, so we can get most of the interesting stuff from the nice
<script id="__NEXT_DATA__" type="application/json">
block at the end it will block you if youre outside japan, but fortunately thats only client side - so downloading the page will work whateverlooks like everything has new (actual) ids, not sure what to do about that while the desktop site's still non-renovated, could resolve to regular #!/ts/ urls by converting the air time and i guess start using those ids once desktop makes the switch
here's an app show page![Screenshot_20230714-171610](https://github.com/garret1317/yt-dlp-rajiko/assets/76261416/39a4198d-37b6-4952-be78-cc77282d7995)
that one only has currently available eps and recommendations
here's another (not all shown)
has current eps and future, but no recs
if you follow the show, it lets you choose which station you want
e.g. whole jfn
just one station
partial jfn ![Screenshot_20230714-170331](https://github.com/garret1317/yt-dlp-rajiko/assets/76261416/358167a7-3e52-4dd2-8672-c50b30222398)
^to deal with this, have an extractor arg: preferred stations a list of which station( id)s to try in descending order of preference so for eg. JFN shows you can prioritise the stations with best sound quality and the extractor picks the first one that's available if there is no arg, default the key/"home" station - mobile web js has it, so should be ok
that's not available on mobile web (yet?) though, so don't think i can implement it any time soon - app remains uncooperative with mitmproxy
(todo: compare the entire JFN, find ones with best sound quality) (note: don't know why my phone screenshots display so huge, or what to do about it)