def router(paramstring):
    """
    Router function that calls other functions
    depending on the provided paramstring
    :param paramstring:
    """
    params = dict(parse_qsl(paramstring))
    if params:
        if params['action'] == 'listcategories':
            if params['category'] == 'settings':
                addon.openSettings()
            else:
                matches.make_matches_list(params)
        elif params['action'] == 'listmatches':
            play.play_video(params)
        elif params['action'] == 'clearticket':
            stream_auth.clear_ticket()
        elif params['action'] == 'sendreport':
            utils.user_report()
        elif params['action'] == 'open_ia_settings':
            try:
                import drmhelper
                if drmhelper.check_inputstream(drm=False):
                    ia = drmhelper.get_addon()
                    ia.openSettings()
                else:
                    utils.dialog_message(
                        "Can't open inputstream.adaptive settings")
            except Exception:
                utils.dialog_message(
                    "Can't open inputstream.adaptive settings")
    else:
        categories.list_categories()
Beispiel #2
0
 def test_user_report(self, mock_is_debug, mock_connection_info,
                      mock_send_report, mock_version):
     mock_version.return_value = '1.0.1'
     mock_is_debug.return_value = True
     mock_connection_info.return_value = fakes.VALID_CONNECTION_INFO[0]
     utils.user_report()
     mock_send_report.assert_called_once_with(
         'User initiated report',
         connection_info=fakes.VALID_CONNECTION_INFO[0])
def main():
    params_str = sys.argv[2]
    params = utils.get_url(params_str)
    addon = xbmcaddon.Addon()
    if (len(params) == 0):
        categories.make_category_list()

    elif 'action' in params:
        action = params.get('action')

        if action in ['program_list', 'livestreams']:
            play.play(params_str)
        elif action in ['series_list']:
            if params.get('type') == 'Series':
                if params.get('dummy') == 'True':
                    return
                else:
                    programs.make_programs_list(params)
            else:
                play.play(params_str)
        elif action == 'collect_list':
            series.make_series_list(params, atoz=False)
        elif action == 'category_list':
            category = params.get('category')
            if category == 'settings':
                addon.openSettings()
            elif category == 'livestreams':
                live.make_livestreams_list()
            elif category == 'search':
                search.make_search_history_list()
            else:
                if addon.getSetting('SHOW_COLLECTIONS') == '1':
                    collect.make_collect_list(params)
                else:
                    series.make_series_list(params)
        elif action == 'searchhistory':
            if params.get('name') == 'New Search':
                search.get_search_input()
            else:
                search.make_search_list(params)
        elif action == 'removesearch':
            search.remove_from_search_history(params.get('name'))
        elif action == 'sendreport':
            utils.user_report()
        elif action == 'open_ia_settings':
            try:
                import drmhelper
                if drmhelper.check_inputstream(drm=False):
                    ia = drmhelper.get_addon()
                    ia.openSettings()
                else:
                    utils.dialog_message(
                        "Can't open inputstream.adaptive settings")
            except Exception:
                utils.dialog_message(
                    "Can't open inputstream.adaptive settings")
Beispiel #4
0
def main():
    addon = xbmcaddon.Addon()
    if addon.getSetting('firstrun') == 'true':
        utils.dialog_message(
            'Welcome to the new On Demand add-on. An SBS On Demand account '
            'is now required to use this service. Please sign up at '
            'sbs.com.au or in the mobile app, then enter your details in '
            'the add-on settings.')
        comm.get_login_token()
        addon.setSetting('firstrun', 'false')
    params_str = sys.argv[2]
    params = utils.get_url(params_str)
    utils.log(str(params))
    if len(params) == 0:
        index.make_index_list()
    elif params.get('obj_type') == 'Program':
        play.play(params_str)
    elif 'feed_url' in params:
        index.make_entries_list(params)
    elif 'category' in params or params.get('item_type') in [
            'ProgramGenre', 'FilmGenre', 'Channel'
    ]:
        if params.get('category') == 'Search':
            index.make_search_history_list()
        else:
            index.make_category_list(params)
    elif 'action' in params:
        action = params.get('action')
        if action == 'favouritescategories':
            index.make_favourites_categories_list()
        elif action == 'addfavourites':
            comm.add_to_favourites(params)
        elif action == 'removefavourites':
            comm.remove_from_favourites(params)
            xbmc.executebuiltin('Container.Refresh')
        elif action == 'searchhistory':
            if params.get('name') == 'New Search':
                search.get_search_input()
            else:
                index.make_search_list(params)
        elif action == 'removesearch':
            search.remove_from_search_history(params.get('name'))
        elif action == 'sendreport':
            utils.user_report()
        elif action == 'settings':
            xbmcaddon.Addon().openSettings()
        elif action == 'logout':
            comm.clear_login_token()
        elif action == 'login':
            comm.get_login_token()
            xbmc.executebuiltin('Container.Refresh')
