コード例 #1
0
def dl_tvh_tdc():
    try:
        if not os.path.isdir(
                '/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend'
        ):
            show_error("tvheadend not installed")
            return

        with util.ServiceControl('service.multimedia.tvheadend.service'):
            removeDir(
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters"
            )
            os.makedirs(
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters"
            )
            downloadWithProgress(
                "http://84.22.103.245/lnb/twin/51438d1ecd9318be113df0e7cddf46ea",
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters/51438d1ecd9318be113df0e7cddf46ea",
                'Setting up twin dish connection...')
            downloadWithProgress(
                "http://84.22.103.245/lnb/twin/681e8b6ccbe787334dc80186a64734d2",
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters/681e8b6ccbe787334dc80186a64734d2",
                'Setting up twin dish connection...')
    except DownloadCanceledException:
        show_error('Canceled')
    except:
        util.ERROR()
        show_error("Error")
コード例 #2
0
def dl_oscam():
    # oscam
    try:
        for secondTry in range(0, 1):
            login_data = requests.get(OSCAM_URL %
                                      (USERNAME, PASSWORD, MACADDR)).json()
            login_status = login_data['status']
            chlist_url = ""
            if login_status is True:
                chlist_url = login_data['download_url']
                break
            else:
                message = login_data['message']
                show_error(message)
                if secondTry or not getCredentials():
                    return

        if not os.path.isdir(
                '/storage/.kodi/userdata/addon_data/service.softcam.oscam/config'
        ):
            show_error("oscam not installed")
            return

        with util.ServiceControl('service.softcam.oscam.service'):
            downloadWithProgress(chlist_url, OSCAM_PATH,
                                 'Downloading user settings...')

        show_error("User settings download completed.")
    except DownloadCanceledException:
        show_error('Canceled')
    except:
        util.ERROR()
        show_error("Login Failed")
コード例 #3
0
def dl_tvh_sdc():
    try:
        if not os.path.isdir(
                '/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend'
        ):
            show_error("tvheadend not installed")
            return
        show_error(
            'Please connect the dish connection to LNB 1 (lnb closest to the usb)'
        )
        with util.ServiceControl('service.multimedia.tvheadend.service'):
            removeDir(
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters"
            )
            os.makedirs(
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters"
            )
            downloadWithProgress(
                "http://84.22.103.245/lnb/51438d1ecd9318be113df0e7cddf46ea",
                "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/linuxdvb/adapters/51438d1ecd9318be113df0e7cddf46ea",
                'Setting up single dish connection...')
    except DownloadCanceledException:
        show_error('Canceled')
    except:
        util.ERROR()
        show_error("Error")
コード例 #4
0
def dl_tvh():
    import kodijsonrpc

    try:
        if not os.path.isdir('/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend'):
            show_error("tvheadend not installed")
            return

        selectConnections()

        #Set before so live TV is working when we set it
        util.LOG('Setting pvrmanager.syncchannelgroups to true...')
        result = kodijsonrpc.rpc.Settings.SetSettingValue(setting='pvrmanager.syncchannelgroups', value=True)
        util.LOG('Result: {0}'.format(result))

        with util.ServiceControl('service.multimedia.tvheadend.service'):
            removeDir("/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/channel")
            removeDir("/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/input/dvb")
            tarFile = "/storage/.kodi/userdata/addon_data/service.multimedia.tvheadend/BackUp.tar.gz"
            downloadWithProgress(TVH_URL, tarFile, 'Downloading channel fix...')
            extractTar(tarFile, "/")
            os.remove(tarFile)

        xbmc.executebuiltin('Reboot')
    except DownloadCanceledException:
        show_error('Canceled')
    except:
        util.ERROR()
        show_error("Error")