Exemplo n.º 1
0
def MusicList(token, uid):
    try:
        if checkConnection():
            return call_api('audio.get', [('uid', uid)], token)
        return ListFromDir(chachedir)
    except:
        return None
Exemplo n.º 2
0
def MusicList(token, uid):
    try:
        if checkConnection():
            return call_api('audio.get', [('uid', uid)], token)
        return ListFromDir(chachedir)
    except:
        return None
Exemplo n.º 3
0
 def GetMusicListFromUID(self, uid):
     token = self.user_params['token']
     try:
         if checkConnection():
             return call_api('audio.get', [('uid', uid)], token)
         return ListFromDir(self.chache_dir)
     except:
         return None
Exemplo n.º 4
0
 def GetMusicListFromUID(self, uid):
     token = self.user_params['token']
     try:
         if checkConnection():
             return call_api('audio.get', [('uid', uid)], token)
         return ListFromDir(self.chache_dir)
     except:
         return None
Exemplo n.º 5
0
def main():
    global user_id
    global token
    user_id = None
    token = None
    li = None

    email = user_params['email']  #raw_input("Email: ")
    password = user_params['password']  #getpass.getpass()
    client_id = "2951857"  # Vk application ID

    print 'Checking conection....'
    if checkConnection():
        print 'Connecting to vk.com...'
        token, user_id = auth(email, password, client_id,
                              "users,offline,friends,audio")
    else:
        print 'Failed to connect google.com'
        print 'Loading chache'

    print 'Getting playlist...'
    li = MusicList(token, user_id)

    print 'Creating daemon...'
    global player
    player = VKPlayer(li)
    player.start()

    prlist = MusicListTitle(li)
    print prlist

    inputthread = Thread(target=InputCycle)

    inputthread.start()

    inputthread.join()
    player.Exit()
    player.join()
Exemplo n.º 6
0
def main():
    global user_id
    global token
    user_id = None
    token = None
    li = None

    email = user_params['email']#raw_input("Email: ")
    password = user_params['password']#getpass.getpass()
    client_id = "2951857" # Vk application ID

    print 'Checking conection....'
    if checkConnection():
        print 'Connecting to vk.com...'
        token, user_id = auth(email, password, client_id, "users,offline,friends,audio")
    else:
        print 'Failed to connect google.com'
        print 'Loading chache'    

    print 'Getting playlist...'
    li = MusicList(token, user_id)

    print 'Creating daemon...'
    global player
    player = VKPlayer(li)
    player.start()

    prlist = MusicListTitle(li)
    print prlist

    inputthread = Thread(target=InputCycle)

    inputthread.start()

    inputthread.join()
    player.Exit()
    player.join()