Beispiel #5
0
def router(paramstring):
    """
    Router function that calls other functions depending on the
    provided paramstring
    """
    params = dict(parse_qsl(paramstring))
    if paramstring:
        if paramstring != 'content_type=video':
            if params['action'] == 'listcategories':
                if params['category'] == 'All Shows':
                    menu.make_series_list(paramstring)
                elif params['category'] == 'Live TV':
                    menu.make_live_list(paramstring)
                else:
                    menu.make_series_list(paramstring)
            elif params['action'] == 'listseries':
                menu.make_episodes_list(paramstring)
            elif params['action'] == 'listepisodes':
                play.play_video(params)
            elif params['action'] == 'listchannels':
                play.play_video(params)
            elif params['action'] == 'settings':
                xbmcaddon.Addon().openSettings()
            elif params['action'] == 'reinstall_widevine_cdm':
                drmhelper.get_widevinecdm()
            elif params['action'] == 'reinstall_ssd_wv':
                drmhelper.get_ssd_wv()
            elif params['action'] == 'sendreport':
                utils.user_report()
            elif params['action'] == 'update_ia':
                addon = drmhelper.get_addon(drm=True)
                if not drmhelper.is_ia_current(addon, latest=True):
                    if xbmcgui.Dialog().yesno(
                        'Upgrade?', ('Newer version of inputstream.adaptive '
                                     'available ({0}) - would you like to '
                                     'upgrade to this version?'.format(
                                        drmhelper.get_latest_ia_ver()))):
                        drmhelper.get_ia_direct(update=True, drm=True)
                else:
                    ver = addon.getAddonInfo('version')
                    utils.dialog_message('Up to date: Inputstream.adaptive '
                                         'version {0} installed and enabled.'
                                         ''.format(ver))
    else:
        menu.list_categories()
def main():
    params_str = sys.argv[2]
    params = utils.get_url(params_str)
    utils.log('Loading with params: {0}'.format(params))

    if len(params) == 0:
        index.make_list()
    elif 'category' in params:
        if params['category'] == 'Settings':
            xbmcaddon.Addon().openSettings()
        elif params['category'] == 'Team Video':
            teams.make_list()
        elif params['category'] == 'All Match Replays':
            index.make_seasons_list()
        else:
            videos.make_list(params)
    elif 'season' in params:
        rounds.make_rounds(params)
    elif 'team' in params:
        videos.make_list(params)
    elif 'round_id' in params:
        videos.make_list(params)
    elif 'title' in params:
        play.play(params_str)
    elif 'action' in params:
        if params['action'] == 'cleartoken':
            stream_auth.clear_token()
        elif params['action'] == 'sendreport':
            utils.user_report()
        elif params['action'] == 'iap_help':
            stream_auth.iap_help()
        elif params['action'] == 'open_ia_settings':
            try:
                import drmhelper
                if drmhelper.check_inputstream(drm=False):
                    ia = drmhelper.get_addon()
                    ia.openSettings()
                else:
                    utils.dialog_message(
                        "Can't open inputstream.adaptive settings")
            except Exception:
                utils.dialog_message(
                    "Can't open inputstream.adaptive settings")
def router(paramstring):
    """
    Router function that calls other functions depending on the
    provided paramstring
    """
    params = dict(parse_qsl(paramstring))
    if paramstring:
        if paramstring != 'content_type=video':
            if params['action'] == 'listcategories':
                if params['category'] == 'Live TV':
                    menu.make_live_list(paramstring)
                else:
                    menu.make_series_list(paramstring)
            elif params['action'] == 'listseries':
                menu.make_episodes_list(paramstring)
            elif params['action'] in ['listepisodes', 'listchannels']:
                play.play_video(params)
            elif params['action'] == 'settings':
                xbmcaddon.Addon().openSettings()
            elif params['action'] == 'reinstall_widevine_cdm':
                drmhelper.get_widevinecdm()
            elif params['action'] == 'reinstall_ssd_wv':
                drmhelper.get_ssd_wv()
            elif params['action'] == 'sendreport':
                utils.user_report()
            elif params['action'] == 'update_ia':
                addon = drmhelper.get_addon(drm=True)
                if not drmhelper.is_ia_current(addon, latest=True):
                    if xbmcgui.Dialog().yesno(
                        'Upgrade?', ('Newer version of inputstream.adaptive '
                                     'available ({0}) - would you like to '
                                     'upgrade to this version?'.format(
                                        drmhelper.get_latest_ia_ver()))):
                        drmhelper.get_ia_direct(update=True, drm=True)
                else:
                    ver = addon.getAddonInfo('version')
                    utils.dialog_message('Up to date: Inputstream.adaptive '
                                         'version {0} installed and enabled.'
                                         ''.format(ver))
    else:
        menu.list_categories()
