[mythtvnz] Hack to get tmdb.py working

Jason Taylor killerkiwi2005 at gmail.com
Wed Jul 21 12:40:06 BST 2010


Heres a hack to get movie art working again.. looks like theres a
redirect happening that myth cant handle

file:
/usr/share/mythtv/mythvideo/scripts/Movie/tmdb.py

replace the method below:

    def displayMovieData(self, data):
        '''Display movie data to stdout
        '''
        if data == None:
            return
        data_keys = data.keys()
        data_keys_org = data.keys()
        for index in range(len(data_keys)):
            data_keys[index] = data_keys[index].replace(u' ',u'').lower()

        for key in self.mythtvgrabber:
            if  key.lower() in data_keys:
		if key.lower() in ["coverart", "fanart"]:
			d = data[data_keys_org[data_keys.index(key.lower())]]
			urls = []
			for url in d.split(","):
				import urllib2
				ufile = urllib2.urlopen(url)  ## get file-like object for url
				urls.append(ufile.geturl())
				# Myth only uses the first one anyway so break out
				break
	
			sys.stdout.write(u"%s:%s\n" % (key, urls))
		else:			
	                sys.stdout.write(u"%s:%s\n" % (key,
data[data_keys_org[data_keys.index(key.lower())]]))

        mythtvgrabber = []
        for item in self.mythtvgrabber:
            mythtvgrabber.append(item.lower())
        for key in data_keys:
            if not key in mythtvgrabber:
                sys.stdout.write(u"%s:%s\n" %
(self.camelcase(data_keys_org[data_keys.index(key)]),
data[data_keys_org[data_keys.index(key)]]))
    # end displayMovieData(()

And it works again

-- 
"Weekends don't count unless you spend them doing something completely
pointless. " - Calven



More information about the mythtvnz mailing list