本文整理汇总了Python中resources.lib.libraries.control.setting函数的典型用法代码示例。如果您正苦于以下问题:Python setting函数的具体用法?Python setting怎么用?Python setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
self.base_link = 'http://ororo.tv'
self.sign_link = 'http://ororo.tv/users/sign_in'
self.user = control.setting('ororo_user')
self.password = control.setting('ororo_password')
self.post = {'user[email]': self.user, 'user[password]': self.password, 'user[remember_me]': 1}
self.post = urllib.urlencode(self.post)
开发者ID:mpie,项目名称:repo,代码行数:7,代码来源:ororo_tv_null.py
示例2: __init__
def __init__(self):
movie_library = os.path.join(control.transPath(control.setting('movie_library')),'')
tv_library = os.path.join(control.transPath(control.setting('tv_library')),'')
tv_downloads = os.path.join(control.transPath(control.setting('tv_downloads')),'')
#movie_downloads = os.path.join(control.transPath(control.setting('movie_downloads')),'')
if not os.path.exists(movie_library): os.makedirs(movie_library)
if not os.path.exists(tv_library): os.makedirs(tv_library)
开发者ID:PsychoTV,项目名称:PsychoTeam.repository,代码行数:7,代码来源:navigator.py
示例3: get_movie
def get_movie(self, imdb, title, year):
try:
if control.setting('alluc_user'):
if control.setting('realdebrid_token') or control.setting('premiumize_user'):
self.moviesearch_link = '/api/search/download?user=%s&password=%s&query=%s+%s'
else:
self.moviesearch_link = '/api/search/stream/?user=%s&password=%s&query=%s+%s'
url = self.moviesearch_link % (control.setting('alluc_user'), control.setting('alluc_password'),cleantitle.geturl(title), year)
r = urlparse.urljoin(self.base_link, url)
r = r + "+%23newlinks"
r = client.request(r)
r1 = json.loads(r)
for item in r1['result']:
if len(item['hosterurls']) == 1 and 'en' in item['lang']:
tmp = item['hosterurls'][0]['url']
tmp = client.replaceHTMLCodes(tmp)
tmp = tmp.encode('utf-8')
title = item['title'].encode('utf-8')
self.stream_url.append({'url': tmp, 'hoster': item['hostername'], 'title': title })
return self.stream_url
except Exception as e:
control.log(e)
return
开发者ID:mrknow,项目名称:specto,代码行数:25,代码来源:alluc_mv_tv.py
示例4: resolve
def resolve(url):
try:
log("---1 --- %s" % control.setting('realdebrid_authorize'),xbmc.LOGNOTICE)
if control.setting('realdebrid_authorize') == 'false': return
log("---2 --- %s " % control.setting('realdebrid_authorize'), xbmc.LOGNOTICE)
print("---3---",control.setting('realdebrid_token'))
myreal = RealDebridResolver()
#myreal.login()
log("Mu url: %s" % url, xbmc.LOGNOTICE)
myurl = myreal.get_media_url('www.real-debrid.com',url)
#login_data = urllib.urlencode({'user' : user, 'pass' : password})
#login_link = 'http://real-debrid.com/ajax/login.php?%s' % login_data
#result = client.source(login_link, close=False)
#result = json.loads(result)
#error = result['error']
#if not error == 0: raise Exception()
#cookie = result['cookie']
#url = 'http://real-debrid.com/ajax/unrestrict.php?link=%s' % url
#url = url.replace('filefactory.com/stream/', 'filefactory.com/file/')
#result = client.source(url, cookie=cookie, close=False)
#result = json.loads(result)
#url = result['generated_links'][0][-1]
#url = '%s|Cookie=%s' % (url, urllib.quote_plus(cookie))
return myurl
except:
return
开发者ID:Biggen,项目名称:filmkodi,代码行数:30,代码来源:realdebrid.py
示例5: genesis
def genesis(self):
if traktMode == True:
self.addDirectoryItem(30081, 'movies&url=traktcollection', 'moviesTraktcollection.jpg', 'DefaultMovies.png', context=(30191, 'moviesToLibrary&url=traktcollection'))
self.addDirectoryItem(30082, 'movies&url=traktwatchlist', 'moviesTraktwatchlist.jpg', 'DefaultMovies.png', context=(30191, 'moviesToLibrary&url=traktwatchlist'))
self.addDirectoryItem(30083, 'movies&url=traktfeatured', 'movies.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30084, 'movies&url=traktratings', 'movies.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30085, 'tvshows&url=traktcollection', 'tvshowsTraktcollection.jpg', 'DefaultTVShows.png', context=(30191, 'tvshowsToLibrary&url=traktcollection'))
self.addDirectoryItem(30086, 'tvshows&url=traktwatchlist', 'tvshowsTraktwatchlist.jpg', 'DefaultTVShows.png', context=(30191, 'tvshowsToLibrary&url=traktwatchlist'))
self.addDirectoryItem(30087, 'tvshows&url=traktfeatured', 'tvshows.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30088, 'tvshows&url=traktratings', 'tvshows.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30089, 'calendar&url=progress', 'calendarsProgress.jpg', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30090, 'calendar&url=mycalendar', 'calendarsMycalendar.jpg', 'DefaultRecentlyAddedEpisodes.png')
if imdbMode == True:
self.addDirectoryItem(30091, 'movies&url=imdbwatchlist', 'moviesImdbwatchlist.jpg', 'DefaultMovies.png', context=(30191, 'moviesToLibrary&url=imdbwatchlist'))
self.addDirectoryItem(30092, 'tvshows&url=imdbwatchlist', 'tvshowsImdbwatchlist.jpg', 'DefaultTVShows.png', context=(30191, 'tvshowsToLibrary&url=imdbwatchlist'))
if traktMode == True or imdbMode == True:
self.addDirectoryItem(30093, 'movieUserlists', 'movieUserlists.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30094, 'tvUserlists', 'tvUserlists.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30095, 'movieFavourites', 'movieFavourites.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30096, 'episodeFavourites', 'tvFavourites.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30097, 'tvFavourites', 'tvFavourites.jpg', 'DefaultTVShows.png')
movie_downloads = control.setting('movie_downloads')
tv_downloads = control.setting('tv_downloads')
if len(control.listDir(movie_downloads)[0]) > 0 or len(control.listDir(tv_downloads)[0]) > 0:
self.addDirectoryItem(30098, 'downloadNavigator', 'downloads.jpg', 'DefaultFolder.png')
self.endDirectory()
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:31,代码来源:navigator.py
示例6: __init__
def __init__(self):
self.base_link = 'http://members.easynews.com'
self.user = control.setting('easynews_user')
self.password = control.setting('easynews_password')
self.cookie = 'chickenlicker=%s%%3A%s' % (self.user, self.password)
self.moviesearch_link = '/2.0/search/solr-search/advanced?st=adv&safeO=0&sb=1&from=&ns=&fex=mkv%%2Cmp4&vc=AVC1%%2CHEVC%%2CH264%%2CH265&ac=&s1=nsubject&s1d=%%2B&s2=nrfile&s2d=%%2B&s3=dsize&s3d=%%2B&fty[]=VIDEO&spamf=1&u=1&gx=1&pby=1000&pno=1&sS=3&d1=&d1t=&d2=&d2t=&b1=&b1t=17&b2=&b2t=28&px1=&px1t=&px2=&px2t=&fps1=&fps1t=&fps2=&fps2t=&bps1=&bps1t=8&bps2=&bps2t=&hz1=&hz1t=&hz2=&hz2t=&rn1=&rn1t=&rn2=&rn2t=&gps=%s&sbj=%s'
self.tvsearch_link = '/2.0/search/solr-search/advanced?st=adv&safeO=0&sb=1&from=&ns=&fil=&fex=mkv%%2Cmp4%%2Cavi&vc=&ac=&s1=nsubject&s1d=%%2B&s2=nrfile&s2d=%%2B&s3=dsize&s3d=%%2B&fty[]=VIDEO&spamf=1&u=1&gx=1&pby=1000&pno=1&sS=3&d1=&d1t=&d2=&d2t=&b1=&b1t=14&b2=&b2t=26&px1=&px1t=&px2=&px2t=&fps1=&fps1t=&fps2=&fps2t=&bps1=&bps1t=8&bps2=&bps2t=&hz1=&hz1t=&hz2=&hz2t=&rn1=&rn1t=&rn2=&rn2t=&gps=%s&sbj=%s'
开发者ID:mpie,项目名称:repo,代码行数:7,代码来源:easynews_mv_tv_null.py
示例7: root
def root(self):
self.addDirectoryItem(30001, 'movieNavigator', 'movies.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30002, 'tvNavigator', 'tvshows.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30003, 'channels', 'channels.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30004, 'myNavigator', 'myspecto.jpg', 'DefaultVideoPlaylists.png')
if not control.setting('movie_widget') == '0':
self.addDirectoryItem(30005, 'movieWidget', 'moviesAdded.jpg', 'DefaultRecentlyAddedMovies.png')
if (traktMode == True and not control.setting('tv_alt_widget') == '0') or (traktMode == False and not control.setting('tv_widget') == '0'):
#self.addDirectoryItem(30006, 'tvWidget', 'calendarsAdded.jpg', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30006, 'calendar&url=added', 'calendarsAdded.jpg', 'DefaultRecentlyAddedEpisodes.png')
if not control.setting('calendar_widget') == '0':
self.addDirectoryItem(30007, 'calendars', 'calendar.jpg', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30008, 'toolNavigator', 'tools.jpg', 'DefaultAddonProgram.png')
self.addDirectoryItem(30009, 'searchNavigator', 'search.jpg', 'DefaultFolder.png')
self.endDirectory()
if ntptime.checkDate():
control.log('Error date time setup')
msg = control.lang(32020).encode('utf-8')
msg1 ='Go to settings, set your correct date and time'.encode('utf-8')
msg = 'You have to set your clock in your tv box.'.encode('utf-8')
control.dialog.ok(control.addonInfo('name'),'',msg, msg1 )
from resources.lib.libraries import cache
from resources.lib.libraries import changelog
开发者ID:mrknow,项目名称:specto,代码行数:33,代码来源:navigator.py
示例8: root
def root(self):
self.addDirectoryItem(30001, 'movieNavigator', 'movies.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30002, 'tvNavigator', 'tvshows.jpg', 'DefaultTVShows.png')
self.addDirectoryItem(30003, 'channels', 'channels.jpg', 'DefaultMovies.png')
self.addDirectoryItem(30004, 'myNavigator', 'myspecto.jpg', 'DefaultVideoPlaylists.png')
if not control.setting('movie_widget') == '0':
self.addDirectoryItem(30005, 'movieWidget', 'moviesAdded.jpg', 'DefaultRecentlyAddedMovies.png')
if (traktMode == True and not control.setting('tv_alt_widget') == '0') or (traktMode == False and not control.setting('tv_widget') == '0'):
#self.addDirectoryItem(30006, 'tvWidget', 'calendarsAdded.jpg', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30006, 'calendar&url=added', 'calendarsAdded.jpg', 'DefaultRecentlyAddedEpisodes.png')
if not control.setting('calendar_widget') == '0':
self.addDirectoryItem(30007, 'calendars', 'calendar.jpg', 'DefaultRecentlyAddedEpisodes.png')
self.addDirectoryItem(30008, 'toolNavigator', 'tools.jpg', 'DefaultAddonProgram.png')
self.addDirectoryItem(30009, 'searchNavigator', 'search.jpg', 'DefaultFolder.png')
self.endDirectory()
from resources.lib.libraries import cache
from resources.lib.libraries import changelog
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:25,代码来源:navigator.py
示例9: get_episode
def get_episode(self, url, imdb, tvdb, title, date, season, episode):
try:
if control.setting('alluc_user'):
if control.setting('realdebrid_token') or control.setting('premiumize_user'):
self.moviesearch_link = '/api/search/download?user=%s&password=%s&query=%s'
else:
self.moviesearch_link = '/api/search/stream/?user=%s&password=%s&query=%s'
tvshowtitle, year = re.compile('(.+?) [(](\d{4})[)]$').findall(url)[0]
season, episode = season.zfill(2), episode.zfill(2)
query = '%s s%se%s' % (tvshowtitle, season, episode)
query = self.moviesearch_link % (control.setting('alluc_user'), control.setting('alluc_password'), urllib.quote_plus(query))
r = urlparse.urljoin(self.base_link, query)
r = r + "+%23newlinks"
r = requests.get(r).json()
for item in r['result']:
if len(item['hosterurls']) == 1 and 'en' in item['lang']:
tmp = item['hosterurls'][0]['url']
tmp = client.replaceHTMLCodes(tmp)
tmp = tmp.encode('utf-8')
title = item['title'].encode('utf-8')
self.stream_url.append({'url': tmp, 'hoster': item['hostername'], 'title': title })
return self.stream_url
except Exception as e:
control.log('alluc error tv')
control.log(e)
return
开发者ID:mrknow,项目名称:specto,代码行数:28,代码来源:alluc_mv_tv.py
示例10: download
def download(name, image, url):
if type(url) is list:
url = url[0]
from resources.lib.libraries import control
if url == None:
return control.infoDialog(control.lang(30501).encode('utf-8'))
try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1]))
except: headers = dict('')
url = url.split('|')[0]
content = re.compile('(.+?)\sS(\d*)E\d*$').findall(name)
transname = name.translate(None, '\/:*?"<>|').strip('.')
levels =['../../../..', '../../..', '../..', '..']
if len(content) == 0:
dest = control.setting('movie.download.path')
dest = control.transPath(dest)
for level in levels:
try: control.makeFile(os.path.abspath(os.path.join(dest, level)))
except: pass
control.makeFile(dest)
dest = os.path.join(dest, transname)
control.makeFile(dest)
else:
dest = control.setting('tv.download.path')
dest = control.transPath(dest)
for level in levels:
try: control.makeFile(os.path.abspath(os.path.join(dest, level)))
except: pass
control.makeFile(dest)
transtvshowtitle = content[0][0].translate(None, '\/:*?"<>|').strip('.')
dest = os.path.join(dest, transtvshowtitle)
control.makeFile(dest)
dest = os.path.join(dest, 'Season %01d' % int(content[0][1]))
control.makeFile(dest)
ext = os.path.splitext(urlparse.urlparse(url).path)[1][1:]
if not ext in ['mp4', 'mkv', 'flv', 'avi', 'mpg']: ext = 'mp4'
dest = os.path.join(dest, transname + '.' + ext)
sysheaders = urllib.quote_plus(json.dumps(headers))
sysurl = urllib.quote_plus(url)
systitle = urllib.quote_plus(name)
sysimage = urllib.quote_plus(image)
sysdest = urllib.quote_plus(dest)
script = inspect.getfile(inspect.currentframe())
cmd = 'RunScript(%s, %s, %s, %s, %s, %s)' % (script, sysurl, sysdest, systitle, sysimage, sysheaders)
xbmc.executebuiltin(cmd)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:59,代码来源:downloader.py
示例11: getSources
def getSources(self, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date):
sourceDict = []
for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg))
sourceDict = [i[0] for i in sourceDict if i[1] == False]
content = 'movie' if tvshowtitle == None else 'episode'
if content == 'movie':
sourceDict = [i for i in sourceDict if i.endswith(('_mv', '_mv_tv'))]
try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i))) for i in sourceDict]
except: sourceDict = [(i, 'true') for i in sourceDict]
else:
sourceDict = [i for i in sourceDict if i.endswith(('_tv', '_mv_tv'))]
try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i) + '_tv')) for i in sourceDict]
except: sourceDict = [(i, 'true') for i in sourceDict]
global global_sources
global_sources = []
threads = []
control.makeFile(control.dataPath)
self.sourceFile = control.sourcescacheFile
sourceDict = [i[0] for i in sourceDict if i[1] == 'true']
if content == 'movie':
title = cleantitle.normalize(title)
for source in sourceDict: threads.append(workers.Thread(self.getMovieSource, title, year, imdb, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source()))
else:
tvshowtitle = cleantitle.normalize(tvshowtitle)
season, episode = alterepisode.alterepisode().get(imdb, tmdb, tvdb, tvrage, season, episode, alter, title, date)
for source in sourceDict: threads.append(workers.Thread(self.getEpisodeSource, title, year, imdb, tvdb, season, episode, tvshowtitle, date, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source()))
try: timeout = int(control.setting('sources_timeout_40'))
except: timeout = 40
[i.start() for i in threads]
#[i.join() for i in threads] ; self.sources = global_sources ; return self.sources
for i in range(0, timeout * 2):
is_alive = [x.is_alive() for x in threads]
if all(x == False for x in is_alive): break
time.sleep(0.5)
for i in range(0, 5 * 2):
is_alive = len([i for i in threads if i.is_alive() == True])
if is_alive < 10: break
time.sleep(0.5)
self.sources = global_sources
return self.sources
开发者ID:gsolanoalvarez,项目名称:hdfulltv,代码行数:59,代码来源:__init__.py
示例12: __init__
def __init__(self):
self.library_folder = os.path.join(control.transPath(control.setting("movie_library")), "")
self.check_setting = control.setting("check_movie_link") or "false"
self.library_setting = control.setting("update_library") or "true"
self.dupe_setting = control.setting("check_library") or "true"
self.infoDialog = False
开发者ID:cuongnvth,项目名称:hieuhien.vn,代码行数:8,代码来源:libtools.py
示例13: __init__
def __init__(self):
self.base_link = 'https://www.alluc.com'
self.user = control.setting('alluc_user')
self.password = control.setting('alluc_password')
#self.download_link = '/api/search/download/?user=%s&password=%s&count=20&from=0&getmeta=0&query=%s+lang%%3Aen+host%%3A%s'
#self.stream_link = '/api/search/stream/?user=%s&password=%s&count=20&from=0&getmeta=0&query=%s+lang%%3Aen+host%%3A%s'
self.download_link = '/api/search/download/?user=%s&password=%s&count=100&from=0&getmeta=0&query=%s+lang%%3Aen'
self.stream_link = '/api/search/stream/?user=%s&password=%s&count=100&from=0&getmeta=0&query=%s+lang%%3Aen'
开发者ID:DanielOrc,项目名称:lambda-addons,代码行数:8,代码来源:alluc_mv_tv.py
示例14: __init__
def __init__(self):
self.base_link = 'http://ororo.tv'
self.sign_link = 'http://ororo.tv/en/users/sign_in'
self.cookie = None
self.lang_cookie = 'locale=en; nl=true'
self.user = control.setting('ororo_user')
self.password = control.setting('ororo_password')
self.post = {'user[email]': self.user, 'user[password]': self.password, 'user[remember_me]': 1}
开发者ID:AMObox,项目名称:teammaniac,代码行数:8,代码来源:ororo_tv.py
示例15: __init__
def __init__(self):
self.library_folder = os.path.join(control.transPath(control.setting('movie_library')),'')
self.check_setting = control.setting('check_movie_link') or 'false'
self.library_setting = control.setting('update_library') or 'true'
self.dupe_setting = control.setting('check_library') or 'true'
self.infoDialog = False
开发者ID:8821kitkat,项目名称:officialrepo,代码行数:8,代码来源:libtools.py
示例16: service
def service(self):
try:
control.makeFile(control.dataPath)
dbcon = database.connect(control.libcacheFile)
dbcur = dbcon.cursor()
dbcur.execute("CREATE TABLE IF NOT EXISTS service (""setting TEXT, ""value TEXT, ""UNIQUE(setting)"");")
dbcur.execute("SELECT * FROM service WHERE setting = 'last_run'")
fetch = dbcur.fetchone()
if fetch == None:
serviceProperty = "1970-01-01 23:59:00.000000"
dbcur.execute("INSERT INTO service Values (?, ?)", ('last_run', serviceProperty))
dbcon.commit()
else:
serviceProperty = str(fetch[1])
dbcon.close()
except:
try: return dbcon.close()
except: return
try: control.window.setProperty(self.property, serviceProperty)
except: return
while (not xbmc.abortRequested):
try:
serviceProperty = control.window.getProperty(self.property)
t1 = datetime.timedelta(hours=6)
t2 = datetime.datetime.strptime(serviceProperty, '%Y-%m-%d %H:%M:%S.%f')
t3 = datetime.datetime.now()
check = abs(t3 - t2) > t1
if check == False: raise Exception()
if (control.player.isPlaying() or control.condVisibility('Library.IsScanningVideo')): raise Exception()
serviceProperty = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
control.window.setProperty(self.property, serviceProperty)
try:
dbcon = database.connect(control.libcacheFile)
dbcur = dbcon.cursor()
dbcur.execute("CREATE TABLE IF NOT EXISTS service (""setting TEXT, ""value TEXT, ""UNIQUE(setting)"");")
dbcur.execute("DELETE FROM service WHERE setting = 'last_run'")
dbcur.execute("INSERT INTO service Values (?, ?)", ('last_run', serviceProperty))
dbcon.commit()
dbcon.close()
except:
try: dbcon.close()
except: pass
if not control.setting('service_update') == 'true': raise Exception()
info = control.setting('service_notification') or 'true'
self.update(None, info=info)
except:
pass
control.sleep(10000)
开发者ID:8821kitkat,项目名称:officialrepo,代码行数:58,代码来源:libtools.py
示例17: __init__
def __init__(self):
self.base_link_1 = 'http://erosnow.com'
self.base_link_2 = self.base_link_1
self.search_link = '/search/movies?q=%s&start=0&rows=20&cc=US'
self.info_link = '/catalog/movie/%s/cc=US'
self.login_link = 'https://erosnow.com/secured/dologin'
self.now = datetime.datetime.now()
self.user = control.setting('eros_user')
self.password = control.setting('eros_pwd')
self.list = []
开发者ID:kevintone,项目名称:tdbaddon,代码行数:10,代码来源:erosnow_mv.py
示例18: downloads
def downloads(self):
movie_downloads = control.setting('movie_downloads')
tv_downloads = control.setting('tv_downloads')
if len(control.listDir(movie_downloads)[0]) > 0:
self.addDirectoryItem(30099, movie_downloads, 'movies.jpg', 'DefaultMovies.png', isAction=False)
if len(control.listDir(tv_downloads)[0]) > 0:
self.addDirectoryItem(30100, tv_downloads, 'tvshows.jpg', 'DefaultTVShows.png', isAction=False)
self.endDirectory()
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:10,代码来源:navigator.py
示例19: play
def play(self, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date, url):
try:
if imdb == "0":
imdb = "0000000"
imdb = "tt" + re.sub("[^0-9]", "", str(imdb))
content = "movie" if tvshowtitle == None else "episode"
self.sources = self.getSources(
name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date
)
if self.sources == []:
raise Exception()
self.sources = self.sourcesFilter()
if control.window.getProperty("PseudoTVRunning") == "True":
url = self.sourcesDirect()
elif url == "dialog://":
url = self.sourcesDialog()
elif url == "direct://":
url = self.sourcesDirect()
elif (
not control.infoLabel("Container.FolderPath").startswith("plugin://")
and control.setting("autoplay_library") == "false"
):
url = self.sourcesDialog()
elif (
control.infoLabel("Container.FolderPath").startswith("plugin://")
and control.setting("autoplay") == "false"
):
url = self.sourcesDialog()
else:
url = self.sourcesDirect()
if url == None:
raise Exception()
if url == "close://":
return
if control.setting("playback_info") == "true":
control.infoDialog(self.selectedSource, heading=name)
from resources.lib.libraries.player import player
player().run(content, name, url, imdb, tvdb)
return url
except:
control.infoDialog(control.lang(30501).encode("utf-8"))
pass
开发者ID:bialagary,项目名称:mw,代码行数:55,代码来源:__init__.py
示例20: checkSources
def checkSources(self, name, title, year, imdb, tmdb, tvdb, tvrage, season, episode, tvshowtitle, alter, date):
sourceDict = []
for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg))
sourceDict = [i[0] for i in sourceDict if i[1] == False]
content = 'movie' if tvshowtitle == None else 'episode'
if content == 'movie':
sourceDict = [i for i in sourceDict if i.endswith(('_mv', '_mv_tv'))]
try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i))) for i in sourceDict]
except: sourceDict = [(i, 'true') for i in sourceDict]
else:
sourceDict = [i for i in sourceDict if i.endswith(('_tv', '_mv_tv'))]
try: sourceDict = [(i, control.setting(re.sub('_mv_tv$|_mv$|_tv$', '', i) + '_tv')) for i in sourceDict]
except: sourceDict = [(i, 'true') for i in sourceDict]
threads = []
control.makeFile(control.dataPath)
self.sourceFile = control.sourcescacheFile
sourceDict = [i[0] for i in sourceDict if i[1] == 'true']
if content == 'movie':
title = cleantitle.normalize(title)
for source in sourceDict: threads.append(workers.Thread(self.getMovieSource, title, year, imdb, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source()))
else:
tvshowtitle = cleantitle.normalize(tvshowtitle)
season, episode = alterepisode.alterepisode().get(imdb, tmdb, tvdb, tvrage, season, episode, alter, title, date)
for source in sourceDict:
#control.log("SOURCE S2 %s" % source)
threads.append(workers.Thread(self.getEpisodeSource, title, year, imdb, tvdb, season, episode, tvshowtitle, date, re.sub('_mv_tv$|_mv$|_tv$', '', source), __import__(source, globals(), locals(), [], -1).source()))
try: timeout = int(control.setting('sources_timeout_40'))
except: timeout = 40
[i.start() for i in threads]
for i in range(0, timeout * 2):
try:
if xbmc.abortRequested == True: return sys.exit()
if len(self.sources) >= 10: break
is_alive = [x.is_alive() for x in threads]
if all(x == False for x in is_alive): break
time.sleep(0.5)
except:
pass
if len(self.sources) >= 10: return True
else: return False
开发者ID:msousinha,项目名称:myhome-repository,代码行数:54,代码来源:__init__.py
注:本文中的resources.lib.libraries.control.setting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论