def getPageCallback(self, page): movies = [] if page.__contains__("</title>"): page = page[page.index("</title>") + 8:] reonecat = re.compile( r'<title>(.+?)</title>.+?<description>(.+?)</description>.+?<enclosure(.+?)/>.+?', re.DOTALL) for title, description, info in reonecat.findall(page): if title.startswith("<![CDATA["): title = title[9:] if title.endswith("]]>"): title = title[:-3] url = None thumb = None if info.__contains__('url="'): idx = info.index('url="') url = info[idx + 5:] idx = url.index('"') url = url[:idx] if description.__contains__('img src="'): idx = description.index('img src="') thumb = description[idx + 9:] idx = thumb.index('"') thumb = thumb[:idx] if url: movies.append(Movie(encodeUrl(title), url, thumb)) self.callback(movies)
def getPageCallback(self, page): movies = [] reonecat = re.compile(r'<div class="mobile_item">(.+?)</td>', re.DOTALL) for div in reonecat.findall(page): reonecat = re.compile(r'<a href="/player.php(.+?)"><img src="(.+?)" /></a>.+?margin-top: 8px;">(.+?)</div>', re.DOTALL) for url, thumb, name in reonecat.findall(div): movies.append(Movie(name, "http://stream.bangyoulater.com/" + url[3:] + "/mobile.mp4", thumb)) self.callback(movies)
def __init__(self, name, url, thumb): Movie.__init__(self, name, url, thumb)
def __init__(self, name, url, thumb): Movie.__init__(self, name, url, thumb)