Twoure / KissNetwork.bundle

Plex Channel to view Anime, Asian Drama, Cartoons, Manga & Comics from KissAnime, KissAsian, KissCartoon, KissManga & ReadComicOnline
94 stars 21 forks source link

KissAnime encryption change #53

Open RexfelisLOC opened 7 years ago

RexfelisLOC commented 7 years ago

Looks like KissAnime has a new decryption function called "ovelWrap". It seems to be encoded as the following:

function ovelWrap(_0x7b4ax13) { var _0x7b4axe = null; try { var _0x7b4ax10 = CryptoJS[_0x59b3[0]][_0x59b3[24]][_0x59b3[23]]({ ciphertext : CryptoJS[_0x59b3[22]][_0x59b3[21]]_0x59b3[20] }), _0x7b4ax7 = CryptoJS[_0x59b3[30]][_0x59b3[29]](_0x7b4ax10, key, { mode : CryptoJS[_0x59b3[26]][_0x59b3[25]], iv : iv, padding : CryptoJS[_0x59b3[28]][_0x59b3[27]] }); return _0x7b4axe = _0x7b4ax7.toString(CryptoJS[_0x59b3[22]].Utf8) } catch (p) { alert(p + _0x7b4ax13) } } var bkZ = _0x59b3[31], skH = _0x59b3[32], iv, key; iv = CryptoJS[_0x59b3[22]][_0x59b3[33]]_0x59b3[20], key = CryptoJS.SHA256(skH)

How do you decode javascript like the above?

RexfelisLOC commented 7 years ago

Found a JS deobfuscator:

function ovelWrap(_0x7b4ax13) { var _0x7b4axe = null; try { var _0x7b4ax10 = CryptoJS['lib']['CipherParams']['create']({ ciphertext: CryptoJS['enc']['Base64']'parse' }), _0x7b4ax7 = CryptoJS['AES']['decrypt'](_0x7b4ax10, key, { mode: CryptoJS['mode']['CBC'], iv: iv, padding: CryptoJS['pad']['Pkcs7'] }); return _0x7b4axe = _0x7b4ax7.toString(CryptoJS['enc'].Utf8) } catch (p) { alert(p + _0x7b4ax13) } } var bkZ = 'a5e8d2e9c1721ae0e84ad660c472c1f3', skH = 'nhasasdbasdtene7230asb', iv, key; iv = CryptoJS['enc']['Hex']'parse', key = CryptoJS.SHA256(skH)

L2501 commented 7 years ago

it same aes as used in their other sites

all you need is to get the key and iv


 var bkZ = 'a5e8d2e9c1721ae0e84ad660c472c1f3',
     skH = 'nhasasdbasdtene7230asb',
     iv, key;
 iv = CryptoJS['enc']['Hex']['parse'](bkZ), key = CryptoJS.SHA256(skH)

key = hashlib.sha256('nhasasdbasdtene7230asb').digest() iv = 'a5e8d2e9c1721ae0e84ad660c472c1f3'.decode('hex')

crypter = AES.new(key, AES.MODE_CBC, iv) crypter.decrypt(cypertext.decode('base-64'))

RexfelisLOC commented 7 years ago

Awesome thanks. I was able to replace the token with the skH value and it works.

Twoure commented 7 years ago

Thanks for the info, I'll push a fix when I can.

Twoure commented 7 years ago

Fixed anime. Currently working on cartoon, then will check drama for changes.

Twoure commented 7 years ago

Finished cartoon/drama js decryption. Still need to translate into python, and make dynamic.

RexfelisLOC commented 7 years ago

I'm curious if your library can play videos from the beta server. Here's a video which is only available using Openload or KissAnime's beta server (KissAnime server is not available):

http://kissanime.ru/Anime/Naruto-Shippuuden/Episode-003?id=100312&s=beta

Notice the &s=beta at the end. The code will extract the link, but I cannot play the link in a browser (I do not use Plex).

Twoure commented 7 years ago

Notice the &s=beta at the end. The code will extract the link, but I cannot play the link in a browser (I do not use Plex).

I'm seeing the same thing. I assume its a header dependency issue. Sometimes sites like these expire the video link the instant it's been called, and they normally have some dependency within the requests header. I don't have time right now to look into this any further, but will once I've patched up the channel for the default sites.

NicholasLAranda commented 7 years ago

