Kodi Community Forum

Full Version: [RELEASE] SC2Casts.com plugin - Starcraft 2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Awesome guys, thanks a ton! Wooo!
Since yesterday i get a script failed, when selecting a matchup. I'm using the quickfix, which has worked great. Anyone else? /apan
Yes the quick fix also stopped working for me. I tried reverting to the old script and also the same issue.
It's not the quickfix that's the problem it's recent changes on Youtube that has made the plugin broken. Gonna take a look at it this weekend.

/Krill
Thanks for looking into this Krill Smile

I wish I could help, I'm a Visual Studio guy though and feel lost without an IDE and Debugger though Smile
Hi, All!!!

SC2casts plugin is one of my favorit.
That's why I tried to make it work.

So in file sc2casts.py need to update

Line 203:
Code:
fmtSource = re.findall('"fmt_url_map": "([^"]+)"', link)
Replace with:
Code:
fmtsource = re.findall('"url_encoded_fmt_stream_map": "url=([^"]+)"', link)

Line 204:
Code:
fmt_url_map = urllib.unquote_plus(fmtSource[0]).split('|')
Replace with:
Code:
fmt_url_map = urllib.unquote_plus(fmtsource[0]).split(',url=')

Lines from 207 to 225:
Code:
for fmt_url in fmt_url_map:
            if (len(fmt_url) > 7):
                if (fmt_url.rfind(',') > fmt_url.rfind('&id=')):
                    final_url = fmt_url[:fmt_url.rfind(',')]
                    final_url = final_url.replace('\u0026','&')
                    if (final_url.rfind('itag=') > 0):
                        quality = final_url[final_url.rfind('itag=') + 5:]
                        quality = quality[:quality.find('&')]
                    else:
                        quality = "5"
                    links[int(quality)] = final_url.replace('\/','/')
                else :
                    final_url = fmt_url
                    if (final_url.rfind('itag=') > 0):
                        quality = final_url[final_url.rfind('itag=') + 5:]
                        quality = quality[:quality.find('&')]
                    else :
                        quality = "5"
                    links[int(quality)] = final_url.replace('\/','/')
Replace with:
Code:
for fmt_url in fmt_url_map:
        url = fmt_url.replace('\u0026','&')
        quality = url[url.rfind('&itag=')+6:]
        if(url.find('&itag=')!=url.rfind('&itag=')):
                url = url[:url.rfind('&itag=')]
        if (url.rfind('; codecs')>0):
                url = url[:url.rfind('; codecs')]
        links[int(quality)] = url

Be carefully. Save all formatting tabs in this script.
Enjoy!!!
It works again!!!
And we only waiting official update from Krill. Big Grin
Hi guys!

Sorry that i didn't looked at it last weekend, I was going to take a look tonight after work, but then i saw that our friend Nemo here already found out what the problem was and on top of that posted a solution for the problem =)
Gonna submit the update tonight!

Thx again Nemo! =)
You guys are awesome! Keep up the good work Smile
Am I doing something wrong, mine does not want to update No
Hmm, my XBMC now updates SC2casts plugin to 0.4.4.
And some games not playing (very little number).
Probably my parser not quite good.
I have to analyze.
In plugin settings parameter "Max video quality" must be setted to HD720.
With this value all files are playing fine.
Mine finally updated.

Thanks guys.
I really love this add-on!

Would it be possible to add search options on tournaments, players and casters?

Cheers
Looks like SC2Casts have decided to make more changes to the site breaking most of the link.

I used to code in C, 15 years ago. Would love to give a hand on this. Any easy way to debug this script. I'm so lazy and used to an IDE.
a lot of the videos were causing a script error when i would try to play them (it seemed like 75% of videos did this). it turned out to be due to the video path being incorrect and being prefixed with "url=" No idea where the active repository for this plugin is so i'm just going to post this fix here.

Code:
--- /var/root/sc2casts.py    2011-11-21 13:18:54.000000000 -0800
+++ sc2casts.py    2011-11-21 13:19:06.000000000 -0800
@@ -91,6 +91,7 @@
         # Check if URL is a 'fillUp' URL
         if url != 'fillUp':
             url = self.getVideoUrl(url)
+        url = re.sub("^url=", "", url)
         liz=xbmcgui.ListItem(title, iconImage="DefaultVideo.png", thumbnailImage="DefaultVideo.png")
         liz.setInfo( type="Video", infoLabels={ "Title": title } )
         xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
basically all that says to do is add the following line to line 94 of sc2casts.py
Code:
url = re.sub("^url=", "", url)
This is for version 0.4.4.

On a slightly unrelated note, does anyone know why sc2casts (along with a bunch of other addons) doesn't show up in the Get More repository for me since reloading xbmc on my apple tv?
Pages: 1 2 3 4