[RELEASE] PowerFLV.com (Video) Plugin

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
plex Offline
Senior Member
Posts: 107
Joined: Mar 2008
Reputation: 0
Post: #91
where'd you get this:
Code:
    lookup={"_":"b", "I":"t", "J":"w", "K":"v", "M":"p", "N":"s", "P":"m", "Q":"l", "R":"o", "T":"i", "U":"h", "X":"e", "Y":"d", "Z":"g", "%04":"9", "%05":"8", "%07":":", "%08":"5", "%09":"4", "%0A":"7", "%0B":"6", "%0C":"1", "%0D":"0", "%0E":"3", "%0F":"2", "%12":"/", "%13":".", "%5B":"f", "%5C":"a", "%5E":"c"}

Spread the knowledge, nothing else.[Image: b.gif]
find quote
plex Offline
Senior Member
Posts: 107
Joined: Mar 2008
Reputation: 0
Post: #92
n/m...

Spread the knowledge, nothing else.[Image: b.gif]
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #93
Well here`s my code with Basjes` Megavideo Algo. I know that Megavideo streams run in XOT perfectly. But i still cannot get the stream appended to the res list. It will not enter through to the link stage. Must be something simple.
[CODE]
#################################
# sniffs & decodes megavideo url
################################

def decode (url,data):
if url.find("megavideo.com")>0:
codeRegex='addVariable\("flv","([^"]+)"\)'
codeResults = re.findall(codeRegex, data, re.DOTALL + re.IGNORECASE)
if len(codeResults)>0:
code=codeResults[-1]
dictionary = {"_": "b", "I": "t", "J": "w", "K": "v", "M": "p", "N": "s", "P": "m", "Q": "l", "R": "o", "T": "i", "U": "h", "X": "e", "Y": "d", "Z": "g", "%04": "9", "%05": "8", "%07": ":", "%08": "5", "%09": "4", "%0A": "7", "%0B": "6", "%0C": "1", "%0D": "0", "%0E": "3", "%0F": "2", "%12": "/", "%13": ".", "%5B": "f", "%5C": "a", "%5E": "c"}
return ReplaceDictionary(code,dictionary)
else:
return "No Video Link Found."

def ReplaceDictionary (string,dictionary):
rc=re.compile('|'.join(map(re.escape, dictionary)))
def Translate(match):
return dictionary[match.group(0)]
return rc.sub(Translate, string)

########################################################
# Gets Megavideo links & shortens them before decoding.#
########################################################


def getMegavideo(a):
res=[]
p=re.compile(r'<iframe src=\"(http://.+?)"')
match=p.findall(a)
for a in match:
res.append(a)
return res
#if len(a)>=80:
#a=a[:-45]
#code=re.sub('v/','?v=',a)
#sniff=urllib.urlopen(code)
#result1=sniff.read()
#sniff.close()
#link=ExtractMediaUrl(code,result1)
#res.append(a)
#return res
#else:
#if len(a)==35:
#sniff2=urllib.urlopen(a)
#result2=sniff2.read()
#sniff2.close()
#link2=ExtractMediaUrl(a,result2)
#res.append(a)

#return res

[CODE]

