示例#1
0
hr = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(hr)
urllib2.install_opener(opener)

#params = common.getParameters(sys.argv[2])
# issue: https://github.com/HenrikDK/xbmc-common-plugin-functions/issues/6
params = get_params()

mode = params.get('mode', '')
page = params.get('page', 1)
q = params.get('q', '')
r = params.get('r', '')
t = params.get('t', '')
i = params.get('i', 0)

if mode == '': main_menu()
elif mode == 'login': do_login()
elif mode == 'favorite': sub_menu({'mode': mode, 'page': page})
elif mode == 'find': do_find({'mode': mode, 'page': page, 'q': q})

elif mode == 'release': sub_release({'mode': mode, 'r': r})
elif mode == 'series': sub_series({'mode': mode, 'r': r, 't': t})
elif mode == 'play': sub_play({'mode': mode, 'r': r, 't': t, 'i': i})
elif mode == 'cleancache':
    from tccleaner import TextureCacheCleaner as tcc
    tcc().remove_like('%shiza-project.com/upload/covers/%', True)
    tcc().remove_like('%video.sibnet.ru/upload/cover/%', True)

else:
    sub_menu({'mode': mode, 'page': page})
params = common.getParameters(sys.argv[2])

mode = params.get('mode', '')

if mode == '':
    main_menu()

elif mode == 'live':
    live()

elif mode == 'programs':
    programs()

elif mode == 'podcasts':
    podcasts()

elif mode == 'program':
    program(params)

elif mode == 'play':
    play_video(params)

elif mode == 'search':
    search(params)

elif mode == 'cleancache':
    from tccleaner import TextureCacheCleaner as tcc
    tcc().remove_like('%currenttime.tv%', True)
    tcc().remove_like('%rferl.org%', True)
    tcc().remove_like('%voanews.com%', True)
示例#3
0
try:
    cj.load(fcookies, True, True)
except:
    pass

hr = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(hr)
urllib2.install_opener(opener)

params = common.getParameters(sys.argv[2])
params['mode'] = mode = params.get('mode', 'list')
params['page'] = int(params.get('page', 1))

if mode == 'login':
    do_login()

elif mode == 'games':
    list_games(params)

elif mode == 'list':
    tcc().remove_like(LIVE_PREVIEW_TEMPLATE, False)
    main_menu(params)

elif mode == 'favorites':
    tcc().remove_like(LIVE_PREVIEW_TEMPLATE, False)
    params['page'] = 0
    list_streams(params)

elif mode == 'play':
    play_stream(params)
if mode == 'description':
    get_description(params['u'], params['id'], True)
    xbmcplugin.endOfDirectory(handle, False, True, False)
    xbmc.executebuiltin('Container.Refresh')

if mode == 'new_serials':
    new_serials(params)

if mode == 'abc':
    ABClist(params)

if mode == 'serials':
    show_serials(params)

if mode == 'seasons':
    show_seasons(params)

if mode == 'season':
    show_season(params)

if mode == 'episode':
    play_episode(params)

if mode == 'cleancache':
    from tccleaner import TextureCacheCleaner as tcc
    tcc().remove_like('%fanimg.site%', True)
    tcc().remove_like('%fanserials%', True)

connect.close()