skygo.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:plugin.video.skygo 作者: trummerjo 项目源码 文件源码
def play(self, manifest_url, package_code, parental_rating=0, info_tag=None, apix_id=None):
        # Inputstream settings
        is_addon = getInputstreamAddon()
        if not is_addon:
            xbmcgui.Dialog().notification('SkyGo Fehler', 'Addon "inputstream.adaptive" fehlt!', xbmcgui.NOTIFICATION_ERROR, 2000, True)
            return False

        #Jugendschutz
        if not self.parentalCheck(parental_rating, play=True):
            xbmcgui.Dialog().notification('SkyGo - FSK ' + str(parental_rating), 'Keine Berechtigung zum Abspielen dieses Eintrages', xbmcgui.NOTIFICATION_ERROR, 2000, True)
            return False

        if self.login():
            if self.may_play(package_code):
                init_data = None
                # create init data for license acquiring
                if apix_id:
                    init_data = self.get_init_data(self.sessionId, apix_id)
                # Prepare new ListItem to start playback
                li = xbmcgui.ListItem(path=manifest_url)
                if info_tag:
                    li.setInfo('video', info_tag)

                li.setProperty('inputstream.adaptive.license_type', self.license_type)
                li.setProperty('inputstream.adaptive.manifest_type', 'ism')
                if init_data:
                    li.setProperty('inputstream.adaptive.license_key', self.license_url)
                    li.setProperty('inputstream.adaptive.license_data', init_data)
                li.setProperty('inputstreamaddon', 'inputstream.adaptive')
                # Start Playing
                xbmcplugin.setResolvedUrl(addon_handle, True, listitem=li)
            else:
                xbmcgui.Dialog().notification('SkyGo Fehler', 'Keine Berechtigung zum Abspielen dieses Eintrages', xbmcgui.NOTIFICATION_ERROR, 2000, True)
        else:
            xbmcgui.Dialog().notification('SkyGo Fehler', 'Fehler bei Login', xbmcgui.NOTIFICATION_ERROR, 2000, True)
            print 'Fehler beim Einloggen'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号