Beispiel #8
0
def router(paramstring):
    """
    Router function that calls other functions
    depending on the provided paramstring
    :param paramstring:
    """
    params = dict(parse_qsl(paramstring))
    if params:
        if params['action'] == 'listcategories':
            if params['category'] == 'Featured':
                menu.list_featured()
            else:
                menu.list_shows(params)
        elif params['action'] == 'listshows':
            menu.list_episodes(params)
        elif (params['action'] == 'listepisodes'
              or params['action'] == 'listfeatured'):
            play.play_video(params)
        elif params['action'] == 'sendreport':
            utils.user_report()
    else:
        menu.list_categories()
def main():
    """
    Router function that calls other functions depending on the
    provided paramstring
    """
    params = dict(parse_qsl(sys.argv[2][1:]))
    utils.log('called with params: {0}'.format(str(params)))
    if (len(params) == 0):
        menu.list_categories()
    else:

        if params['action'] == 'listcategories':
            if params['category'] == 'Live TV':
                menu.make_live_list(params)
            else:
                menu.make_series_list(params)
        elif params['action'] == 'listseries':
            menu.make_episodes_list(params)
        elif params['action'] in ['listepisodes', 'listchannels']:
            play.play_video(params)
        elif params['action'] == 'settings':
            xbmcaddon.Addon().openSettings()
        elif params['action'] == 'sendreport':
            utils.user_report()
         'The Kodi Favourite item being accessed was created with an '
         'earlier version of the iView add-on and is no longer '
         'compatible. Please remove this link and update with a new '
         'one')
 elif 'play' in params:
     play.play(params_str)
 elif 'series_url' in params:
     programs.make_programs_list(params_str)
 elif 'category' in params:
     if params['category'] == 'settings':
         xbmcaddon.Addon().openSettings()
     else:
         series.make_series_list(params_str)
 elif 'action' in params:
     if params['action'] == 'sendreport':
         utils.user_report()
     elif params['action'] == 'update_ia':
         try:
             import drmhelper
             addon = drmhelper.get_addon(drm=False)
             if not drmhelper.is_ia_current(addon, latest=True):
                 if xbmcgui.Dialog().yesno(
                         'Upgrade?',
                     ('Newer version of inputstream.adaptive '
                      'available ({0}) - would you like to '
                      'upgrade to this version?'.format(
                          drmhelper.get_latest_ia_ver()))):
                     drmhelper.get_ia_direct(update=True, drm=False)
             else:
                 ver = addon.getAddonInfo('version')
                 utils.dialog_message('Up to date: Inputstream.adaptive '
         'The Kodi Favourite item being accessed was created with an '
         'earlier version of the iView add-on and is no longer '
         'compatible. Please remove this link and update with a new '
         'one')
 elif 'play' in params:
     play.play(params_str)
 elif 'series_url' in params:
     programs.make_programs_list(params_str)
 elif 'category' in params:
     if params['category'] == 'settings':
         xbmcaddon.Addon().openSettings()
     else:
         series.make_series_list(params_str)
 elif 'action' in params:
     if params['action'] == 'sendreport':
         utils.user_report()
     elif params['action'] == 'update_ia':
         try:
             import drmhelper
             addon = drmhelper.get_addon(drm=False)
             if not drmhelper.is_ia_current(addon, latest=True):
                 if xbmcgui.Dialog().yesno(
                     'Upgrade?', ('Newer version of inputstream.adaptive '
                                  'available ({0}) - would you like to '
                                  'upgrade to this version?'.format(
                                     drmhelper.get_latest_ia_ver()))):
                     drmhelper.get_ia_direct(update=True, drm=False)
             else:
                 ver = addon.getAddonInfo('version')
                 utils.dialog_message('Up to date: Inputstream.adaptive '
                                      'version {0} installed and enabled.'