Ooba svt.st does not wotk
#1
seems lik svt has changed something sins nothing happens when clicking a link in the svt catogory. all categories show upp but when you press a category nothing happends. anny one know how to fix this?

btw in comedy central for exapmle dilbert is only playing for 1 minute is this a bug or a incomplete trailer?


edit: crap why cant you edit topic.....
Reply
#2
try this, and let me know if its working.
edit your menu.xml

was:
Quote:<url><![cdata[^http://svt.se/.*/navigation.jsp]]></url>
<linkpattern>
<pattern><![cdata[<a[^<>]+href="(?p<url>[^<>"]+)"[^<>]*>(?p<title>[^<>]+)</a]]></pattern>
</linkpattern>

is:
Quote:<url><![cdata[^http://svt.se/.*/navigation.jsp]]></url>
<linkpattern>
<pattern><![cdata[<a[^<>]+href="(?p<url>[^<>&"]+)[^<>\d]*(?p<group>[^<>"]*)"[^<>]*>(?p<title>[^<>]+)</a]]></pattern>
<urlformat><![cdata[\g<url>&a=\g<group>]]></urlformat>
</linkpattern>


this seems to work for me, but if any of you regex experts can help us, please be my guest. :d
Reply
#3
i got verry few clip´s to work. the menu navigation isént working correctly, most of the links do not work.
Reply
#4
i looked at this again, and it looks like ooba is really not cleaning up the "&".  so, go ahead and put back the original menu.xml. then open up your ooba.py and paste in the following:


add after line 27:
Quote:import htmllib # to remove &amp, &lt and &gt from url

was line 98:
Quote:##############################

def openurl(url): #set urlcontext before calling if it is a relative url
   win.showtext("reading url\n"+url)

is lines 98:
Quote:##############################
def unescape(url):
   p = htmllib.htmlparser(none)
   p.save_bgn()
   p.feed(url)
   return p.save_end()

def openurl(url): #set urlcontext before calling if it is a relative url
   url = unescape(url) #make crappy & into ampersand
   win.showtext("reading url\n"+url)

make sure when you paste in the above, you use 1 <tab> where there is indented text.
:p
Reply
#5
(swage @ sep. 08 2005,08:16 Wrote:i looked at this again, and it looks like ooba is really not cleaning up the "&".  so, go ahead and put back the original menu.xml. then open up your ooba.py and paste in the following:


add after line 27:
Quote:import htmllib # to remove &amp, &lt and &gt from url

was line 98:
Quote:##############################

def openurl(url): #set urlcontext before calling if it is a relative url
   win.showtext("reading url\n"+url)

is lines 98:
Quote:##############################
def unescape(url):
   p = htmllib.htmlparser(none)
   p.save_bgn()
   p.feed(url)
   return p.save_end()

def openurl(url): #set urlcontext before calling if it is a relative url
   url = unescape(url) #make crappy & into ampersand
   win.showtext("reading url\n"+url)

make sure when you paste in the above, you use 1 <tab> where there is indented text.
:p
nice try, but when you try to watch the reno 911! clips from comedy central it removes all the &'s from the url.
but your attempt was in the right direction though, it gave me the idea to come with this much easier working solution:

i made use of the htmldecode function, which van der phunck defines in his htmlstrip.py file in the system dir.

you only have to change this:
Quote:##############################

def openurl(url): #set urlcontext before calling if it is a relative url
   win.showtext("reading url\n"+url)
to this:
Quote:##############################

def openurl(url): #set urlcontext before calling if it is a relative url
   url = htmlstrip.htmldecode(url)
   win.showtext("reading url\n"+url)

much easier, isn't it......and working for svt and the others like comedy central Smile
Reply
#6
yes, that is much easier. didn't know that i stripped the regular ampersands also, doh!
thanks for the fix.
Reply
#7
fos the lastet "fix" work for you guys? it is werry buggy for me.
cant relly find most of the things i´m looking for in svt, the menus dosent seem to go anywhere.
Reply
#8
Star 
hey guys! i'm a complete noob and need help... i can't seem to get svt.se to work either, even with the fix posted in this thread... i try to start the script, and it just exits... it seems a syntax error appears on line 103, which is

Quote:url = httpfetcher.getfullurl(url)

if i erase that line (since there is a definition of url 2 lines earlier), the syntax error goes on to the next line, etc... i'm sure there is some character missing or something easy, but i have never coded in python and don't know what to put there... can anybody help? please? pretty please?
Reply

Logout Mark Read Team Forum Stats Members Help
Ooba svt.st does not wotk0