Ejemplo n.º 1
0
 def __GET_track(self, request):
     api.login(api.username, api.password)
     node = getNode(Flag.TRACK, {'nid': request.track_id})
     streaming_url = node.get_streaming_url()
     if not streaming_url:
         raise RequestFailed()
     self.send_response(303, "Resolved")
     self.send_header('content-type', stream_mime)
     self.send_header('location', streaming_url)
     self.end_headers()
Ejemplo n.º 2
0
 def __GET_track(self, request):
     api.login(api.username, api.password)
     node = getNode(Flag.TRACK, {'nid': request.track_id})
     streaming_url = node.get_streaming_url()
     if not streaming_url:
         raise RequestFailed()
     self.send_response(303, "Resolved")
     self.send_header('content-type', stream_mime)
     self.send_header('location', streaming_url)
     self.end_headers()  
Ejemplo n.º 3
0
def login(command):
	if api.checkLogin():
		return
	username = input('Username:'******'logining, please wait for a while....')
	try:
		api.login(username, password)
	except error.ApiError:
		print('Login Failed! Check your username & password please.')
Ejemplo n.º 4
0
def init():
    global Config
    Config = loadConfig()
    api.loadCookie(Config.get('cookies'))
    if not api.checkLogin():
        print('Seems you are not logined.')
        print("Let's Login First")
        username = input('Username:'******'Password:'******'Init Finished.')
Ejemplo n.º 5
0
def login_(login):
    if (login.get('code')):
        from capthca import capthca
        cc = capthca(login.get('code'))
        if (cc.backdata):
            if (len(cc.backdata) > 0):
                login = api.login(username, password, cc.backdata)
                del cc
                login_(login)
        else:
            print('empty form again')
            login = api.login(username, password, cc.backdata)
            del cc
            login_(login)
Ejemplo n.º 6
0
 def bootstrap_registry(self):
     from api import api
     cache.base_path = qobuz.path.cache
     api.stream_format = 6 if getSetting('streamtype') == 'flac' else 5
     if not api.login(getSetting('username'), getSetting('password')):
         dialogLoginFailure()
         #@TODO sys.exit killing XBMC? FRODO BUG ?
         # sys.exit(1)
         containerRefresh()
         raise QobuzXbmcError(
             who=self, what='invalid_login', additional=None)
Ejemplo n.º 7
0
def main():
    u = input('username: '******'password: '******'user'] = user

    print('starting...')

    scheduler = BlockingScheduler()
    now = datetime.now()
    scheduler.add_job(
        upload_avatar_job,
        'interval',
        minutes=1,
        start_date=now.replace(second=0, microsecond=0),
    )
    scheduler.start()
Ejemplo n.º 8
0
import sys
import os


def login_(login):
    if (login.get('code')):
        from capthca import capthca
        cc = capthca(login.get('code'))
        if (cc.backdata):
            if (len(cc.backdata) > 0):
                login = api.login(username, password, cc.backdata)
                del cc
                login_(login)
        else:
            print('empty form again')
            login = api.login(username, password, cc.backdata)
            del cc
            login_(login)


if __name__ == "__main__":
    api = api()

    api.global_veriable['device_id'] = "6648944787888948741"
    api.global_veriable['iid'] = "6648944787888948741"
    api.global_veriable['openudid'] = "6vchx2vx3ubd051q"
    username = ""
    password = ""
    login = api.login(username, password)
    login_(login)
from api import api
import sys
if __name__ == "__main__":
    api = api()
    #api.global_veriable['as'] = "test" change Device Info
    #api.global_veriable['cp'] = "test" change Device Info
    (api.login("", ""))

    # Cookie Active User
    #home_list = api.home_list(api.active_user)
    # No Cookie
    #home_list = api.home_list()
    #print(home_list)

    #search = api.search_user(text='teamtolga')
    #print(search)

    #like = api.like_post(aweme_id='6632541425961536773',type='1',session=api.active_user['cookies'])
    #print(like)
    #unlike = api.like_post(aweme_id='6632541425961536773',type='0',session=api.active_user['cookies'])
    #print(unlike)
Ejemplo n.º 10
0
def try_get_settings():
    global username, password
    username = __addon__.getSetting('username')
    password = __addon__.getSetting('password')
    if username and password:
        return True
    return False

while not (try_get_settings()):
    xbmc.sleep(5000)

import qobuz
from api import api
from cache import cache
cache.base_path = qobuz.path.cache
api.login(username, password)


stream_format = 6 if __addon__.getSetting('streamtype') == 'flac' else 5
cache_durationm_middle = int(__addon__.getSetting('cache_duration_middle')) * 60
cache_duration_long = int(__addon__.getSetting('cache_duration_long')) * 60

if stream_format == 6:
    stream_mime = 'audio/flac'
else:
    stream_mime = 'audio/mpeg'
    
from debug import log
from node import getNode, Flag