本文整理汇总了Python中resources.lib.modules.cache.get函数的典型用法代码示例。如果您正苦于以下问题:Python get函数的具体用法?Python get怎么用?Python get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: root
def root(self):
self.addDirectoryItem(30001, 'movieNavigator', 'movies.png', 'DefaultMovies.png')
self.addDirectoryItem(30002, 'tvNavigator', 'tvshows.png', 'DefaultTVShows.png')
self.addDirectoryItem(30003, 'channels', 'channels.png', 'DefaultMovies.png')
if not control.setting('lists.widget') == '0':
self.addDirectoryItem(30004, 'myNavigator', 'userlists.png', 'DefaultVideoPlaylists.png')
if not control.setting('movie.widget') == '0':
self.addDirectoryItem(30005, 'movieWidget', 'latest-movies.png', 'DefaultRecentlyAddedMovies.png', queue=True)
if (traktIndicators == True and not control.setting('tv.widget.alt') == '0') or (traktIndicators == False and not control.setting('tv.widget') == '0'):
self.addDirectoryItem(30006, 'tvWidget', 'latest-episodes.png', 'DefaultRecentlyAddedEpisodes.png', queue=True)
if not control.setting('calendar.widget') == '0':
self.addDirectoryItem(30007, 'calendars', 'calendar.png', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30008, 'toolNavigator', 'tools.png', 'DefaultAddonProgram.png')
downloads = True if control.setting('downloads') == 'true' and (len(control.listDir(control.setting('movie.download.path'))[0]) > 0 or len(control.listDir(control.setting('tv.download.path'))[0]) > 0) else False
if downloads == True:
self.addDirectoryItem(30010, 'downloadNavigator', 'downloads.png', 'DefaultFolder.png')
self.addDirectoryItem(30009, 'searchNavigator', 'search.png', 'DefaultFolder.png')
self.endDirectory()
from resources.lib.modules import cache
from resources.lib.modules import changelog
cache.get(changelog.get, 600000000, control.addonInfo('version'), table='changelog')
开发者ID:shannah,项目名称:exodus,代码行数:30,代码来源:navigator.py
示例2: request
def request(url, post=None, headers=None, mobile=False, safe=False, timeout='30'):
try:
try: headers.update(headers)
except: headers = {}
agent = cache.get(cloudflareAgent, 168)
if not 'User-Agent' in headers: headers['User-Agent'] = agent
u = '%s://%s' % (urlparse.urlparse(url).scheme, urlparse.urlparse(url).netloc)
cookie = cache.get(cloudflareCookie, 168, u, post, headers, mobile, safe, timeout)
result = client.request(url, cookie=cookie, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout, output='response', error=True)
if result[0] == '503':
agent = cache.get(cloudflareAgent, 0) ; headers['User-Agent'] = agent
cookie = cache.get(cloudflareCookie, 0, u, post, headers, mobile, safe, timeout)
result = client.request(url, cookie=cookie, post=post, headers=headers, mobile=mobile, safe=safe, timeout=timeout)
else:
result= result[1]
return result
except:
return
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:27,代码来源:cloudflare.py
示例3: episode
def episode(self, url, imdb, tvdb, title, premiered, season, episode):
try:
data = urlparse.parse_qs(url)
data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])
t = cleantitle.get(data['tvshowtitle'])
title = data['tvshowtitle']
season = '%01d' % int(season) ; episode = '%01d' % int(episode)
year = re.findall('(\d{4})', premiered)[0]
years = [str(year), str(int(year)+1), str(int(year)-1)]
r = cache.get(self.ymovies_info_season, 720, title, season)
r = [(i[0], re.findall('(.+?)\s+(?:-|)\s+season\s+(\d+)$', i[1].lower())) for i in r]
r = [(i[0], i[1][0][0], i[1][0][1]) for i in r if i[1]]
r = [i[0] for i in r if t == cleantitle.get(i[1]) and season == '%01d' % int(i[2])][:2]
r = [(i, re.findall('(\d+)', i)[-1]) for i in r]
for i in r:
try:
y, q = cache.get(self.ymovies_info, 9000, i[1])
if not y == year: raise Exception()
return urlparse.urlparse(i[0]).path + '?episode=%01d' % int(episode)
except:
pass
except:
return
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:26,代码来源:ymovies.py
示例4: persons
def persons(self, url):
if url == None:
self.list = cache.get(self.imdb_person_list, 24, self.personlist_link)
else:
self.list = cache.get(self.imdb_person_list, 0, url)
for i in range(0, len(self.list)): self.list[i].update({'action': 'movies'})
self.addDirectory(self.list)
return self.list
开发者ID:EdLogan18,项目名称:logan-repository,代码行数:9,代码来源:movies.py
示例5: get_fanart
def get_fanart(self, i):
try:
if self.list[i]['status'] is 0:
self.list[i].update(cache.get(masterani.get_anime_details, 150, self.list[i]['anime_id']))
elif self.list[i]['status'] != 0 or 'title' not in self.list[i]:
self.list[i].update(cache.get(masterani.get_anime_details, 12, self.list[i]['anime_id']))
return self.list
except:
return None
开发者ID:varunrai,项目名称:Masterani-Redux,代码行数:9,代码来源:animeshows.py
示例6: addDownload
def addDownload(name, url, image, resolved=False):
if resolved:
resolved = url
try:
def download(): return []
result = cache.get(download, 600000000, table='rel_dl')
result = [i['name'] for i in result]
except:
pass
if name in result:
return control.infoDialog('Stavka je već dodana u red čekanja', name)
try:
if not resolved:
import urlresolver
resolved = urlresolver.resolve(url)
except:
return control.infoDialog('Unplayable stream')
pass
try:
u = resolved.split('|')[0]
try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
except: headers = dict('')
ext = os.path.splitext(urlparse.urlparse(u).path)[1][1:].lower()
if ext == 'm3u8': raise Exception()
#if not ext in ['mp4', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4'
try: name = name.decode('utf-8')
except: pass
name=re.sub('[^-a-zA-Z0-9_.() ]+', '', name)
name=name.rstrip('.')
dest = name + '.' + ext
req = urllib2.Request(u, headers=headers)
resp = urllib2.urlopen(req, timeout=30)
size = int(resp.headers['Content-Length'])
size = ' %.2f GB' % (float(size) / 1073741824)
no = control.yesnoDialog(dest, 'Veličina datoteke je ' + size, 'Nastaviti s preuzimanjem?', name + ' - ' + 'Potvrdi preuzimanje', 'Potvrdi', 'Prekini')
if no: return
except:
return control.infoDialog('Nije moguće preuzeti')
pass
def download(): return [{'name': name, 'url': url, 'image': image}]
result = cache.get(download, 600000000, table='rel_dl')
result = [i for i in result if not i['url'] == url]
def download(): return result + [{'name': name, 'url': url, 'image': image}]
result = cache.get(download, 0, table='rel_dl')
control.infoDialog('Datoteka dodana u red čekanja', name)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:54,代码来源:downloader.py
示例7: handle
def handle(self, link, item, download = False, popups = False, close = True):
parameters = {}
# Link
parameters['uri'] = link
# Type
type = None
if 'type' in item and not 'type' == None:
if item['type'] == tools.Media.TypeShow:
type = 'episode'
else:
type = 'movie'
elif 'tvshowtitle' in item:
type = 'episode'
else:
type = 'movie'
parameters['type'] = type
# Information
information = item['information'] if 'information' in item else None
# Show
if type == 'episode':
if 'season' in information:
parameters['season'] = information['season']
if 'episode' in information:
parameters['episode'] = information['episode']
# TMDB
if information and tools.Settings.getBoolean('accounts.informants.tmdb.enabled'):
try:
tmdbApi = tools.Settings.getString('accounts.informants.tmdb.api')
if not tmdbApi == '':
if 'tvdb' in information and not information['tvdb'] == None: # Shows - IMDB ID for episodes does not work on tmdb
result = cache.get(client.request, 240, 'http://api.themoviedb.org/3/find/%s?api_key=%s&external_source=tvdb_id' % (information['tvdb'], tmdbApi))
result = result['tv_episode_results']
parameters['tmdb'] = str(result['id'])
parameters['show'] = str(result['show_id'])
elif 'imdb' in information and not information['imdb'] == None:
result = cache.get(client.request, 240, 'http://api.themoviedb.org/3/find/%s?api_key=%s&external_source=imdb_id' % (information['imdb'], tmdbApi))
result = result['movie_results']
parameters['tmdb'] = str(result['id'])
except:
pass
# Action
action = 'torrents/add' if download else 'play'
# Quasar
parameters = network.Networker.linkParameters(parameters)
tools.System.execute('RunPlugin(plugin://plugin.video.quasar/%s?%s)' % (action, parameters))
return Handler.ReturnExternal # Return because Quasar will handle the playback.'''
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:53,代码来源:handler.py
示例8: Addtypes
def Addtypes():
addDir('Live On Air' ,playlist,2,icon , FANART,'','','','')
addDir('Recent' ,API+'recent',9,icon , FANART,'','','','')
addDir('Popular' ,API+'popular',9,icon , FANART,'','','','')
addDir('Weekend Mix' ,'http://pastebin.com/raw/C0H0i8f9',5,icon , FANART,'','','','')
addDir('Daily Mix' ,'http://pastebin.com/raw/Sv1vLn0X',5,icon , FANART,'','','','')
#addDir('Top 3' ,'top3',4,icon , FANART,'','','','')
addDir('Playlist' ,'top3',6,icon , FANART,'','','','')
addDir('VideoClips' ,'jukebox',8,icon , FANART,'','','','')
addDir('Search' ,'Search',12,icon , FANART,'','','','')
from resources.lib.modules import cache, control, changelog
cache.get(changelog.get, 600000000, control.addonInfo('version'), table='changelog')
开发者ID:EPiC-APOC,项目名称:repository.xvbmc,代码行数:12,代码来源:default.py
示例9: userlists
def userlists(self):
episodes = episodesx.episodes(type = self.type, kids = self.kids)
userlists = []
try:
if trakt.getTraktCredentialsInfo() == False: raise Exception()
activity = trakt.getActivity()
except:
pass
try:
if trakt.getTraktCredentialsInfo() == False: raise Exception()
self.list = []
try:
if activity > cache.timeout(episodes.trakt_user_list, self.traktlists_link, self.trakt_user): raise Exception()
userlists += cache.get(episodes.trakt_user_list, 3, self.traktlists_link, self.trakt_user)
except:
userlists += cache.get(episodes.trakt_user_list, 0, self.traktlists_link, self.trakt_user)
except:
pass
try:
if trakt.getTraktCredentialsInfo() == False: raise Exception()
self.list = []
try:
if activity > cache.timeout(episodes.trakt_user_list, self.traktlikedlists_link, self.trakt_user): raise Exception()
userlists += cache.get(episodes.trakt_user_list, 3, self.traktlikedlists_link, self.trakt_user)
except:
userlists += cache.get(episodes.trakt_user_list, 0, self.traktlikedlists_link, self.trakt_user)
except:
pass
self.list = []
# Filter the user's own lists that were
for i in range(len(userlists)):
contains = False
adapted = userlists[i]['url'].replace('/me/', '/%s/' % self.trakt_user)
for j in range(len(self.list)):
if adapted == self.list[j]['url'].replace('/me/', '/%s/' % self.trakt_user):
contains = True
break
if not contains:
self.list.append(userlists[i])
for i in range(0, len(self.list)): self.list[i].update({'image': 'traktlists.png', 'action': self.parameterize('seasonList')})
# Watchlist
if trakt.getTraktCredentialsInfo():
self.list.insert(0, {'name' : interface.Translation.string(32033), 'url' : self.traktwatchlist_link, 'context' : self.traktwatchlist_link, 'image': 'traktwatch.png', 'action': self.parameterize('seasons')})
episodes.addDirectory(self.list, queue = True)
return self.list
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:53,代码来源:seasons.py
示例10: request
def request(url, timeout='30'):
try:
u = '%s://%s' % (urlparse.urlparse(url).scheme, urlparse.urlparse(url).netloc)
h = cache.get(sucuri, 168, u, timeout)
if h == None:
h = cache.get(sucuri, 0, u, timeout)
result = client.request(url, headers=h, timeout=timeout)
return result
except:
return
开发者ID:kuteteen,项目名称:repository.vietccloud,代码行数:12,代码来源:sucuri.py
示例11: headers
def headers(url, timeout='30'):
try:
u = '%s://%s' % (urlparse.urlparse(url).scheme, urlparse.urlparse(url).netloc)
h = cache.get(sucuri, 168, u, timeout)
if h == None:
h = cache.get(sucuri, 0, u, timeout)
if h == None:
h = {}
return h
except:
return
开发者ID:rofunds,项目名称:maximumTv,代码行数:13,代码来源:sucuri.py
示例12: removeDownload
def removeDownload(url):
try:
def download(): return []
result = cache.get(download, 600000000, table='rel_dl')
if result == '': result = []
result = [i for i in result if not i['url'] == url]
if result == []: result = ''
def download(): return result
result = cache.get(download, 0, table='rel_dl')
control.refresh()
except:
control.infoDialog('Morate ručno ukloniti datoteku', 'Nije moguće ukloniti datoteku')
开发者ID:kevintone,项目名称:tdbaddon,代码行数:14,代码来源:downloader.py
示例13: sources
def sources(self, url, hostDict, hostprDict):
try:
sources = []
r = cache.get(client.request, 6, url)
try:
v = re.findall('\$\.get\(\'(.+?)(?:\'\,\s*\{\"embed\":\")([\d]+)', r)
for i in v:
url = urlparse.urljoin(self.base_link, i[0] + '?embed=%s' % i[1])
ri = cache.get(client.request, 6, search_url)
url = dom_parser2.parse_dom(ri, 'iframe', req='src')[0]
url = url.attrs['src']
try:
host = re.findall('([\w]+[.][\w]+)$', urlparse.urlparse(url.strip().lower()).netloc)[0]
if host in hostDict:
host = client.replaceHTMLCodes(host)
host = host.encode('utf-8')
sources.append({
'source': host,
'quality': 'SD',
'language': 'en',
'url': url.replace('\/','/'),
'direct': False,
'debridonly': False
})
except: pass
except: pass
r = dom_parser2.parse_dom(r, 'div', {'class': ['btn','btn-primary']})
r = [dom_parser2.parse_dom(i.content, 'a', req='href') for i in r]
r = [(i[0].attrs['href'], re.search('<\/i>\s*(\w+)', i[0].content)) for i in r]
r = [(i[0], i[1].groups()[0]) for i in r if i[1]]
if r:
for i in r:
try:
host = i[1]
url = i[0]
host = client.replaceHTMLCodes(host)
host = host.encode('utf-8')
sources.append({
'source': host,
'quality': 'SD',
'language': 'en',
'url': url.replace('\/','/'),
'direct': False,
'debridonly': False
})
except: pass
return sources
except Exception:
return
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:49,代码来源:icefilmsis.py
示例14: search
def search(self, url):
try:
mark = False
if (url == None or url == ''):
self.list = [{'name': 30702, 'action': 'addSearch'}]
self.list += [{'name': 30703, 'action': 'delSearch'}]
else:
if '|SECTION|' in url: mark = url.split('|SECTION|')[0]
self.list = [{'name': 30702, 'url': url, 'action': 'addSearch'}]
self.list += [{'name': 30703, 'action': 'delSearch'}]
try:
def search(): return
query = cache.get(search, 600000000, table='rel_srch')
for url in query:
if mark != False:
if mark in url:
name = url.split('|SPLITER|')[0]
try: self.list += [{'name': '%s...' % name, 'url': url, 'action': 'addSearch'}]
except: pass
else:
if not '|SPLITER|' in url:
try: self.list += [{'name': '%s...' % url, 'url': url, 'action': 'addSearch'}]
except: pass
except:
pass
self.addDirectory(self.list)
return self.list
except:
pass
开发者ID:CYBERxNUKE,项目名称:xbmc-addon,代码行数:33,代码来源:cypher.py
示例15: sources
def sources(self, url, hostDict, hostprDict):
try:
sources = []
if url == None: return sources
data = urlparse.parse_qs(url)
data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])
t = cleantitle.get(data['tvshowtitle'])
r = cache.get(self.showbox_tvcache, 120)
r = [i[0] for i in r if t == cleantitle.get(i[1])]
for url in r:
try:
url = re.sub('/$', '', url)
url = url.replace('/category/', '/')
url = '%s-s%02de%02d.html' % (url, int(data['season']), int(data['episode']))
url = urlparse.urljoin(self.base_link, url)
url = client.request(url)
if not url == None: break
except:
pass
url = re.findall('(openload\.(?:io|co)/(?:embed|f)/[0-9a-zA-Z-_]+)', url)[0]
url = 'http://' + url
sources.append({'source': 'openload.co', 'quality': 'HD', 'provider': 'ShowBox', 'url': url, 'direct': False, 'debridonly': False})
return sources
except:
return sources
开发者ID:hieuhienvn,项目名称:hieuhien.vn,代码行数:35,代码来源:showbox_tv_null.py
示例16: movie
def movie(self, imdb, title, year):
try:
t = cleantitle.get(title)
headers = {"X-Requested-With": "XMLHttpRequest"}
query = urllib.urlencode({"keyword": title})
url = urlparse.urljoin(self.base_link, self.search_link)
r = client.request(url, post=query, headers=headers)
r = json.loads(r)["content"]
r = zip(
client.parseDOM(r, "a", ret="href", attrs={"class": "ss-title"}),
client.parseDOM(r, "a", attrs={"class": "ss-title"}),
)
r = [i[0] for i in r if cleantitle.get(t) == cleantitle.get(i[1])][:2]
r = [(i, re.findall("(\d+)", i)[-1]) for i in r]
for i in r:
try:
y, q = cache.get(self.onemovies_info, 9000, i[1])
if not y == year:
raise Exception()
return urlparse.urlparse(i[0]).path
except:
pass
except:
return
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:30,代码来源:onemovies_mv_tv.py
示例17: add_last_visited
def add_last_visited(anime_id):
try:
c = cache.get(masterani.get_anime_details, 8, anime_id)
lastEpisode = watched.Watched().watched(anime_id)
plot = c['plot']
premiered = c['premiered']
genre = c['genre']
type = c['type']
sysaddon = sys.argv[0]
addon_poster = addon_banner = control.addonInfo('icon')
addon_fanart = control.addonInfo('fanart')
item = control.item("Last Played: [I]%s[/I]" % (c['title']))
poster = "http://cdn.masterani.me/poster/%s" % c['poster']
fanart = "http://cdn.masterani.me/wallpaper/0/%s" % c['fanart'][0]
item.setArt({'poster': poster})
item.setProperty("Fanart_Image", fanart)
item.setInfo(type='Video', infoLabels={
'Plot': plot, 'Year': premiered, 'premiered': premiered,
'genre': genre, 'mediatype': 'tvshow'
})
url = '%s?action=get_episodes' % sysaddon
try: url += '&anime_id=%s' % anime_id
except: pass
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
except:
pass
开发者ID:varunrai,项目名称:Masterani-Redux,代码行数:34,代码来源:root.py
示例18: tvshow
def tvshow(self, imdb, tvdb, tvshowtitle, year):
try:
tk = cache.get(self.putlocker_token, 8)
st = self.putlocker_set() ; rt = self.putlocker_rt(tk + st)
tm = int(time.time() * 1000)
headers = {'X-Requested-With': 'XMLHttpRequest'}
url = urlparse.urljoin(self.base_link, self.search_link)
post = {'q': tvshowtitle.lower(), 'limit': '20', 'timestamp': tm, 'verifiedCheck': tk, 'set': st, 'rt': rt}
post = urllib.urlencode(post)
r = client.request(url, post=post, headers=headers)
r = json.loads(r)
t = cleantitle.get(tvshowtitle)
r = [i for i in r if 'year' in i and 'meta' in i]
r = [(i['permalink'], i['title'], str(i['year']), i['meta'].lower()) for i in r]
r = [i for i in r if 'tv' in i[3]]
r = [i[0] for i in r if t == cleantitle.get(i[1]) and year == i[2]][0]
url = re.findall('(?://.+?|)(/.+)', r)[0]
url = client.replaceHTMLCodes(url)
url = url.encode('utf-8')
return url
except:
return
开发者ID:danielp76,项目名称:kodi-senyor,代码行数:31,代码来源:putlocker_mv_tv.py
示例19: movie
def movie(self, imdb, title, year):
try:
t = cleantitle.get(title)
q = '/search/%s.html' % (urllib.quote_plus(cleantitle.query(title)))
q = urlparse.urljoin(self.base_link, q)
for i in range(3):
r = client.request(q)
if not r == None: break
r = client.parseDOM(r, 'div', attrs = {'class': 'ml-item'})
r = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a', ret='title')) for i in r]
r = [(i[0][0], i[1][0]) for i in r if i[0] and i[1]]
r = [i[0] for i in r if t == cleantitle.get(i[1])][:2]
r = [(i, re.findall('(\d+)', i)[-1]) for i in r]
for i in r:
try:
y, q = cache.get(self.ymovies_info, 9000, i[1])
if not y == year: raise Exception()
return urlparse.urlparse(i[0]).path
except:
pass
except:
return
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:26,代码来源:ymovies.py
示例20: get
def get(self):
try:
self.list = cache.get(self.get_recent, 2)
self.add_directory(self.list)
return self.list
except:
pass
开发者ID:varunrai,项目名称:Masterani-Redux,代码行数:7,代码来源:recent.py
注:本文中的resources.lib.modules.cache.get函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论