コード例 #1
0
def upd_xy_old():
    import random
    import scanxy
    Lip = get_channels(provider + '/ip')
    for i in range(3):
        pref = random.choice(Lip)
        print pref
        tm = get_channels(provider + '/' + pref)['time']
        if time.time() - tm > 360000:
            L = scanxy.scaner(provider, pref, port)
            save_channels(provider + '/' + pref, L)
            return L
コード例 #2
0
def upd_xy():
    import random
    import scanxy
    Lip = get_channels(provider + '/ip')
    Lcn = get_channels(provider + '/cl')
    for i in range(3):
        pref = random.choice(Lip)
        print pref
        tm = get_channels(provider + '/' + pref)['time']
        if time.time() - tm > 360000:
            L = scanxy.scaner(provider, pref, port)
            Lr = []
            for uip in L:
                mcast = random.choice(Lcn)['url'].replace(prov + ':', '')
                udpxy = uip + ':' + str(port)
                stream = 'http://%s/udp/%s\n' % (udpxy, mcast)
                print stream
                if test(stream) != '404':
                    Lr.append(uip)
            save_channels(provider + '/' + pref, Lr)
            return L