示例#1
0
def syncMyAccounts(silent=False):
    import myaccounts
    all_acct = myaccounts.getAll()
    trakt_acct = all_acct.get('trakt')
    if setting('trakt.username') != trakt_acct.get('username'):
        setSetting('trakt.isauthed', 'true')
        setSetting('trakt.token', trakt_acct.get('token'))
        setSetting('trakt.username', trakt_acct.get('username'))
        setSetting('trakt.refresh', trakt_acct.get('refresh'))
        setSetting('trakt.expires', trakt_acct.get('expires'))

    ad_acct = all_acct.get('alldebrid')
    if setting('alldebrid.username') != ad_acct.get('username'):
        setSetting('alldebrid.token', ad_acct.get('token'))
        setSetting('alldebrid.username', ad_acct.get('username'))

    pm_acct = all_acct.get('premiumize')
    if setting('premiumize.username') != pm_acct.get('username'):
        setSetting('premiumize.token', pm_acct.get('token'))
        setSetting('premiumize.username', pm_acct.get('username'))

    rd_acct = all_acct.get('realdebrid')
    if setting('realdebrid.username') != rd_acct.get('username'):
        setSetting('realdebrid.token', rd_acct.get('token'))
        setSetting('realdebrid.username', rd_acct.get('username'))
        setSetting('realdebrid.client_id', rd_acct.get('client_id'))
        setSetting('realdebrid.refresh', rd_acct.get('refresh'))
        setSetting('realdebrid.secret', rd_acct.get('secret'))

    fanart_acct = all_acct.get('fanart_tv')
    if setting('fanart.tv.api.key') != fanart_acct.get('api_key'):
        setSetting('fanart.tv.api.key', fanart_acct.get('api_key'))

    tmdb_acct = all_acct.get('tmdb')
    if setting('tmdb.api.key') != tmdb_acct.get('api_key'):
        setSetting('tmdb.api.key', tmdb_acct.get('api_key'))
    if setting('tmdb.username') != tmdb_acct.get('username'):
        setSetting('tmdb.username', tmdb_acct.get('username'))
    if setting('tmdb.password') != tmdb_acct.get('password'):
        setSetting('tmdb.password', tmdb_acct.get('password'))
    if setting('tmdb.session_id') != tmdb_acct.get('session_id'):
        setSetting('tmdb.session_id', tmdb_acct.get('session_id'))

    tvdb_acct = all_acct.get('tvdb')
    if setting('tvdb.api.key') != tvdb_acct.get('api_key'):
        setSetting('tvdb.api.key', tvdb_acct.get('api_key'))

    imdb_acct = all_acct.get('imdb')
    if setting('imdb.user') != imdb_acct.get('user'):
        setSetting('imdb.user', imdb_acct.get('user'))

    fu_acct = all_acct.get('furk')
    if setting('furk.username') != fu_acct.get('username'):
        setSetting('furk.username', fu_acct.get('username'))
        setSetting('furk.password', fu_acct.get('password'))
    if fu_acct.get('api_key', None):
        if setting('furk.api') != fu_acct.get('api_key'):
            setSetting('furk.api', fu_acct.get('api_key'))
    if not silent:
        notification(message=32114)
示例#2
0
def syncMyAccounts(silent=False):
    try:
        all_acct = myaccounts.getAll()
        trakt_acct = all_acct.get('trakt')
        if getSetting('trakt.token') != trakt_acct.get('token'):
            trakt_username = trakt_acct.get('username')
            setSetting('trakt.username', trakt_username)
            if trakt_username != '': setSetting('trakt.isauthed', 'true')
            else: setSetting('trakt.isauthed', '')
            setSetting('trakt.expires', trakt_acct.get('expires'))
            setSetting('trakt.token', trakt_acct.get('token'))
            setSetting('trakt.refresh', trakt_acct.get('refresh'))

        ad_acct = all_acct.get('alldebrid')
        if getSetting('alldebrid.username') != ad_acct.get('username'):
            setSetting('alldebrid.token', ad_acct.get('token'))
            # if getSetting('alldebrid.token') == '': setSetting('alldebrid.enable', 'false')
            setSetting('alldebrid.username', ad_acct.get('username'))

        pm_acct = all_acct.get('premiumize')
        if getSetting('premiumize.username') != pm_acct.get('username'):
            setSetting('premiumize.token', pm_acct.get('token'))
            # if getSetting('premiumize.token') == '': setSetting('premiumize.enable', 'false')
            setSetting('premiumize.username', pm_acct.get('username'))

        rd_acct = all_acct.get(
            'realdebrid'
        )  # token refresh 1hr expiry, Venom handles this internally
        if getSetting('realdebrid.username') != rd_acct.get('username'):
            setSetting('realdebrid.token', rd_acct.get('token'))
            # if getSetting('realdebrid.token') == '': setSetting('realdebrid.enable', 'false')
            setSetting('realdebrid.username', rd_acct.get('username'))
            setSetting('realdebrid.client_id', rd_acct.get('client_id'))
            setSetting('realdebrid.refresh', rd_acct.get('refresh'))
            setSetting('realdebrid.secret', rd_acct.get('secret'))

        fanart_acct = all_acct.get('fanart_tv')
        if getSetting('fanart.tv.api.key') != fanart_acct.get('api_key'):
            setSetting('fanart.tv.api.key', fanart_acct.get('api_key'))

        tmdb_acct = all_acct.get('tmdb')
        if getSetting('tmdb.api.key') != tmdb_acct.get('api_key'):
            setSetting('tmdb.api.key', tmdb_acct.get('api_key'))
        if getSetting('tmdb.username') != tmdb_acct.get('username'):
            setSetting('tmdb.username', tmdb_acct.get('username'))
        if getSetting('tmdb.password') != tmdb_acct.get('password'):
            setSetting('tmdb.password', tmdb_acct.get('password'))
        if getSetting('tmdb.session_id') != tmdb_acct.get('session_id'):
            setSetting('tmdb.session_id', tmdb_acct.get('session_id'))

        tvdb_acct = all_acct.get('tvdb')
        if getSetting('tvdb.api.key') != tvdb_acct.get('api_key'):
            setSetting('tvdb.api.key', tvdb_acct.get('api_key'))

        imdb_acct = all_acct.get('imdb')
        if getSetting('imdb.user') != imdb_acct.get('user'):
            setSetting('imdb.user', imdb_acct.get('user'))

        fu_acct = all_acct.get('furk')
        if getSetting('furk.username') != fu_acct.get('username'):
            setSetting('furk.username', fu_acct.get('username'))
            setSetting('furk.password', fu_acct.get('password'))
        if getSetting('furk.api') != fu_acct.get('api_key'):
            setSetting('furk.api', fu_acct.get('api_key'))

        if not silent: notification(message=32114)
    except:
        from resources.lib.modules import log_utils
        log_utils.error()
示例#3
0
def sync_MyAccounts(silent=False):
    import myaccounts
    from modules.settings_reader import get_setting, set_setting
    all_acct = myaccounts.getAll()
    try:
        trakt_acct = all_acct.get('trakt')
        if trakt_acct.get('username') not in ('', None):
            if get_setting('trakt_user') != trakt_acct.get('username'):
                set_setting('trakt_indicators_active', 'true')
                set_setting('watched_indicators', '1')
                kodi_utils.set_property('fen_refresh_trakt_info', 'true')
        else:
            set_setting('trakt_indicators_active', 'false')
            set_setting('watched_indicators', '0')
        set_setting('trakt_user', trakt_acct.get('username'))
    except:
        pass
    try:
        fu_acct = all_acct.get('furk')
        set_setting('furk_login', fu_acct.get('username'))
        set_setting('furk_password', fu_acct.get('password'))
        if fu_acct.get('api_key') != '':
            set_setting('furk_api_key', fu_acct.get('api_key'))
        elif get_setting('furk_api_key') != '':
            kodi_utils.ext_addon('script.module.myaccounts').setSetting(
                'furk.api.key', get_setting('furk_api_key'))
    except:
        pass
    try:
        en_acct = all_acct.get('easyNews')
        set_setting('easynews_user', en_acct.get('username'))
        set_setting('easynews_password', en_acct.get('password'))
    except:
        pass
    try:
        tmdb_acct = all_acct.get('tmdb')
        tmdb_key = tmdb_acct.get('api_key')
        if not tmdb_key: tmdb_key = '050ee5c6c85883b200be501c878a2aed'
        set_setting('tmdb_api', tmdb_key)
    except:
        pass
    try:
        fanart_acct = all_acct.get('fanart_tv')
        fanart_key = fanart_acct.get('api_key')
        if not fanart_key: fanart_key = 'fe073550acf157bdb8a4217f215c0882'
        set_setting('fanart_client_key', fanart_key)
    except:
        pass
    try:
        imdb_acct = all_acct.get('imdb')
        set_setting('imdb_user', imdb_acct.get('user'))
    except:
        pass
    try:
        rd_acct = all_acct.get('realdebrid')
        if get_setting('rd.username') != rd_acct.get('username'):
            set_setting('rd.username', rd_acct.get('username'))
            set_setting('rd.client_id', rd_acct.get('client_id'))
            set_setting('rd.refresh', rd_acct.get('refresh'))
            set_setting('rd.secret', rd_acct.get('secret'))
            set_setting('rd.token', rd_acct.get('token'))
            set_setting('rd.auth', rd_acct.get('token'))
    except:
        pass
    try:
        pm_acct = all_acct.get('premiumize')
        set_setting('pm.token', pm_acct.get('token'))
        if get_setting('pm.account_id') != pm_acct.get('username'):
            set_setting('pm.account_id', pm_acct.get('username'))
    except:
        pass
    try:
        ad_acct = all_acct.get('alldebrid')
        set_setting('ad.token', ad_acct.get('token'))
        if get_setting('ad.account_id') != ad_acct.get('username'):
            set_setting('ad.account_id', ad_acct.get('username'))
    except:
        pass
    if not silent: kodi_utils.notification(33030, time=1500)