Exemplo n.º 1
0
    def scraper(self):
        # Fetch SourceCode
        sourceCode = urlhandler.urlread(plugin["url"], 14400)  # TTL = 4 Hours

        # Set Content Properties
        self.set_sort_methods(self.sort_method_unsorted)

        # Fetch and Return VideoItems
        return self.regex_scraper(sourceCode)
Exemplo n.º 2
0
	def scraper(self):
		# Fetch SourceCode
		sourceCode = urlhandler.urlread(plugin["url"], 14400) # TTL = 4 Hours
		
		# Set Content Properties
		self.set_sort_methods(self.sort_method_unsorted)
		
		# Fetch and Return VideoItems
		return self.regex_scraper(sourceCode)
Exemplo n.º 3
0
	def scraper(self):
		# Fetch SourceCode
		sourceCode = urlhandler.urlread(self.regex_selector(), 14400) # TTL = 4 Hours
		self.cacheToDisc= True
		
		# Set Content Properties
		self.set_sort_methods(self.sort_method_program_count)
		
		# Fetch and Return VideoItems
		return self.regex_scraper(sourceCode)
Exemplo n.º 4
0
	def find_video(self, TTL=57600):
		# Fetch Page Source
		sourceCode = urlhandler.urlread(plugin["url"], TTL, stripEntity=False)
		
		# Look for Youtube Video First
		try: videoId = [part for part in re.findall('src="(http://www.youtube.com/embed/\S+?)"|file:\s+\'(\S+?)\'', sourceCode)[0] if part][0]
		except: return None
		else:
			if u"metalvideo.com" in videoId: return videoId
			elif u"youtube.com" in videoId: return self.sourceType(videoId, "youtube_com")
Exemplo n.º 5
0
    def scraper(self):
        # Fetch html source
        #url = u"http://metalvideo.com/topvideos.php"
        url = u"http://metalvideo.com/topvideos.html"
        sourceCode = urlhandler.urlread(url, 604800)  # TTL = 1 Week

        # Add Extra Items
        _plugin = plugin
        _add_item = self.add_item
        self.icon = icon = _plugin.getIcon()
        _thumb = (icon, 0)
        #_add_item(label=_plugin.getuni(30104), thumbnail=_thumb, url={"action":"PlayVideo", "url":u"http://metalvideo.com/index.php"}, isPlayable=True)
        _add_item(label=_plugin.getuni(30104),
                  thumbnail=_thumb,
                  url={
                      "action": "PlayVideo",
                      "url": u"http://metalvideo.com/index.html"
                  },
                  isPlayable=True)
        #_add_item(label=_plugin.getuni(30105), thumbnail=_thumb, url={"action":"Watching", "url":u"http://metalvideo.com/index.php"}, isPlayable=False)
        _add_item(label=_plugin.getuni(30105),
                  thumbnail=_thumb,
                  url={
                      "action": "Watching",
                      "url": u"http://metalvideo.com/index.html"
                  },
                  isPlayable=False)
        _add_item(label=_plugin.getuni(30103),
                  thumbnail=_thumb,
                  url={
                      "action": "PlayVideo",
                      "url": u"http://metalvideo.com/randomizer.php"
                  },
                  isPlayable=True)
        #_add_item(label=_plugin.getuni(30102), thumbnail=_thumb, url={"action":"TopVideos", "url":u"http://metalvideo.com/topvideos.php"}, isPlayable=False)
        _add_item(label=_plugin.getuni(30102),
                  thumbnail=_thumb,
                  url={
                      "action": "TopVideos",
                      "url": u"http://metalvideo.com/topvideos.html"
                  },
                  isPlayable=False)
        #_add_item(label=_plugin.getuni(32941), thumbnail=("recent.png",2), url={"action":"NewVideos", "url":u"http://metalvideo.com/newvideos.php"}, isPlayable=False)
        _add_item(label=_plugin.getuni(32941),
                  thumbnail=("recent.png", 2),
                  url={
                      "action": "NewVideos",
                      "url": u"http://metalvideo.com/newvideos.html"
                  },
                  isPlayable=False)
        self.add_search("VideoList",
                        "http://metalvideo.com/search.php?keywords=%s")

        # Fetch and Return VideoItems
        return self.regex_scraper(sourceCode)
Exemplo n.º 6
0
	def regex_selector(self):
		_plugin = plugin
		# Fetch SourceCode
		url = _plugin["url"]
		sourceCode = urlhandler.urlread(url, 604800) # TTL = 1 Week
		
		# Fetch list of Top Video Category
		topLists = [part for part in re.findall('<option value="(\S+?)"\s*>\s*(.+?)\s*</option>', sourceCode) if not u"Select one" in part[1]]
		titleList = [part[1] for part in topLists]
		
		# Display list for Selection
		ret = _plugin.dialogSelect(_plugin.getuni(30101), titleList)
		if ret >= 0: return topLists[ret][0]
		else: raise _plugin.ScraperError(0, "User Has Quit the Top Display")
Exemplo n.º 7
0
	def scraper(self):
		# Fetch html source
		url = u"http://metalvideo.com/mobile/category.html"
		sourceCode = urlhandler.urlread(url, 604800, headers={"Cookie":"COOKIE_DEVICE=mobile"}, userAgent=2) # TTL = 1 Week
		
		# Add Extra Items
		_plugin = plugin
		_add_item = self.add_item
		self.icon = icon = _plugin.getIcon()
		_thumb = (icon,0)
		_add_item(label=_plugin.getuni(30104), thumbnail=_thumb, url={"action":"PlayVideo", "url":u"http://metalvideo.com/index.html"}, isPlayable=True)
		_add_item(label=_plugin.getuni(30105), thumbnail=_thumb, url={"action":"Watching", "url":u"http://metalvideo.com/index.html"}, isPlayable=False)
		_add_item(label=_plugin.getuni(30103), thumbnail=_thumb, url={"action":"PlayVideo", "url":u"http://metalvideo.com/randomizer.php"}, isPlayable=True)
		_add_item(label=_plugin.getuni(30102), thumbnail=_thumb, url={"action":"TopVideos", "url":u"http://metalvideo.com/topvideos.html"}, isPlayable=False)
		_add_item(label=_plugin.getuni(32941), thumbnail=("recent.png",2), url={"action":"NewVideos", "url":u"http://metalvideo.com/newvideos.html"}, isPlayable=False)
		self.add_search("VideoList", "http://metalvideo.com/search.php?keywords=%s")
		
		# Fetch and Return VideoItems
		return self.regex_scraper(sourceCode)