1 # mp4porn plugin by AliAbdul
2 from Plugin import Movie, Plugin
5 ##################################################
7 class MP4PornMovie(Movie):
8 def __init__(self, name, url, thumb):
9 Movie.__init__(self, name, url, thumb)
11 def getVideoUrl(self):
13 data = urllib2.urlopen(self.url).read()
16 reonecat = re.compile(r'\| <a href="(.+?).m4v"')
17 list = reonecat.findall(data)
18 if list and len(list) > 0:
19 return "%s%s" % (list[0], ".m4v")
23 ##################################################
25 class MP4Porn(Plugin):
27 self.moreEntries = True
28 Plugin.__init__(self, "mp4porn.mobi", "mp4porn.png")
30 def getEntries(self, callback, currPage=1):
31 self.currPage = currPage
32 self.callback = callback
33 self.getPage("http://mp4porn.mobi/page/%d/" % self.currPage)
35 def getPageCallback(self, page):
37 reonecat = re.compile(r'<div class="post" onclick="location.href=(.+?)"> <div class="thumb"><a href="(.+?)"><img src="(.+?)" width="120" height="90" alt="(.+?)" />', re.DOTALL)
\r
38 for unneeded, url, thumb, name in reonecat.findall(page):
39 movies.append(MP4PornMovie(name, url, thumb))
42 def getMoreEntries(self):
44 self.getEntries(self.callback, self.currPage+1)
46 def getPageError(self, error=None):
47 if error and self.currPage == 1:
48 print "[%s] Error: %s" % (self.name, error)
50 self.moreEntries = False
52 ##################################################