2007-11-19, 18:18
I got thumbnails to work with the following changes in videos.py:
Code:
def get_list( self,movieList ):
try:
ok = True
thumbnailDownloadList = []
path = os.path.join(os.getcwd()[:-1] , "user_data" )
#very ugly
#download thumbnail first
for movie in movieList:
thumb_url = self.get_largest_thumbnail(movie)
#id = movie.id.text.split("/")[-1]
#imgFileName = self.getFileThumbPath('%s.jpg'%(id))
#dl = downloadURL(thumb_url, imgFileName)
thumbnailDownloadList.append(thumb_url)
#dl.start()
#populate the list first
i=0
for movie in movieList:
#thumbnailDownloadList[i].join()
i+=1
title = movie.title.text
id = movie.id.text.split("/")[-1]
movie_url = movie.link[1].href
imgFileName = thumbnailDownloadList[i]#self.getFileThumbPath('%s.jpg'%(id))
ok = self.addLink(title,movie_url,imgFileName,movieList)
if ( not ok ): raise
except:
print "Error"