Giter Site home page Giter Site logo

rajiko's Introduction

Rajiko

Warning:

This addon will not work on Manifest V3 with only declarativeNetRequest API.

So if Chromium based browsers totally abandon MV2 in the future, I'll stop maintaining for these browsers.

How to use:

  1. Install it from Chrome webstore or Firefox addons. For Firefox Android users, before Addons General Availability, you need to use Beta/Nightly with Addons Collections to use Radiko.
  2. Do nothing or change default area by clicking icon which only affects live area.
  3. Recording live or download timeshift by clicking icon.
  4. Click icon or click pause button to stop recording.

Permission Details:

  1. activeTab : to get tab's url to decide whether auto refresh or alert or which radio to record.
  2. cookies : for force setting radiko.jp's current location.
  3. storage : for storing your location configuration.
  4. webRequest : modify request to pass the authentication.
  5. webRequestBlocking : modify request to pass the authentication.
  6. *://*.radiko.jp/* : the only site we aimed at.
  7. declartiveContent : [TODO] for showing icon only on radiko pages.But firefox does not support this api.When firefox supports this api,tab permission will not be required.
  8. downloads : for downloading recored audio.
  9. *://*.smartstream.ne.jp/* : the site where audio stored.
  10. unlimitedStorage : for recording radio.

