本文整理汇总了Python中common.XBMCInterfaceUtils.displayDialogMessage方法的典型用法代码示例。如果您正苦于以下问题:Python XBMCInterfaceUtils.displayDialogMessage方法的具体用法?Python XBMCInterfaceUtils.displayDialogMessage怎么用?Python XBMCInterfaceUtils.displayDialogMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.XBMCInterfaceUtils
的用法示例。
在下文中一共展示了XBMCInterfaceUtils.displayDialogMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __loginAndSaveCookieStore__
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def __loginAndSaveCookieStore__(cookieStore):
AddonUtils.deleteFile(cookieStore)
email = Container().getAddonContext().addon.getSetting("email")
password = Container().getAddonContext().addon.getSetting("password")
if email == None or email == "" or password == None or password == "":
d = xbmcgui.Dialog()
d.ok(
"Welcome to Willow TV",
"Watch LIVE CRICKET on your favorite Willow TV.",
"Please provide your login details for both",
"Willow TV and YouTube.",
)
Container().getAddonContext().addon.openSettings(sys.argv[0])
return False
params = {"Email": email, "Password": password, "KeepSigned": "true", "LoginFormSubmit": "true"}
html = HttpUtils.HttpClient().getHtmlContent(LOGIN_URL, params)
HttpUtils.HttpClient().saveCookiesToFile(cookieStore)
match = re.compile("Error: Your email or password is incorrect").findall(html)
if len(match) > 0:
XBMCInterfaceUtils.displayDialogMessage(
"Login Failure", "Error: Your email or password is incorrect.", "Please verify your login details."
)
return False
else:
return True
示例2: showUserUploads
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def showUserUploads(request_obj, response_obj):
try:
items = None
if request_obj.get_data().has_key('pageNbr'):
items = retrieveUserUploads(request_obj.get_data()['userId'], request_obj.get_data()['pageNbr'])
else:
items = retrieveUserUploads(request_obj.get_data()['userId'])
response_obj.set_item_list(items)
except:
XBMCInterfaceUtils.displayDialogMessage('No video items found!', 'This channel does not contain any video items.')
示例3: judgeTurtleNextAction
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def judgeTurtleNextAction(self, actionObj):
ProgressDisplayer().displayMessage(80, line1='Preparing items for display or play', line2='Total items: ' + str(len(self.response_obj.get_item_list())))
if self.response_obj.get_redirect_action_name() is None:
isAnyPlayableItem = False
isItemsList = False
playlist_type = None
for item in self.response_obj.get_item_list():
nextActionId = actionObj.get_next_action_map()[item.get_next_action_name()]
if nextActionId == '__play__':
if item.get_moving_data().has_key('pluginUrl'):
XBMCInterfaceUtils.executePlugin(item.get_moving_data()['pluginUrl'])
else:
if not isAnyPlayableItem and not XBMCInterfaceUtils.isPlaying():
XBMCInterfaceUtils.clearPlayList() # Clear playlist item only when at least one video item is found.
playlist_type = XBMCInterfaceUtils.addPlayListItem(item)
isAnyPlayableItem = True
elif nextActionId == '__service_response__':
# Do Nothing , get response object from container for parameters to be returned
pass
elif nextActionId == '__download__':
downloadPath = self.addon_context.addon.getSetting('downloadPath')
if downloadPath is None or downloadPath == '':
XBMCInterfaceUtils.displayDialogMessage("Download path not provided", "Please provide download path in add-on settings.", "The download path should be a local directory.")
self.addon_context.addon.openSettings(sys.argv[ 0 ])
downloadPath = self.addon_context.addon.getSetting('downloadPath')
if downloadPath is not None and downloadPath != '':
XBMCInterfaceUtils.downloadVideo(item, downloadPath)
elif nextActionId == '__resolved__':
XBMCInterfaceUtils.setResolvedMediaUrl(item)
else:
isItemsList = True
is_Folder = self.addon_context.isNextActionFolder(actionObj.get_action_id(), item.get_next_action_name())
downloadAction = self.addon_context.getDownloadActionIfDownloadable(actionObj.get_action_id(), item.get_next_action_name())
if(downloadAction is not None):
XBMCInterfaceUtils.addContextMenuItem(item, 'Download Video', downloadAction)
XBMCInterfaceUtils.addFolderItem(item, nextActionId, is_Folder)
del item # deletes item
if isAnyPlayableItem == True:
ProgressDisplayer().end()
try:
if playlist_type is not None:
XBMCInterfaceUtils.play(list_type=playlist_type)
else:
XBMCInterfaceUtils.play()
except Exception, e:
Logger.logFatal(e)
elif isItemsList:
if self.response_obj.get_xbmc_sort_method() is not None:
XBMCInterfaceUtils.sortMethod(self.response_obj.get_xbmc_sort_method())
if self.response_obj.get_xbmc_content_type() is not None:
XBMCInterfaceUtils.setContentType(self.response_obj.get_xbmc_content_type())
XBMCInterfaceUtils.setSortMethods()
示例4: __prepareVideoSourceLinks__
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def __prepareVideoSourceLinks__(videoSourceLinks, source):
new_items = XBMCInterfaceUtils.callBackDialogProgressBar(getattr(sys.modules[__name__], '__prepareVideoLink__'), videoSourceLinks, 'Retrieving streaming links for source #' + source, 'Failed to retrieve stream information, please try again later')
if len(new_items) == 0:
XBMCInterfaceUtils.displayDialogMessage('No video items found!', 'Unable to resolve video items from source #' + source, 'Continuing with next source...')
return []
count = 0
for item in new_items:
xbmcItem = item.get_xbmc_list_item_obj()
count = count + 1
xbmcItem.setLabel('Source #' + source + ' | ' + xbmcItem.getLabel() + str(count))
new_items.append(__preparePlayListItem__(new_items, source))
return new_items
示例5: start
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def start(addon_id, addon_ver=None):
try:
Logger.logDebug(sys.argv)
global __addon_id__
__addon_id__ = addon_id
__addon_ver__ = addon_ver
containerObj = Container(addon_id=addon_id, addon_ver=addon_ver)
action_id = containerObj.getTurtleRequest().get_action_id()
containerObj.performAction(action_id)
except urllib2.URLError, e:
Logger.logFatal(e)
XBMCInterfaceUtils.displayDialogMessage('Unable to connect', 'Please choose a different source if available in add-on.', 'Website used in add-on is down, try to access using web browser.', 'Please share logs with developer if problem keeps coming!')
示例6: displayLinks
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def displayLinks(request_obj, response_obj):
if not request_obj.get_data()['isLoginSuccess']:
return
matchLinks = request_obj.get_data()['matchLinks']
if len(matchLinks) == 0:
XBMCInterfaceUtils.displayDialogMessage('Match not started yet', 'Error: This match is not started.', 'Please verify match schedule.')
return
d = xbmcgui.Dialog()
index = d.select('What do you wanna watch:', matchLinks.keys())
key = matchLinks.keys()[index]
print 'SELECTED : ' + key
url = matchLinks[key]
soup = HttpUtils.HttpClient().getBeautifulSoup(url)
print soup
示例7: retrieveMovies
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def retrieveMovies(categoryUrlSuffix):
loopCount = 10
titles = []
if categoryUrlSuffix == 'BluRay' :
XBMCInterfaceUtils.displayDialogMessage('HD Movies', 'Bluray movies not supported at the moment!', msgType='[B]INFO & REQUEST: [/B]')
return titles
queryParms = '&organize=Activity&filtered=RecentlyPosted&org_type=Activity'
print categoryUrlSuffix
if categoryUrlSuffix.find('_') > 0 :
options_url = re.compile("(.+?)_(.*)").findall(categoryUrlSuffix)
categoryUrlSuffix = options_url[0][1]
if options_url[0][0].isdigit():
queryParms = '&organize=Year&filtered=' + options_url[0][0] + '&org_type=Year'
else:
queryParms = '&organize=Alphabetical&filtered=' + options_url[0][0] + '&org_type=Alphabetical'
webpage = urlopen(BASE_WSITE_URL + 'movies/index.php?lang=' + categoryUrlSuffix + queryParms)
soup2 = BeautifulSoup.BeautifulSoup(webpage)
numDiv = soup2.find('div', {'class': 'numerical-nav'})
if numDiv :
links = numDiv.findChildren('a') [-1]
loopCount = int(links.text)
for i in range(1, loopCount) :
webpage = urlopen(BASE_WSITE_URL + 'movies/index.php?lang=' + categoryUrlSuffix + queryParms + '&page=' + str(i)).read()
if re.match('page not found', webpage):
break
soup2 = BeautifulSoup.BeautifulSoup(webpage)
for row in soup2('a', {'class' : 'movie-title'}) :
print row.contents
titleInfo = ''.join(row.contents)
movieInfoUrl = row['href']
title = {}
title['info'] = titleInfo
title['link'] = movieInfoUrl
titles.append(title)
return titles
示例8: retieveMovieStreams
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def retieveMovieStreams(request_obj, response_obj):
soup = None
if request_obj.get_data().has_key('movieInfoUrl'):
html = HttpUtils.HttpClient().getHtmlContent(url=(BASE_WSITE_URL + request_obj.get_data()['movieInfoUrl'][3:]))
soup = BeautifulSoup.BeautifulSoup(html)
elif request_obj.get_data().has_key('moviePageUrl'):
contentDiv = BeautifulSoup.SoupStrainer('div', {'dir':'ltr'})
soup = HttpUtils.HttpClient().getBeautifulSoup(url=request_obj.get_data()['moviePageUrl'], parseOnlyThese=contentDiv)
if soup == None:
return
videoSourceLink = None
scriptTags = []
for row in soup('script', {'type':'text/javascript'}):
if re.search('jwplayer', ''.join(row.contents)):
jwplayer = ''.join(row.contents)
m_obj = re.search(r'({.*})', jwplayer)
if m_obj:
jwplayerStr = m_obj.group(1).replace("'", "\"")
matches = re.search('"file": "(.+?)"', jwplayerStr, re.IGNORECASE)
if matches:
videoSourceLink = matches.group(1)
break
XBMCInterfaceUtils.displayDialogMessage('Do you know?', 'The content of this add-on is from www.einthusan.com.', 'Please help Einthusan by visiting his website regularly.', 'The developer has no relation with www.einthusan.com. OK to proceed!', msgType='[B]INFO & REQUEST: [/B]')
item = ListItem()
item.set_next_action_name('Play')
item.get_moving_data()['videoStreamUrl'] = videoSourceLink
xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['movieTitle'])
if(request_obj.get_data().has_key('videoInfo')):
meta = request_obj.get_data()['videoInfo']
xbmcListItem.setIconImage(meta['thumb_url'])
xbmcListItem.setThumbnailImage(meta['cover_url'])
xbmcListItem.setInfo('video', meta)
item.set_xbmc_list_item_obj(xbmcListItem)
response_obj.addListItem(item)
示例9: __prepareVideoLink__
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def __prepareVideoLink__(videoSourceLink):
new_items = []
url = videoSourceLink
if re.search('wp.me', url, re.I):
url = HttpUtils.getRedirectedUrl(url)
if not url.startswith('http://'):
url = 'http://' + url
Logger.logDebug(url)
# contentDiv = BeautifulSoup.SoupStrainer('div', {'class':'left_articles'})
# soup = BeautifulSoup.BeautifulSoup(html, contentDiv)
html = HttpUtils.HttpClient().getHtmlContent(url)
dek = EnkDekoder.dekode(html)
Logger.logDebug(dek)
if dek is not None:
html = dek
html = html.replace('\n\r', '').replace('\r', '').replace('\n', '').replace('\\', '')
children = []
if re.search('http://videos.stvflicks.com/', html):
docId = re.compile('http://videos.stvflicks.com/(.+?).mp4"').findall(html)[0]
children.append('src="http://videos.stvflicks.com/' + docId + '.mp4"')
elif re.search('http://playcineflix.com/', html):
docId = re.compile('http://playcineflix.com/(.+?).mp4"').findall(html)[0]
children.append('src="http://playcineflix.com/' + docId + '.mp4"')
elif re.search('https://video.google.com/get_player', html):
docId = re.compile('docid=(.+?)"').findall(html)[0]
children.append('src="https://docs.google.com/file/d/' + docId + '/preview"')
elif re.search('http://videos.videopress.com/', html):
docId = re.compile('type="video/mp4" href="http://videos.videopress.com/(.+?).mp4"').findall(html)[0]
children.append('src="http://videos.videopress.com/' + docId + '.mp4"')
else:
children = re.compile('<embed(.+?)>').findall(html)
if children is None or len(children) == 0:
children = re.compile('<iframe(.+?)>').findall(html)
Logger.logDebug(children)
for child in children:
video_url = re.compile('src="(.+?)"').findall(child)[0]
if(re.search('http://ads', video_url, re.I) or re.search('http://ax-d', video_url, re.I)):
continue
if video_url.startswith('http://goo.gl/'):
Logger.logDebug('Found google short URL = ' + video_url)
video_url = HttpUtils.getRedirectedUrl(video_url)
Logger.logDebug('After finding out redirected URL = ' + video_url)
if re.search('videos.desionlinetheater.com', video_url):
XBMCInterfaceUtils.displayDialogMessage('Unable to parse', 'A new HTML Guardian is used to protect the page', 'Sounds technical!! hmm, it means cannot find video.', 'Fix: Find me JavaScript Interpreter online service')
video_hosting_info = SnapVideo.findVideoHostingInfo(video_url)
if video_hosting_info is None:
Logger.logDebug('Unrecognized video_url = ' + video_url)
continue
video_source_img = video_hosting_info.get_video_hosting_image()
new_item = ListItem()
new_item.add_request_data('videoTitle', 'Part #')
new_item.add_request_data('videoLink', video_url)
new_item.add_moving_data('videoSourceImg', video_source_img)
new_item.add_moving_data('videoSourceName', video_hosting_info.get_video_hosting_name())
new_item.set_next_action_name('Play_Stream')
xbmcListItem = xbmcgui.ListItem(label='Part #', iconImage=video_source_img, thumbnailImage=video_source_img)
new_item.set_xbmc_list_item_obj(xbmcListItem)
new_items.append(new_item)
return new_items
示例10: displayUC
# 需要导入模块: from common import XBMCInterfaceUtils [as 别名]
# 或者: from common.XBMCInterfaceUtils import displayDialogMessage [as 别名]
def displayUC(request_obj, response_obj):
print 'UNDER CONSTRUCTION'
XBMCInterfaceUtils.displayDialogMessage(heading='UNDER Construction', line1='Please wait for update!!', line2='Enjoy HD movies for the time being.', line3='')