Beispiel #1
0
	def ofdb_search(self, data, search_title, path):
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.display_delay()
			self.run10 = "true"

		if re.match('.*?<rcodedesc>Ok.*?', data, re.S):
			bild = re.findall('<bild>(.*?)</bild', data)
			movie_title = re.findall('<titel>(.*?)</titel>', data)
			if bild:
				if bild[0] == "http://img.ofdb.de/film/na.gif":
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)
				else:
					#os.system("wget %s -O '%s'" % (bild[0], path))
					urllib.urlretrieve(bild[0], path)
					if os.path.exists(path):
						self.display_download(movie_title[0], search_title, path)
					else:
						print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
						self.display_na(search_title, path)
			else:
				print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
				self.display_na(search_title, path)
		else:
			print "EMC iMDB: ofdb.de is down or No results found - %s" % search_title
			self.display_na(search_title, path)
	def ofdb_search(self, data, search_title, path):
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.display_delay()
			self.run10 = "true"

		if re.match('.*?<rcodedesc>Ok.*?', data, re.S):
			bild = re.findall('<bild>(.*?)</bild', data)
			movie_title = re.findall('<titel>(.*?)</titel>', data)
			if bild:
				if bild[0] == "http://img.ofdb.de/film/na.gif":
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)
				else:
					os.system("wget %s -O '%s'" % (bild[0], path))
					if os.path.exists(path):
						self.display_download(movie_title[0], search_title, path)
					else:
						print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
						self.display_na(search_title, path)
			else:
				print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
				self.display_na(search_title, path)
		else:
			print "EMC iMDB: ofdb.de is down or No results found - %s" % search_title
			self.display_na(search_title, path)
Beispiel #3
0
	def csfd_search(self, data, search_title, path):
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB - csfd: 10sec. DelayFunction gestatet"
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.display_delay()
			self.run10 = "true"

		if re.match('.*?Error 503 Service Unavailable|.*?500 Internal Server Error', data, re.S):
			print "EMC iMDB - csfd 1 : CSFD.cz is down or No results found - %s" % search_title
			self.display_na(search_title, path)
		else:
			movie_search = re.findall('<img src=\"(//img.csfd.cz/files/images/film/posters/.*?|//img.csfd.cz/posters/.*?)\".*?<h3 class="subject"><a href=.*?class="film c.">(.*?)</a>.*?</li>', data, re.DOTALL | re.IGNORECASE)
			if movie_search:
				poster_url = "http:" + movie_search[0][0]
				movie_title = movie_search[0][1]
				print "EMC csfd: Download", search_title, poster_url
				#os.system("wget %s -O '%s'" % (poster_url, path))
				urllib.urlretrieve(poster_url, path)
				if os.path.exists(path):
					self.display_download(movie_title, search_title, path)
				else:
					print "EMC iMDB - csfd: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)
			else:
				movie_search = re.findall('<img src=\"(//img.csfd.cz/files/images/film/posters/.*?|//img.csfd.cz/posters/.*?)" alt="poster"', data, re.DOTALL | re.IGNORECASE)
				if movie_search:
					title_s = re.findall('<title>(.*?)\|', data, re.S)
					if title_s:
						if title_s[0] != "Vyhled\xc3\xa1v\xc3\xa1n\xc3\xad ":
							movie_title = title_s[0]
						else:
							movie_title = search_title
					else:
						movie_title = search_title
					poster_url = "http:" + movie_search[0]
					print "EMC csfd: Download", search_title, poster_url
					#os.system("wget %s -O '%s'" % (poster_url, path))
					urllib.urlretrieve(poster_url, path)
					if os.path.exists(path):
						self.display_download(movie_title, search_title, path)
					else:
						print "EMC iMDB - csfd 3 : CSFD.cz is down or No results found - %s" % search_title
						self.display_na(search_title, path)
				else:
					print "EMC iMDB - csfd 2 : CSFD.cz is down or No results found - %s" % search_title
					self.display_na(search_title, path)
		self['menulist'].l.setList(self.menulist)
		self['menulist'].l.setItemHeight(28)
	def imdbapi(self, data, search_title, path):
		self.counter_a += 1
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			self.display_delay()
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.run10 = "true"
		
		### Parsing infos from data ###
		if re.match('.*?"Response":"True"', data):
			movie_name = re.findall('"Title":"(.*?)"."Year":"(.*?)"', data)
			movie_title = str(movie_name[0][0]) + " " + str(movie_name[0][1])
			poster_url = re.findall('"Poster":"(.*?)"', data)
			if poster_url[0] == "N/A":
				print "EMC iMDB: theimdbapi.com is down or No results found - %s" % search_title
				self.display_na(search_title, path)
			else:
				print "EMC iMDB: theimdbapi.com Download", search_title, poster_url[0]
				### Cover Download ###

				### download durch urlib
				#urllib._urlopener = AppURLopener()
				#urllib.urlretrieve(poster_url[0], path)
				#urllib.urlcleanup()

				### twisted downloadPage part
				#downloadPage(poster_url[0], path).addCallback(self.download_file, movie_title, search_title, path).addErrback(self.errorLoad)

				### download durch wget
				#os.system("wget %s -O '%s'" % (poster_url[0], path))
				urllib.urlretrieve(poster_url[0], path)
				if os.path.exists(path):
					self.display_download(movie_title, search_title, path)
				else:
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)

		elif re.match('.*?"Response":"Parse Error"', data):
			print "EMC iMDB: theimdbapi.com is down or No results found - %s" % search_title
			self.display_na(search_title, path)

		self["menulist"].l.setList(self.menulist)
		self["menulist"].l.setItemHeight(28)
