cloudservice = xfilesharing.xfilesharing( instanceName, custom_domain, username, password, auth_token, user_agent) else: cloudservice = xfilesharing.xfilesharing( instanceName, domain, username, password, auth_token, user_agent) except: pass else: xbmcgui.Dialog().ok(ADDON.getLocalizedString(30000), ADDON.getLocalizedString(30036)) xbmcplugin.endOfDirectory(plugin_handle) # immediately play resulting (is a video) (videoURL, title) = cloudservice.getPublicLink(url) item = xbmcgui.ListItem(path=videoURL) item.setInfo(type="Video", infoLabels={"Title": title}) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # update the authorization token in the configuration file if we had to login for a new one during this execution run if instanceName != '' and auth_token != cloudservice.auth and save_auth == 'true': ADDON.setSetting(cloudservice.instanceName + '_auth_token', cloudservice.auth) #clear the authorization token elif mode == 'clearauth': ADDON.setSetting('auth_token', '') xbmcplugin.endOfDirectory(plugin_handle)
username = ADDON.getSetting(instanceName + '_username') password = ADDON.getSetting(instanceName + '_password') save_auth = ADDON.getSetting(instanceName + '_save_auth') auth_token = ADDON.getSetting(instanceName + '_auth_token') cloudservice = xfilesharing.xfilesharing(instanceName, domain, username, password, auth_token, user_agent) except: pass else: xbmcgui.Dialog().ok(ADDON.getLocalizedString(30000), ADDON.getLocalizedString(30036)) xbmcplugin.endOfDirectory(plugin_handle) # immediately play resulting (is a video) videoURL = cloudservice.getPublicLink(url) item = xbmcgui.ListItem(path=videoURL) log('play url: ' + videoURL) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # update the authorization token in the configuration file if we had to login for a new one during this execution run if instanceName != '' and auth_token != cloudservice.auth and save_auth == 'true': ADDON.setSetting(cloudservice.instanceName + '_auth_token', cloudservice.auth) #clear the authorization token elif mode == 'clearauth': ADDON.setSetting('auth_token', '') xbmcplugin.endOfDirectory(plugin_handle)
domain = ADDON.getSetting(instanceName+'_domain') custom_domain = ADDON.getSetting(instanceName+'_custom_domain') username = ADDON.getSetting(instanceName+'_username') password = ADDON.getSetting(instanceName+'_password') save_auth = ADDON.getSetting(instanceName+'_save_auth') auth_token = ADDON.getSetting(instanceName+'_auth_token') cloudservice = xfilesharing.xfilesharing(instanceName,domain,username, password, auth_token, user_agent) except : pass else: xbmcgui.Dialog().ok(ADDON.getLocalizedString(30000), ADDON.getLocalizedString(30036)) xbmcplugin.endOfDirectory(plugin_handle) # immediately play resulting (is a video) videoURL = cloudservice.getPublicLink(url) item = xbmcgui.ListItem(path=videoURL) log('play url: ' + videoURL) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # update the authorization token in the configuration file if we had to login for a new one during this execution run if instanceName != '' and auth_token != cloudservice.auth and save_auth == 'true': ADDON.setSetting(cloudservice.instanceName+'_auth_token', cloudservice.auth) #clear the authorization token elif mode == 'clearauth': ADDON.setSetting('auth_token', '')
if domain == 'CUSTOM': for r in re.finditer('http://([^\/]+)' , custom_domain, re.DOTALL): custom_domain = r.group(1) cloudservice = xfilesharing.xfilesharing(instanceName,custom_domain,username, password, auth_token, user_agent) else: cloudservice = xfilesharing.xfilesharing(instanceName, domain ,username, password, auth_token, user_agent) except : pass else: xbmcgui.Dialog().ok(ADDON.getLocalizedString(30000), ADDON.getLocalizedString(30036)) xbmcplugin.endOfDirectory(plugin_handle) # immediately play resulting (is a video) (videoURL,title) = cloudservice.getPublicLink(url) item = xbmcgui.ListItem(path=videoURL) item.setInfo( type="Video", infoLabels={ "Title": title } ) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) # update the authorization token in the configuration file if we had to login for a new one during this execution run if instanceName != '' and auth_token != cloudservice.auth and save_auth == 'true': ADDON.setSetting(cloudservice.instanceName+'_auth_token', cloudservice.auth) #clear the authorization token elif mode == 'clearauth': ADDON.setSetting('auth_token', '')