Exemple #1
0
def get_login():
    session_id=''
    d = xbmcgui.Dialog()
    ans=d.yesno('tmdb Browser','You Need to Login to Perform this Funciton','','Would you Like to Set your tmdb Credentials?')
    if ans:
        addon.openSettings()
        if addon.getSetting('username')!='' and addon.getSetting('password')!='':
            session_id=tmdb.validate_new_user(addon.getSetting('username'),addon.getSetting('password'))
            if session_id!='':
                addon.setSetting('session_id',session_id)
                dialog =xbmcgui.Dialog()
                dialog.notification('themoviedb.org Browser', 'themoviedb.org Login Success', xbmcgui.NOTIFICATION_INFO, 5000)
                return session_id
            else:
                dialog =xbmcgui.Dialog()
                dialog.notification('themoviedb.org Browser', 'themoviedb.org Login Failed', xbmcgui.NOTIFICATION_ERROR, 5000)
                return ''
    else:
        return ''
Exemple #2
0
# Random trailer player
#
# Author - kzeleny
# Version - 1.1.8
# Compatibility - Frodo/Gothum
#
import xbmc
import xbmcgui
import xbmcaddon
from resources.lib import tmdb
from resources.lib import movies
from resources.lib import people
from resources.lib import tvshows
from resources.lib import opening

addon = xbmcaddon.Addon()
addon_path = addon.getAddonInfo('path')
start_mode=addon.getSetting('start_mode')

if addon.getSetting('session_id')=='' and addon.getSetting('username')!='' and addon.getSetting('password')!='':
    addon.setSetting('session_id',tmdb.validate_new_user(addon.getSetting('username'),addon.getSetting('password')))

if start_mode=='0':
    opening.startup()
elif start_mode=='1':
    people.startup()
elif start_mode=='2':
    tvshows.startup()
else:
    movies.startup()