pull/15/head
parent
bef19d8c90
commit
c7bcd9c450
2111
.idea/workspace.xml
2111
.idea/workspace.xml
File diff suppressed because it is too large
Load Diff
4
Core.py
4
Core.py
|
@ -991,7 +991,7 @@ class Core:
|
|||
title = title.encode('utf-8', 'ignore')
|
||||
except:
|
||||
continue
|
||||
label = info.get('label').encode('utf-8', 'ignore')
|
||||
log(str(info))
|
||||
|
||||
if info.get('link'):
|
||||
if isinstance(info.get('link'), tuple):
|
||||
|
@ -1112,7 +1112,7 @@ class Core:
|
|||
images = {'icon':image, 'thumb':image}
|
||||
images = {'icon': image, 'thumb': image,
|
||||
'poster': image, 'banner': image,
|
||||
'fanart': image, 'landscape': image,
|
||||
#'fanart': image, 'landscape': image,
|
||||
#'clearart': image, 'clearlogo': image,
|
||||
}
|
||||
listitem.setArt(images)
|
||||
|
|
|
@ -99,27 +99,28 @@ class IMDB(Content.Content):
|
|||
return True
|
||||
|
||||
def get_contentList(self, category, subcategory=None, apps_property=None):
|
||||
self.debug = self.log
|
||||
contentList = []
|
||||
url = self.get_url(category, subcategory, apps_property)
|
||||
|
||||
response = self.makeRequest(url, headers=self.headers)
|
||||
|
||||
if None != response and 0 < len(response):
|
||||
#print response
|
||||
self.debug(response)
|
||||
if category in ['top']:
|
||||
contentList = self.topmode(response)
|
||||
elif category == 'search':
|
||||
contentList = self.searchmode(response)
|
||||
else: #if category in ['genre']:
|
||||
contentList = self.genremode(response)
|
||||
#print str(contentList)
|
||||
self.debug(str(contentList))
|
||||
return contentList
|
||||
|
||||
def searchmode(self, response):
|
||||
contentList = []
|
||||
pars = HTMLParser.HTMLParser()
|
||||
Soup = BeautifulSoup(response)
|
||||
result = Soup.findAll('tr', {'class': ['findResult odd', 'findResult even']})
|
||||
result = Soup.findAll('tr', {'class': 'lister-item mode-advanced'})
|
||||
num = 250
|
||||
for tr in result:
|
||||
#main
|
||||
|
@ -147,7 +148,7 @@ class IMDB(Content.Content):
|
|||
int(int(self.sourceWeight) * (251 - int(num))),
|
||||
originaltitle, title, int(year), img, info,
|
||||
))
|
||||
#print result
|
||||
self.debug(str(result))
|
||||
return contentList
|
||||
|
||||
def genremode(self, response):
|
||||
|
@ -181,7 +182,7 @@ class IMDB(Content.Content):
|
|||
int(int(self.sourceWeight) * (251 - int(num))),
|
||||
originaltitle, title, int(year), img, info,
|
||||
))
|
||||
#print result
|
||||
self.debug(str(result))
|
||||
return contentList
|
||||
|
||||
def biggerImg(self, img):
|
||||
|
|
|
@ -21,20 +21,23 @@ def shelf(filename, ttl=0):
|
|||
with LOCKS.get(filename, threading.RLock()):
|
||||
# with closing(shelve.open(filename, writeback=True)) as d:
|
||||
d = shelve.open(filename, writeback=True)
|
||||
try:
|
||||
#try:
|
||||
if True:
|
||||
import time
|
||||
if not dict(d):
|
||||
log('xxx')
|
||||
d.update({
|
||||
"created_at": time.time(),
|
||||
"data": {},
|
||||
})
|
||||
elif ttl > 0 and (time.time() - d["created_at"]) > ttl:
|
||||
log('xxx')
|
||||
d["created_at"] = time.time()
|
||||
d["data"] = {}
|
||||
return d
|
||||
except:
|
||||
d.close()
|
||||
raise
|
||||
#except:
|
||||
# d.close()
|
||||
# raise
|
||||
|
||||
_config = {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue