Пример #1
0
        try:
            cloudservice
            docontinue = 1
        except NameError:
            xbmcgui.Dialog().ok(
                ADDON.getLocalizedString(30000),
                'Please setup a service in Addon-Settings->Accounts')
            #log(addon.getLocalizedString(30050)+ 'gdrive-login', True)
            xbmcplugin.endOfDirectory(plugin_handle)

        if docontinue and cloudservice.isLogin:
            cacheType = ADDON.getSetting('playback_type')

            singlePlayback = ''
            try:
                videos = cloudservice.getVideosList(folderID=folderID)
            except:
                xbmcgui.Dialog().ok(
                    ADDON.getLocalizedString(30000),
                    'Please setup a service in Addon-Settings->Accounts')
                #log(addon.getLocalizedString(30050)+ 'gdrive-login', True)
                xbmcplugin.endOfDirectory(plugin_handle)

            for title in sorted(videos.iterkeys()):
                if videos[title]['mediaType'] == cloudservice.MEDIA_TYPE_VIDEO:
                    addVideo(videos[title]['url'], {
                        'title': title,
                        'plot': title
                    }, title)
                    if singlePlayback == '':
                        singlePlayback = title
Пример #2
0
        # show entries of a single account (such as folder)
        elif instanceName != '':

                    username = ADDON.getSetting(instanceName+'_username')
                    domain = ADDON.getSetting(instanceName+'_domain')
                    custom_domain = ADDON.getSetting(instanceName+'_custom_domain')
                    password  = ADDON.getSetting(instanceName+'_password')
                    save_auth  = ADDON.getSetting(instanceName+'_save_auth')
                    auth_token = ADDON.getSetting(instanceName+'_auth_token')
                    update_token_name = instanceName+'_auth_token'
                    cloudservice = xfilesharing.xfilesharing(instanceName, domain, username, password, auth_token, user_agent)

        cacheType = ADDON.getSetting('playback_type')

        singlePlayback=''
        videos = cloudservice.getVideosList(folderID=folderID)

        for title in sorted(videos.iterkeys()):
            if videos[title]['mediaType'] == cloudservice.MEDIA_TYPE_VIDEO:
                addVideo(videos[title]['url'],
                             { 'title' : title , 'plot' : title }, title)
                if singlePlayback == '':
                    singlePlayback = title
            else:
                addDirectory(videos[title]['url'],title)

        if singlePlayback != '':
            item = xbmcgui.ListItem(path=videos[singlePlayback]['url'])
            log('play url: ' + singlePlayback)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)