What's new:

  • version 0.3.6.1

    update manifest key for Firefox for Android

  • version 0.3.6

    major improvement on Firefox for Android

  • version 0.3.5

    update css in popup to fix issue in chrome. Many Thanks to @fireattack.

    upadte new radio-area map

    sync radiko android version code

  • version 0.3.4

    fix matching when urls have query param

  • version 0.3.3

    fix bug on chrome by calling storage API before DOMContentLoaded

  • version 0.3.2

    fix area check bypass

    upadte new radio-area map

  • version 0.3.1

    fix m3u8 endpoints

    fix aac urls endpoints

    fix drag issue in some cases.

  • version 0.3.0

    improve timezone handle.

    upadte new radio-area map

    sync radiko android version code

  • version 0.2.9

    update css in popup to fix issue in chrome 94 (close #8). Many Thanks to @andykamezou for his css advise.

    hijack ajax to avoid #!out issue (replace old method)

    upadte new radio-area map

    sync radiko android version code

  • version 0.2.7.2

    since chrome do not count hash in history. revert v0.2.7.

  • version 0.2.7.1

    make page history correct via history.back

  • version 0.2.7

    bypass unclosable dialog

  • version 0.2.6

    make share page bypass geoblock (fix #1)

    sync radiko android version code to 7.3.7

  • version 0.2.5.8

    upadte new radio-area map for エフエム佐賀 エフエム徳島

    sync radiko android version code to 7.2.9

  • version 0.2.5.7

    upadte new radio-area map for エフエム秋田、Rhythm Station エフエム山形、FM岡山、エフエム山陰、エフエム宮崎

    change some radio's name

  • version 0.2.5.6

    upadte new radio-area map for HI-SIX(エフエム高知)

    sync radiko android version code to 7.2.0

  • version 0.2.5.5

    fix compatible problem for Chrome 72 -

  • version 0.2.5.4

    fix cors issue for Chrome 76 +

    sync radiko android version code to 7.1.1

  • version 0.2.5.3

    remove alert to avoid stuck in Chrome on Windows

    sync radiko android version code to 7.0.6

  • version 0.2.5.2

    make extension work under incognito mode

    sync radiko android version code to 6.4.4

    fix download blob file problem in new version firefox

  • version 0.2.5.1

    dirty fix for live recording issue caused by radiko using new rpaa api for stream. (May encounter unexpected problem.Issues are welcomed.)

  • version 0.2.5

    fix error caused by radiko new type api requestheader (X-Radiko-AreaId).

    solved a problem caused by CORS and Disk cache.

  • version 0.2.4.1

    upadte new radio-area map for FMFUKUI(FM福井)

  • version 0.2.4

    sync radiko android version code to 6.4.0

    resolve 5s problem in some mediaplayer. Now aac are concated without id3 metadata.

  • version 0.2.3

    fix time display in ballon when dragging in timefree, fix dragging in different timezone (Don't know if this fix works)

    update gps info from radiko android DEVELOPER_MODE

  • version 0.2.2

    fix timefree bypass logic.

  • version 0.2.1

    Now, you can use areafree(エリアフリー) and timefree(タイムフリー) as premium(プレミアム会員) freely without any operation.

    For switching to other area in timefree(タイムフリー) page, only click 地域変更 button in timefree(タイムフリー) page.

    The "3 hours a day" limitation of timefree(タイムフリー) has been unblocked.You can listen no matter how long now. And also you can download timefree(タイムフリー) program.

    "Choose Area" is only needed in displaying area in live(ライブ).

    If there's any bug or problem ,please try to disable and then enable or reinstall it.If this does not help , please tell me via review page or github issue.

    Update to the newest radio table [20180412].

  • version 0.1.4.1

    bug fix: fix cookie error caused by different storage.local key name.

    continously improve mobile ui

    improve extension icon ui when recording

  • version 0.1.4

    change to responsive ui in firefox android !

    fix gps info mistake

    adjust to correct japan timezone via moment-timezone

  • version 0.1.3

    experimentally support recording radio. [Caution: this would cause slowing down popup page and increasing cpu usage if recording too long. No more than 30 minutes is recommended.]

  • version 0.1.2

    fix bug in firefox

  • version 0.1.1

    support firefox for android

  • version 0.1

    initial version

Suppport List:

  • firefox latest

  • chrome latest

  • chromium latest

  • yandex browser latest

  • firefox for android latest

  • kiwi browser for android

Known Issue:

  • The timeshift program can not be played after downloading without force refresh ,becuase of a problem of xhr access-control with disk cache see :https://lists.w3.org/Archives/Public/www-archive/2017Aug/0000.html (solved by add Access-Control-Allow-Origin in response via extension or see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin CORS and caching ->set Vary: Origin in response?)
  • Failed to download recorded on firefox nightly and firefox for android nightly
  • Drag issue with timezone in timefree mode. (1.Always play the start part Wherever you drag 2.Cannot drag over time after localtime now) .The second problem may be caused by radiko which only aims atjapan user not handling timezone problem . (solved)
  • Timefree only plays 5 seconds. (Don't know whether this is my issue or radiko's ,update :solved)

Why I do this:

An overseas fan of Kalafina wanted to listen to the radio program 'Kalafina倶楽部 ' which was ended a few days after this extension have been developed.

Technical Details:

  1. How it works?

    The authentication of pc(html5) version radkio validates user's location via ip address.

    However the android version of radkio validates user via geolocation provided by GPS(if possible),not via user's ip.

    So why don't we use the authentication method of android version in pc to bypass ip check?

    The authentication includes two step:

    1. auth1

      request : platform_info , user_id

      response : a token to be valid, full_key_offset ,partial_key_length

    2. auth2

      request: token ,platform_info ,user_id, a parital key generated by full key and offset , connection type (in android), gps location(in android)

      response: Your location (and your token is valid for only this location) / OUT

    In the pc version,the full key is simplely placed in the javascript code in apps/js/playerCommon.js :

    player = new RadikoJSPlayer($audio[0], 'pc_html5', 'bcd151073c03b352e1ef2fd66c32209da9ca0afa' /*full key*/ ...

    However the android version's full key is protected by native dynamic librarys.Obviously the key is much longer than that in pc version.

  2. But how do you generate the partialkey/how do you get fullkey?

    By reversing android dynamic library,You can get the fullkey from .data segment after bypassing the root check ,emulator check and lots of anti-debugging tricks and waiting for itself to repair the .data segment.

ABOUT AAC

  1. HLS(HTTP Live Streaming) using Packed Audio see : https://tools.ietf.org/html/draft-pantos-http-live-streaming-23 which is ID3 tag + audio sample(AAC_ADTS,MP3,AC3)
  2. About com.apple.streaming.transportStreamTimestamp ? Could i use this to sort?(yes) PTS -> (stamp2 - stamp1) / (90*1000.0) https://blog.csdn.net/qq_32430349/article/details/50218317
  3. Drop all ID3 tag? see id3 in hls :https://helpx.adobe.com/adobe-media-server/dev/timed-metadata-hls-hds-streams.html
  4. ID3 header -> size PRIV Frame header (PRIV size flag) -> identi end with \x00 64bit data (31bit 0 and 33bit data bigendian) frame header see http://id3.org/id3v2.4.0-structure priv see http://id3.org/id3v2.4.0-frames

TODO

  1. Using ffmpeg.js (based on Emscripten:an LLVM-to-JavaScript compiler) concating ts segments to avoid 5s problem in mediaplayer.Note:size is about 13MB. (depercated : just drop id3 tags and simplely concat adts strem)

  2. Fake request headers more similarly (such as remove cookies and set accept,user agent,and etc) to avoid detection (partially done) due to the limitation of extension , cannot captialize some header's key

  3. Automatic switch location , no need for manually choice. (consider not supporting)

  4. Add recording function? (find solution on firefox -> webRequest.filterResponseData() and localstorge/chrome.storage -> downloads.download URL.createObjectURL(BlobObject), chrome may use xhr to save data , double trafic?) the right way to download data uri https://stackoverflow.com/questions/40269862/save-data-uri-as-file-using-downloads-download-api/40279050

    how to merge? (src site use hls.js to play m3u8 and aac) seems that directly concat is enough

  5. Force Firefox android load web page,not app download page.(done)

  6. consider generate different extension in different browser

    https://stackoverflow.com/questions/45911251/what-is-the-best-way-to-create-a-cross-browser-gmail-extension https://www.smashingmagazine.com/2017/04/browser-extension-edge-chrome-firefox-opera-brave-vivaldi/

  7. modify firefox android page to responsive page. (partially done)

  8. break the time limitation of timeshift and be able to download timeshift content (done)

rajiko's People

Contributors

fireattack avatar garret1317 avatar jackyzy823 avatar markusjlechner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rajiko's Issues

0.3.3 Error message outside Japan

Even in 0.3.3, when I open a new URL (from outside radiko or in a new tab), it seems that it is displayed as out of area (outside Japan).
(However, after opening radiko and closing the error message, if you click the link or paste the URL in the address bar and go to the playback page, it seems that you can play normally)
like
https://radiko.jp/
https://radiko.jp/#!/top
https://radiko.jp/#!/live/LFR
https://radiko.jp/#!/ts/LFR/20230510030000
https://radiko.jp/#!/timetable
https://radiko.jp/#!/timetable/LFR/live
https://radiko.jp/#!/recommend
https://radiko.jp/#!/search/timeshift?key=%E5%A4%A7%E5%89%8D%E3%82%8A%E3%82%87%E3%81%86%E3%81%99%E3%81%91
https://radiko.jp/share/?sid=LFR&t=20230510030000
(Only this one, the same display even if you enter it in the address bar of the URL with #! of radiko)
redirects to
https://radiko.jp/#!/out

Issue with opening share url in a new tab

Link example http://radiko.jp/share/?t=20210329153524&sid=JORF

On Edge 89.0.774.63, (sometimes?) it will stuck in a loop (share -> radio page -> radiko out -> share -> radio page -> radiko out ...)
On Brave 1.22.70, it will navigate back to the empty new tab

I guess it's related to the recent change and somehow each browsers dealt with it differently.

if (window.location.hash == "#!/out"){
    $.colorbox.close();
    history.back()
}

Idea : Instead of relying on location hash, is it possible to deal with this directly?

area.js

            $.Radiko.ajax('/area', function (data, status, xhr) {
                /* snipped */
                var areaFreeId = $.cookie('areafree_id');
                if (typeof areaFreeId !== 'undefined') {
                    $.Radiko.area.id = areaFreeId;
                }
                else {
                    $.Radiko.area.id = defaultAreaId;
                }
                $.Radiko.header.create_header(getAreaId(), loginStatus);
            }, function () {
                $.Radiko.area.id = 'OUT'; //<---------
            }, 'text', true).always(function () {
                if ($.Radiko.area.id === 'OUT') {
                    window.location.hash = '#!/out';
                }
                $.Radiko.EventEmitter.trigger('radikoready');
            });

The extension blocking ajax call to /area which make them to assign the default value of $.Radiko.area.id to "OUT". This seems to be the ultimate final check that causing user to be redirected to #!/out .

Override $.Radiko.area.id to any value (or to the relevant value from cookie) after they assign "OUT", and user will get a proper web page.

Publish your extension to Microsoft Edge Addons website

Microsoft Edge is the second most used browser on the web, making the browsing experience more flexible, offering many more services for users and optimized for Windows devices.

Microsoft Edge supports Chromium extensions, and you can publish your extensions to Microsoft Edge Add-ons website with minimal code changes. Find out more here.

If you have any more queries about porting Chrome extension to Microsoft Edge or anything else, you can contact the relevant teams whose links are given here.

Let me know if this was helpful. I am happy to help you with more details.

Drop down menu from icon is trucated in to a slot for Chrome.

For users within Japan and need to change regions, the drop down has become truncated, this has occured on recent Chrome 94 update, the other plugins I use do not have this issue.
Drop down menu is displayed fine on Firefox.
(Only just realised for overseas users, they don't ever need to change regions I guess as they are classified out of Japan already.)

image

Bypassing geo-restriction for share links as well

Currently, rajiko bypasses geo-restriction on live streaming page and timeshift links http://radiko.jp/#!/ts/*. However, it doesn't handle /share/ links like https://radiko.jp/share/?sid=QRR&t=20210306210000 . So if your IP is not in Japan, it would block you.

Is it possible to bypass geo-check for these links too?

Or, which probably easier is that we can just make them redirect to /ts/ links directly

https://radiko.jp/share/?sid=QRR&t=20210306210000
--->
https://radiko.jp/#!/ts/QRR/20210306210000

(The only thing to notice is /share/ links typically use 29-hour format while /ts/ ones only accept 24-hour. So
links past 0:00 such as https://radiko.jp/share/?sid=QRR&t=20210306260000
should be converted to https://radiko.jp/#!/ts/QRR/20210307020000 instead.

https://radiko.jp/#!/ts/QRR/20210306260000 is still "valid", but is the wrong/different program.)

v8 mobile app is different, you shouldn't include it in get_appversion

version 8 of the mobile app is new and shiny, and uses a different key and device id

you include some 8.0.* releases in the pool of choices for get_appversion
but if you're sending v7's X-Radiko-App: aSmartPhone7a with v8's X-Radiko-App-Version: 8.0.11 that looks a bit sus

easy solution: get rid of the v8s in get_appversion, stay on v7 for the foreseeable future

less easy solution: switch to the v8 key/id
you can bin some of the spoofing code if you do that, when i looked the app seemed to use hardcoded X-Radiko-Device and user agent (android and Mozilla/5.0 (Linux; Android 10; Pixel 4 XL) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36 respectively (i don't have a pixel))
v8 key + how i got it here
id is aSmartPhone8

Handling special programs

Hello! Thank you for developing this great extension, and it has been really helpful!

I ran into the rare instance where I want to listen / dl a radiko special program: https://radiko.jp/rg/special/autoreverse/

Listening works, but with download, I don't see the usual download timefree button. It remains on "confirm" view.

Thanks for taking a look!

Share link no longer works

Version: 0.3.2

Share links such as http://radiko.jp/share/?sid=QRR&t=20230429260000 does not work anymore.

It redirects to https://radiko.jp/#!/out (ラジコは、日本国内限定のサービスとなりますので、今アクセスしている場所からお聴きいただくことはできません。).

Since I have Japan IP, these links actually work without extension. So basically, not only rajiko is unable to bypass the geo-restriction with share links, it prevents them from working even when having a Japan IP.

I assume it's related to changed made in 0.3.2 a few days ago, either on rajiko's end or Radiko's end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.