Kodi Community Forum
Broken Crunchyroll [DMCA Takedown] - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: Broken Crunchyroll [DMCA Takedown] (/showthread.php?tid=129709)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46


RE: [Release] Crunchyroll Takeout v0.6.5 (March 22nd 2013) - le__ - 2013-05-01

I was playing around and actually added a subtitle selection to the settings page.

I did it some time ago, when I was also trying to fix the playback on my region, but the codes was a mess... so I leaved it alone.
Now I did a basic clean up and re-added to the current version.

It adds a selection to Default, English, Portuguese, Spanish and French (since that those are the languages I could find) to the plugin settings.
The Default one uses the language from the Crunchyroll account settings (or your region, if you're not logged in), the others will overlap it to the selected language.
But, if that language isn't available in the current video, it will automatically fallback to the Default one.
(Note: It only works on softsubbed content, the hardsubbed ones are (probably) fully controlled by Crunchyroll account)

I did some testing and seems to be working as it should.

Code:
.../resources/language/English/strings.xml         |  7 +++
.../resources/lib/crunchyDec.py                    | 64 +++++++++++++++++++---
.../resources/settings.xml                         |  1 +
3 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/plugin.video.crunchyroll-takeout/resources/language/English/strings.xml b/plugin.video.crunchyroll-takeout/resources/language/English/strings.xml
index e6bbc55..9e351c0 100644
--- a/plugin.video.crunchyroll-takeout/resources/language/English/strings.xml
+++ b/plugin.video.crunchyroll-takeout/resources/language/English/strings.xml
@@ -80,4 +80,11 @@
    <string id="80002">Video not available to your user account</string>
    <string id="80003">Mature Content</string>
    <string id="80004">Please login to view this video</string>
+    <!-- Alternative Language Selector -->
+    <string id="100001">Subtitles Language:</string>
+    <string id="100002">Default</string>
+    <string id="100003">English (US)</string>
+    <string id="100004">Espanol</string>
+    <string id="100005">Francais (France)</string>
+    <string id="100006">Portugues (Brasil)</string>
</strings>
diff --git a/plugin.video.crunchyroll-takeout/resources/lib/crunchyDec.py b/plugin.video.crunchyroll-takeout/resources/lib/crunchyDec.py
index b83a5bb..42e9a88 100644
--- a/plugin.video.crunchyroll-takeout/resources/lib/crunchyDec.py
+++ b/plugin.video.crunchyroll-takeout/resources/lib/crunchyDec.py
@@ -2,6 +2,9 @@ import sys
# -*- coding: utf-8 -*-
import sha
import zlib
+import re
+import urllib
+import urllib2
import math as Math
from utils.Common import Common
from binascii import hexlify, unhexlify
@@ -32,14 +35,59 @@ class crunchyDec:
        
    def strainSoup(self, xml):
        soup = BeautifulSoup(xml)
-        subtitle = soup.find('subtitle', attrs={'link': None})
-        if subtitle:
-            _id = int(subtitle['id'])
-            _iv = subtitle.find('iv').contents[0]
-            _data = subtitle.data.string
-            return _id, _iv, _data
-        else:
-            print "CRUNCHYROLL: --> Couldn't parse XML file."
+        # subtitle = soup.find('subtitle', attrs={'link': None})
+        # if subtitle:
+            # _id = int(subtitle['id'])
+            # _iv = subtitle.find('iv').contents[0]
+            # _data = subtitle.data.string
+            # return _id, _iv, _data
+        # else:
+            # print "CRUNCHYROLL: --> Couldn't parse XML file."
+
+        subsLang = __settings__.getSetting("subsLang")
+        #subsLang 0 will use the language that is set up as default on Crunchyroll account
+        if subsLang == "1":
+            subsLang = "English"
+        if subsLang == "2":
+            subsLang = "Espa"
+        if subsLang == "3":
+            subsLang = "Fran"
+        if subsLang == "4":
+            subsLang = "Portug"
+        
+        if subsLang != "0":
+            subtitleALT = soup.find('subtitles').find('subtitle', { "title" : re.compile(subsLang) })
+            if subtitleALT:
+                print 'CRUNCHYROLL: --> Alternative language subs found: '+subsLang
+                playlist = subtitleALT.get('link')
+
+                opener = urllib2.build_opener()
+                opener.addheaders = [('Referer', 'http://www.crunchyroll.com'),('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')]
+                response = opener.open(playlist)
+                xml = response.read()
+                soup = BeautifulSoup(xml)
+                subtitleALTsoup = soup.find('subtitle')
+
+                if subtitleALTsoup:
+                    _id = int(subtitleALTsoup['id'])
+                    _iv = subtitleALTsoup.find('iv').contents[0]
+                    _data = subtitleALTsoup.data.string
+                    return _id, _iv, _data
+                else:
+                    print "CRUNCHYROLL: --> Couldn't parse subtitle XML file."
+            else:
+                print 'CRUNCHYROLL: --> Alternative language subs NOT found, falling back to the default one instead.'
+                subsLang = "0"
+                
+        if subsLang == "0":
+            subtitle = soup.find('subtitle', attrs={'link': None})
+            if subtitle:
+                _id = int(subtitle['id'])
+                _iv = subtitle.find('iv').contents[0]
+                _data = subtitle.data.string
+                return _id, _iv, _data
+            else:
+                print "CRUNCHYROLL: --> Couldn't parse XML file."
            
    def convertToASS(self, script):
        soup = BeautifulSoup(script, convertEntities=BeautifulSoup.HTML_ENTITIES)
diff --git a/plugin.video.crunchyroll-takeout/resources/settings.xml b/plugin.video.crunchyroll-takeout/resources/settings.xml
index a618114..cb4b2d6 100644
--- a/plugin.video.crunchyroll-takeout/resources/settings.xml
+++ b/plugin.video.crunchyroll-takeout/resources/settings.xml
@@ -9,4 +9,5 @@
     <setting id="thumb_quality" type="enum" lvalues="40002|40003|40004" label="40001" default="1" />
     <setting type="sep" />
     <setting id="useSRTSubs" label="Use unstyled subtitles" type="bool" default="false"/>
+    <setting id="subsLang" type="enum" lvalues="100002|100003|100004|100005|100006" label="100001" default="0" />
</settings>

If you think it could be useful, feel free to use it. Smile


RE: [Release] Crunchyroll Takeout v0.6.5 (March 22nd 2013) - digichikmon - 2013-05-11

my crunchyroll is not working anymore, i have Frodo 12.1 on a computer running win 7(thinkCentre M58)and I did the update from your website and its telling me depencies not met.



I even uninstall my XBMC and it doesn't work but I install on a laptop(win 7ultimate)(Lenovo IdealPad Y560) and is works fine. what should a doHuh


PS: i install XBMC on win 7.


RE: [Release] Crunchyroll Takeout v0.6.5 (March 22nd 2013) - yoshiofthewire - 2013-05-12

After a clean install from 12.2 it appears that the subs has been broken by a removal of crypto code.
I will have to work on that and see if I can fix that.


RE: [Release] Crunchyroll Takeout v0.6.5 (March 22nd 2013) - yoshiofthewire - 2013-05-12

I have pushed a change that should now work under 12.2
Test on 12.2 in Win8


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - bluedoze - 2013-05-13

I'm not sure if this is related, but I added the add-on repo today and XBMC sees it empty


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - yoshiofthewire - 2013-05-13

bluedoze, you just need to refresh the repo.
This is a known issue with frodo


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - bluedoze - 2013-05-16

thanks, it worked fine after that


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - z3r01 - 2013-05-21

i registered just because of this!!!! I EFF-ING LOVE THIS !!!!! THIS IS AWESOME!


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - KaoticRage - 2013-06-04

I am needing some assistance that I'm not finding answers to via search.

I've recently install 2 flavors of XBMC on my Raspberry Pi (http://wiki.xbmc.org/index.php?title=Raspbmc and http://www.openelec.tv/ )

On both of these when I attempted to install the Crunchyroll Takeout plugin via the repository.urlXL zip, but no add-on would show up.
I then went and search and found the direct ZIP file of the add-on on SuperRepo.org.

When trying to install from here I get an error of "Dependencies not met."

Am I doing something wrong? Is there a high amount of space needed for this(the zip file seemed to be less than 1MB when unzipped) Should I be using another OS other than these XBMC flavored OSes? Both are running XBMC 12.2


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - yoshiofthewire - 2013-06-04

When you install the repo you need to manually refresh the repo or nothing shows.
I have NEVER uploaded anything to SuperRepo.org and no nothing of what they are hosting.
Repo pulls prior to current have an issue where the dependencies won't show in 12.2

So yea, you got hit with 2 known bugs. One that is fixed, one that I am unsure of a fix for.


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - KaoticRage - 2013-06-04

This is a super stupid question, but how do I manually refresh? I thought I had been by re-opening it and that it wasn't downing cause of dependencies.

When trying right click and viewing menus I never saw a refresh option.


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - yoshiofthewire - 2013-06-05

In System -> Add-ons -> get Add-ons
Right click on urlXL XBMC Repo and choose Force Refresh


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - KaoticRage - 2013-06-05

Thank you the assistance. I just tried the above and the Force Refresh did not seem to work. I did a "Check for updates" (I am switched to 3.0 of OpenELEC) and after that it finally kicked in and gave me all the information.

Thank you again for the assistance on getting this working.


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - guildeldh - 2013-06-06

Hi!

Is it me or does the latest Naruto (316) not work? Upon closer inspection, it seems like they've changed their CDN?


RE: Crunchyroll Takeout v0.6.5.1 (May 15th 2013) - yoshiofthewire - 2013-06-07

It looks like they changed something and broke streaming (again)
The alternative method is still working. I will look at this when I get a chance,