Thank you for addressing this and implementing a fix.

Twoure commented 7 years ago

Fixed anime in https://github.com/Twoure/KissNetwork.bundle/commit/3a15779747bd338a634f5a5211a9f087e01bee1f (aka dev branch). The values are hard-coded for now, but will need to be generated later (so this patch may break in a day or two). Still looking into a good way to do this. Moving on to cartoon/drama section for now.

Twoure commented 7 years ago

Thanks @GreyAsteroid for bringing the manga section to my attention. I'll add this to my list of things to do. Seems the encryption is a similar style as the other sites.

Twoure commented 7 years ago

Fixed anime, cartoon, Asian dramas. Still working out some of the bugs, but have the ground work done. Will also take time to fix the manga section after finalizing the video sections.

NicholasLAranda commented 7 years ago

Any ETA when 1.3.0 releases with channel fixes? All weekend we've wants to watch some animated cartoons but since it changed, we're limited to Netflix, my small home server & the poor quality of SS-Plex & PrimeWire with their mass of dead links.

Twoure commented 7 years ago

@RypeDub420 said: Any ETA when 1.3.0 releases with channel fixes?

Hopefully early this week.

All weekend we've wants to watch some animated cartoons

In the meantime, tryout 9anime.bundle dev branch. If you have the ssl cert issue and can't navigate the channel, then try enabling the SSL/TLS Fix within the channel's preferences.

Please keep 9anime.bundle comments to it's support thread [REL] 9anime and issues to https://github.com/Twoure/9anime.bundle/issues.

IJ08 commented 7 years ago

Okay Twoure thanks for referencing. Will wait on next build. Appreciate your work in keeping your plugin up-to-date sir!

frankr2994 commented 7 years ago

Hey just wanted to show my appreciation for your effort. Ditched cable a year back and this particular plugin has been absolutely awesome for entertaining my 4 year old. So nice to be able to hit shuffle and let the TV just play. I'm trying to become more involved with Plex and will hopefully learn how to help fix, maintain or create my own plugin. For now I am patiently waiting for your updates as they come through.

MisterVulcan commented 7 years ago

Ditto from the guy above me. Am willing to do python coding for free anime :-).

Twoure commented 7 years ago

Fixed default videos in https://github.com/Twoure/KissNetwork.bundle/compare/eda694b...bbd22af available from the current dev branch. Moving on to manga section for now, then will revisit the new beta video host.

bearsnacks commented 7 years ago

I also wanted to show my appreciation. Thanks for doing all this!

Prometheusx-git commented 7 years ago

Hi Twoure, i would like to use your Code for the Kodi Kissasian Addon. After changing the Code to work with Kodis python, i've got a problem with the get_rks() function. I changed it like this:

cl = list() bl = list() key = "" code = "" ra = re.findall(r'<script type=\"text/javascript\">(.*?)</script',page, re.DOTALL)

html = HTML.ElementFromString(page)

for node in ra : #html.xpath('//script[@type="text/javascript"]'):   
    r = re.search(r'var\s*?(\_[^\=]+)\=\$kissenc',node)
    if r:
        key = r.group(1)
        cl.append('var %s = "%s"; ' %(key, rks_init))
        continue
    r2 = re.search(r'(\$kissenc[^\(]+\(%s\))' %key, node) if key else None
    if r2:
        continue
    r3 = re.search(r'(%s)' %key,node) if key else None
    if r3:
        for i, n in enumerate(node.strip().split(';')):
            n = n.strip()
            if re.search(r'(%s)' %key,n):
                r4 = re.search(r'\s([^\(\=]+)\(',n)
                if r4:
                    n = "function %s(a, b) {return a + 'bl_key' + b};" %r4.group(1) + n
                cl.append(n.lstrip('} \n') + ';')
            elif (i == 0):
                r3 = re.search(r'var\s*?(\_[^\=]+)\=\[["\']([^"\']+)["\']\]',n)
                if r3:
                    bl = [ b64decode(s.strip().decode('unicode_escape')) for s in r3.group(2).split(',') ]
code = ''.join(cl + [' %s' %key]) if cl else ''
code = code.replace('bl_key', (bl[0] if bl else '$'))
if code:
    return js2py.eval_js(code)
return False