Beispiel #5
0
	def imdbapi(self, data, search_title, path):
		self.counter_a += 1
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			self.display_delay()
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.run10 = "true"
		
		### Parsing infos from data ###
		if re.match('.*?"Response":"True"', data):
			movie_name = re.findall('"Title":"(.*?)"."Year":"(.*?)"', data)
			movie_title = str(movie_name[0][0]) + " " + str(movie_name[0][1])
			poster_url = re.findall('"Poster":"(.*?)"', data)
			if poster_url[0] == _("N/A"):
				print "EMC iMDB: theimdbapi.com is down or No results found - %s" % search_title
				self.display_na(search_title, path)
			else:
				print "EMC iMDB: theimdbapi.com Download", search_title, poster_url[0]
				### Cover Download ###

				### download durch urlib
				#urllib._urlopener = AppURLopener()
				#urllib.urlretrieve(poster_url[0], path)
				#urllib.urlcleanup()

				### twisted downloadPage part
				#downloadPage(poster_url[0], path).addCallback(self.download_file, movie_title, search_title, path).addErrback(self.errorLoad)

				### download durch wget
				#os.system("wget %s -O '%s'" % (poster_url[0], path))
				urllib.urlretrieve(poster_url[0], path)
				if os.path.exists(path):
					self.display_download(movie_title, search_title, path)
				else:
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)

		elif re.match('.*?"Response":"Parse Error"', data):
			print "EMC iMDB: theimdbapi.com is down or No results found - %s" % search_title
			self.display_na(search_title, path)

		self["menulist"].l.setList(self.menulist)
		self["menulist"].l.setItemHeight(28)
	def themoviedb(self, data, search_title, path):
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.display_delay()
			self.run10 = "true"
		### Parsing infos from data ###
		if re.match('.*?<movies>Nothing found.</movies>|.*?<opensearch:totalResults>0</opensearch:totalResults>|.*?Error 503 Service Unavailable|.*?500 Internal Server Error', data, re.S):
			print "EMC iMDB: Themoviedb.org is down or No results found - %s" % search_title
			self.display_na(search_title, path)
		else:
			movie_title = re.findall('<name>(.*?)</name>', data)
			poster_url = re.findall('<image type="poster" url="(.*?)" size="cover"', data)
			if poster_url:
				print "EMC themoviedb: Download", search_title, poster_url[0]
				### Cover Download ###

				### download durch urllib
				#urllib._urlopener = AppURLopener()
				#urllib.urlretrieve(poster_url[0], path)
				#urllib.urlcleanup()

				### download durch wget
				#os.system("wget %s -O '%s'" % (poster_url[0], path))
				urllib.urlretrieve(poster_url[0], path)
				if os.path.exists(path):
					self.display_download(movie_title[0], search_title, path)
				else:
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)
			else:
				print "EMC iMDB: Themoviedb.org is down or No results found - %s" % search_title
				self.display_na(search_title, path)

		self["menulist"].l.setList(self.menulist)
		self["menulist"].l.setItemHeight(28)
Beispiel #7
0
	def themoviedb(self, data, search_title, path):
		if self.search_list and self.run10 == "false":
			#and self.counter_a % 10 == 0:
			print "EMC iMDB: 10sec. DelayFunction gestatet"
			DelayedFunction(10000 - int(time.time() - self.starttime) + 100, boundFunction(self.imdb_start))
			self.display_delay()
			self.run10 = "true"
		### Parsing infos from data ###
		if re.match('.*?<movies>Nothing found.</movies>|.*?<opensearch:totalResults>0</opensearch:totalResults>|.*?Error 503 Service Unavailable|.*?500 Internal Server Error', data, re.S):
			print "EMC iMDB: Themoviedb.org is down or No results found - %s" % search_title
			self.display_na(search_title, path)
		else:
			movie_title = re.findall('<name>(.*?)</name>', data)
			poster_url = re.findall('<image type="poster" url="(.*?)" size="cover"', data)
			if poster_url:
				print "EMC themoviedb: Download", search_title, poster_url[0]
				### Cover Download ###

				### download durch urllib
				#urllib._urlopener = AppURLopener()
				#urllib.urlretrieve(poster_url[0], path)
				#urllib.urlcleanup()

				### download durch wget
				#os.system("wget %s -O '%s'" % (poster_url[0], path))
				urllib.urlretrieve(poster_url[0], path)
				if os.path.exists(path):
					self.display_download(movie_title[0], search_title, path)
				else:
					print "EMC iMDB: Film gefunden aber kein poster vorhanden - %s" % search_title
					self.display_na(search_title, path)
			else:
				print "EMC iMDB: Themoviedb.org is down or No results found - %s" % search_title
				self.display_na(search_title, path)

		self["menulist"].l.setList(self.menulist)
		self["menulist"].l.setItemHeight(28)