multi-areas

see update below

how auth/metadata grabbing will work if/when we (have to?) switch to multi-regions

first run

second run

got cached stuff from first run now

where the areas actually come from

grpc api

use the grpc/protobuf api made for this purpose https://api.annex.radiko.jp/radiko.ProgramService/ListStations

downloader script
self-written .proto file to decode it
decode done with le top sekrit gchq software (cyberchef)
but hmm, then i would have to figure out how to properly deal with protobufs
no prior art in yt-dlp that i can copy from afaik

mobile site

alternatively, some pages on the new mobile site have area details in the big json blob
todo: find example
sad time, they got rid of it

mobile api

https://api.annex.radiko.jp/v1/programs/stations/list
https://api.annex-cf.radiko.jp/v1/programs/stations/list
you can set the query ?prefecture=JP1 to get stations in that prefecture

idk what annex means, cf seems to mean cloudflare though
see https://api.annex-cf.radiko.jp/cdn-cgi/trace

idk which one to use, app seems to prefer cf, site does direct
both seem exactly the same, cf is faster i guess (local datacentre)


UPDATE

2025-07-09 (remembered these pages exist)

I found a JSON API, i think in the v8 app?
https://radiko.jp/api/stations/batchGetStations?stationId=FMT

you query an individual station and it returns JSON with a "prefecturesList" which has all the prefecture codes that the station is available in
for e.g. TBS it has JP8-JP14 for the kanto area, for SBS in shizuoka it just has JP22, etc

and then i suppose it's just a matter of picking an area from the list and pretending to be there

ref: my comment in jackyzy823/rajiko, #25

I think my elaborate diagram above is a bit silly/over-complicated now
probably the best way would be to have an index of all the tokens in one file, that way i can just select one that matches and isnt expired (or otherwise pick area at random, as above)