Unfortunatly the execution of js2py.eval_js(code) fails. The variable "code" looks for example like this: var _duMLg = "Agxck2w4kG82A5tho"; var t = _duMLg;function x352(a, b) {return a + '$' + b};_duMLg = x352('5', _x1);_duMLg += t;_duMLg += '10'; _duMLg

Could you see a mistake or give a hint?

RexfelisLOC commented 7 years ago

FYI, KissCartoon is returning a "http://kisscartoon.se/Play?" for video links. Not sure if you are handling this, but if you try to play the link, KissCartoon will return "Please do not do that!"

Twoure commented 7 years ago

@Prometheusx-git and @RexfelisLOC, thanks for the heads up.

Twoure commented 7 years ago

@Prometheusx-git The code changes per user (I'm guessing based on IP and other params). https://www.reddit.com/r/KissAnime/comments/60fbp0/the_state_of_kissanime_kodi_addons_and_how/

So it seems my code above isn't going to work for the page your getting. I've not seen the code change on my end for almost two days now. I'll have to wait and see what it changes to.

Twoure commented 7 years ago

@RexfelisLOC said: FYI, KissCartoon is returning a "http://kisscartoon.se/Play?" for video links. Not sure if you are handling this, but if you try to play the link, KissCartoon will return "Please do not do that!"

Patch for cartoon play urls in https://github.com/Twoure/KissNetwork.bundle/compare/bbd22af...06b16b4 Also testing different openload url handler.

NicholasLAranda commented 7 years ago

In the meantime, tryout 9anime.bundle dev branch. If you have the ssl cert issue and can't navigate the channel, then try enabling the SSL/TLS Fix within the channel's preferences. Please keep 9anime.bundle comments to it's support thread [REL] 9anime and issues to https://github.com/Twoure/9anime.bundle/issues.

I'm waiting for KissCartoon :'(

yastri commented 7 years ago

@Twoure said: Fixed anime, cartoon, Asian dramas. Still working out some of the bugs, but have the ground work done. Will also take time to fix the manga section after finalizing the video sections.

I'm just trying dev for Asian dramas, video still not working :(

Yolley commented 7 years ago

@yastri That's because of this https://www.reddit.com/r/KissAnime/comments/60fbp0/the_state_of_kissanime_kodi_addons_and_how/

mapestree commented 7 years ago

It is probably related to this announcement on the KissAnime website:

RemoveYourMedia is taking down almost all our videos with DMCA reports. We don't have any way to prevent this so... if you could not load the videos on KissAnime, please use other anime sites in the mean time (GoGoAnime, 9Anime...). There are a lot of good anime sites out there and DMCA could not take them all down.

I imagine that they are making changes to their encryption protocols to combat the RYM DMCA requests, which then breaks code here.

The cynical side of me thinks that it is also possible that RYM is using this or a similar tool to do all of the hard decryption work for them...

IJ08 commented 7 years ago

the 9anime plex channel is having errors playing videos now, could be related to ^

Looks like its going to be a while to fix all of these issues.

NicholasLAranda commented 7 years ago

OMG WTF IS JSFUCK xD

Anyways, I hope this gets fully implemented soon. I am sorry for all of the work you have to do as a developer.

NicholasLAranda commented 7 years ago

Damn, you're still working on this? Have you tried asking on the forums for assistance?

Twoure commented 7 years ago

@RypeDub420 said: Damn, you're still working on this?

Yes and No... for me it currently works (the dev branch version minus kisscartoon [cause they are offline] and manga [as I haven't taken the time to fix manga yet]).

Have you tried asking on the forums for assistance?

I've found a current kodi developer who has code for some of the anime site's variations, and am working to implement them into my channel. These should help some who are in different countries, as it seems the kiss sites deal out different code per country (or so).

ElChurcho commented 7 years ago

Twoure,

We need to get these cartoons back online. How can I assist. Would love to discuss offline. Please reach out.

On Sunday, March 26, 2017, Twoure notifications@github.com wrote:

@RypeDub420 https://github.com/RypeDub420 said: Damn, you're still working on this?

Yes and No... for me it currently works (the dev branch version minus kisscartoon [cause they are offline] and manga [as I haven't taken the time to fix manga yet]).

Have you tried asking on the forums for assistance?

I've found a current kodi developer who has code for some of the anime site's variations, and am working to implement them into my channel. These should help some who are in different countries, as it seems the kiss sites deal out different code per country (or so).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Twoure/KissNetwork.bundle/issues/53#issuecomment-289290704, or mute the thread https://github.com/notifications/unsubscribe-auth/AYWe5BO2e2-bG47K5vy_SQzjvptCQ7Wtks5rpoEugaJpZM4MePIk .

-- Thank You

Scott Felton

IJ08 commented 7 years ago

I think the reason why cartoons isn't working is because the server for kisscartoons is currently unavailable right now.

Twoure commented 7 years ago

@ElChurcho, what @IJ08 said is correct. This channel's source for the cartoon section comes from kisscartoon.se but it is currently offline. (all other kisscartoon sites, at this time, are fakes)

As stated in this channel's readme, I do not have any affiliation with the kiss sites, and cannot influence/govern what happens with them.

NicholasLAranda commented 7 years ago

Well I'm glad you are still making progress.

Thank you for all of your hard work!

dominick1233 commented 7 years ago

Glad to hear this is still being looked into, this channel was so god damn useful.

IJ08 commented 7 years ago

Good morning @Twoure , how's it going with the issues? I checked the channel for 9anime and it is working fine w/o the SSL/HTTPS configuration chosen. I've been using it a couple of days now.

abbelyn commented 7 years ago

deleted, realized it was one of the dozens of clones for KissCartoon =( Hope they are able to recover.

NicholasLAranda commented 7 years ago

Maybe we can utilize the sources or make a whole new Plex app for these sites?

https://www.reddit.com/r/KissCartoon/comments/5hlxms/alternatives_to_kisscartoon/

On Apr 3, 2017, at 7:06 PM, abbelyn notifications@github.com wrote:

Not sure if it was noticed, but it seems KissCartoon is now on .io rather than .se Haven't had a chance to look through it yet though. Here's hoping that it can be added back in when time permits =)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bearsnacks commented 7 years ago

@RypeDub420 Twoure already has one that I've been using. https://github.com/Twoure/AnimeToon.bundle

edit: mod fixed link

IJ08 commented 7 years ago

@bearsnacks doesn't look like your link for AnimeToon.bundle is working anymore, what server does it get its source from?

LegendAssassin commented 7 years ago

Hey I love the AnimeToon Channel but there is no subbed anime? Is that coming in the future or is KissNetwork going to be restored one day?

Twoure commented 7 years ago

@LegendAssassin said: Hey I love the AnimeToon Channel but there is no subbed anime?

Animetoon site is for dub only, animewow.org is their anime sub site. Honestly my AnimeToon.bundle was a fork that I fixed, but then the original author removed their code. I've not used that channel in a long time, sorry.

Is that coming in the future

Currently I have no plans to write a channel for animewow.

or is KissNetwork going to be restored one day?

Yes, I'm still working to restore the KissNetwork channel.

Twoure commented 7 years ago

@RypeDub420 said: Maybe we can utilize the sources or make a whole new Plex app for these sites? https://www.reddit.com/r/KissCartoon/comments/5hlxms/alternatives_to_kisscartoon/

FMovies already exists, https://github.com/coder-alpha/FMoviesPlus.bundle and does include western cartoons.

Twoure commented 7 years ago

Merged kcore_dev with dev branch, adding kimcartoon as temporary cartoon source for channel, as-well-as many other small fixes.

Refer to Comment_1415835 for upgrade procedure. If you have questions/concerns about the changes, then please address them within the Support Forum.

IJ08 commented 7 years ago

@Twoure is the kissanime source working for the dev branch? or only the kisscartoons? Tried the dev branch a week ago and anime couldn't load videos still.... was still using the referenced 9anime bundle.

Is there a link to a comment on how to make it work? Thanks and appreciate it

Twoure commented 7 years ago

@IJ08 said: @Twoure is the kissanime source working for the dev branch?

Yes, but may not for everyone. I added some debugging tools this last push, and will post about it soon.

Also note, KissAnime site is now region restricted https://forums.plex.tv/discussion/comment/1415762/#Comment_1415762.

IJ08 commented 7 years ago

@Twoure Thanks, the URL is working for me, but I'll wait for the master branch to be updated before downloading.

Twoure commented 7 years ago

FYI: If videos do not play, and you can access the source sites directly within a browser, then please consider contributing to https://github.com/Twoure/KissNetwork.bundle/issues/63#issue-220801586. This applies to all sections, including Manga and Comics.