• 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 46
Broken Crunchyroll [DMCA Takedown]
Lightbulb 
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
Reply
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.
Reply
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.
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
I have pushed a change that should now work under 12.2
Test on 12.2 in Win8
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
I'm not sure if this is related, but I added the add-on repo today and XBMC sees it empty
Reply
bluedoze, you just need to refresh the repo.
This is a known issue with frodo
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
thanks, it worked fine after that
Reply
i registered just because of this!!!! I EFF-ING LOVE THIS !!!!! THIS IS AWESOME!
Reply
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
Reply
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.
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
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.
Reply
In System -> Add-ons -> get Add-ons
Right click on urlXL XBMC Repo and choose Force Refresh
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
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.
Reply
Hi!

Is it me or does the latest Naruto (316) not work? Upon closer inspection, it seems like they've changed their CDN?
Reply
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,
XBMC user since before that Music db hack.
Now with his 2nd DMCA Takedown
Reply
  • 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 46

Logout Mark Read Team Forum Stats Members Help
Crunchyroll [DMCA Takedown]5
This forum uses Lukasz Tkacz MyBB addons.