Hope that you could get this to append the Vidlinks, it`s really winding me up.

Voinage.
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #94
sorry missed the backslash off the last code tag.
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #95
Code:
#################################
# sniffs & decodes megavideo url
################################

def decode (url,data):
        if url.find("megavideo.com")>0:
                codeRegex='addVariable\("flv","([^"]+)"\)'
                codeResults = re.findall(codeRegex, data, re.DOTALL + re.IGNORECASE)
                if len(codeResults)>0:
                        code=codeResults[-1]
                        dictionary = {"_": "b", "I": "t", "J": "w", "K": "v", "M": "p", "N": "s", "P": "m", "Q": "l", "R": "o", "T": "i", "U": "h", "X": "e", "Y": "d", "Z": "g", "%04": "9", "%05": "8", "%07": ":", "%08": "5", "%09": "4", "%0A": "7", "%0B": "6", "%0C": "1", "%0D": "0", "%0E": "3", "%0F": "2", "%12": "/", "%13": ".", "%5B": "f", "%5C": "a", "%5E": "c"}
                        return ReplaceDictionary(code,dictionary)
                else:
                        return "No Video Link Found."

def ReplaceDictionary (string,dictionary):
        rc=re.compile('|'.join(map(re.escape, dictionary)))
        def Translate(match):
                return dictionary[match.group(0)]
        return rc.sub(Translate, string)
        
########################################################
# Gets Megavideo links & shortens them before decoding.#
########################################################


def getMegavideo(a):
        res=[]
        p=re.compile(r'<iframe src=\"(http://.+?)"')
        match=p.findall(a)
        for a in match:
                
                if len(a)>=80:
                        a=a[:-45]
                        code=re.sub('v/','?v=',a)
                        sniff=urllib.urlopen(code)
                        result1=sniff.read()
                        sniff.close()
                        link=ExtractMediaUrl(code,result1)
                        res.append(link)
                        return res
                else:
                        if len(a)==35:
                                sniff2=urllib.urlopen(a)
                                result2=sniff2.read()
                                sniff2.close()
                                link2=ExtractMediaUrl(a,result2)
                                res.append(link2)

                                return res

Formatted.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #96
i take it a is always >=80 or ==35?

you could use a try/except catch around the for block to make sure it's not erroring and being caught somewhere else.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #97
Code:
for a in match:
        
            if len(a)>79:
                a=a[:-45]
                code=re.sub('v/','?v=',a)
                sniff=urllib.urlopen(code)
                result1=sniff.read()
                sniff.close()
                res=ExtractMediaUrl(code,result1)
                #return res
            else:
            
            
        
                if len(a)<37:
                    res=[]
                    sniff2=urllib.urlopen(a)
                    result2=sniff2.read()
                    res=ExtractMediaUrl(a,result2)
                #return res

Throwing an error over the length of some links, guess i was too tired the other night.

Thanks NukaCool
find quote
plex Offline
Senior Member
Posts: 107
Joined: Mar 2008
Reputation: 0
Post: #98
Voinage if you want to play a megavideo flv stream add a / to it on the latest unstable build of xbmc

OR on the not so latest build
add a /index.flv

I made a thread about this that no one bothered to read.

Spread the knowledge, nothing else.[Image: b.gif]
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #99
It`s okay plex, It wasn`t the fact that i needed to play megavideo stream.
Just wanted to add it to the power flv plugin, because of the blood +, DearS, and Claymore
vids in the anime section.

Well i`ve done it anyway. haha

Just tested and streamed Blood+,Claymore and Dears very merrily.

will tidy up plugin and repost.

Thanks for putting up with the moaning.

Voinage
find quote
plex Offline
Senior Member
Posts: 107
Joined: Mar 2008
Reputation: 0
Post: #100
Here's a unsolved megavideo problem:
http://forum.xbmc.org/showthread.php?tid=32358

Spread the knowledge, nothing else.[Image: b.gif]
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #101
Well here is a half finished powerflv - it runs Megavideo perfectly.

Only problem is you can`t get any links other than Megavideo.
It throws out a TypeError: Iteration over non sequence and won`t collect other links.

I`ve tried catching it, try,except etc but all to no avail.

Tried changing the def of Megavideo at least 8 times and now I need help to integrate Megavideo and keep the other links working. Also if someone could point out my error so i can learn from it I`d be most grateful.

Thanks, Voin.
http://www.megaupload.com/?d=J4EG4YAJ
find quote
Voinage Offline
Banned
Posts: 846
Joined: Mar 2008
Location: England
Post: #102
The Megavideo test files are: Claymore and Blood+ in Anime
Tv - Absolutely fabulous.
And a quite few of the movies.
find quote
Post Reply