radiko が、過去30日以内のラジオ番組を時間制限なしで楽しめる新サービス「タイムフリー30」をこの秋スタート! さらにエリア外の番組も過去 30日間聴けるおトクな「ダブルプラン」も登場。
radiko to launch new service Timefree 30 this autumn, allows listening to programmes from the past 30 days, no 3-hour time limit
also, double plan, basically areafree + Timefree 30 (including the price)

very exciting
i wonder if stuff from before the service starts will be available, might be interesting to see whether they delete the old stuff or keep it around

probably can't spoof the timefree 30 plan, oh well never mind
it might work if you pass cookies of a timefree30 account

SHIT now i have to rejig all my time code to deal with it
probably best course of action would be to work out the end date in rtime
as of 9fb1d45638e2e2b792fa4861c2d33209a69c9706

line 496, RadikoTimeFreeIE _real_extract
if end.broadcast_day_end() < now - datetime.timedelta(days=7):
	self.raise_no_formats("Programme is no longer available.", video_id=meta["id"], expected=True)
line 704, RadikoPersonIE
min_start = (now - datetime.timedelta(days=7)).broadcast_day_start()
# we set the earliest time as the earliest we can get,
# so, the start of the broadcast day 1 week ago
# that way we can get everything we can actually download, including stuff that aired at eg "26:00"
fortunately i'm only working out the expiry in those two places afaict
def expiry(self, tf30):
available_days = 30 if tf30 else 7
return self.broadcast_day_end() + datetime.timedelta(days=available_days)
seems the simplest solution
then in TimeFreeIE i can just do if now > end.expiry(), that seems better to be honest
easier to understand

but for PersonsIE i need the earliest possible
def earliest_available(tf30):
	available_days = 30 if tf30 else 7
	return (RadikoTime.now(tz=JST) - datetime.timedelta(days=available_days)).broadcast_day_start()
i suppose i can have the two
especially since i just gave myself a headache trying to work out how to do TimeFree using earliest_available lmao

i don't know how i'd tell if they have tf30 though
in TimeFree it's easy since the auth happens there
not so easy in Persons
maybe i just say yes in Persons and let TimeFree handle it

maybe theyll do the restrictions client side and we can just get the stream as normal, that would be nice
doubt it though


even if it does work when passing cookies it's probably not a good idea lol
its all well and good spoofing anonymously, you (presumably) show up as oh someone in tokyo, oh someone in osaka, oh someone in hokkaido

but if you spoof while signed in, its all linked to your account
and so suddenly you show up as one person zipping around the country every few seconds