Exemplo n.º 1
0
    def __init__(self, email, password, is_hq=False, proxies=None):
        self.token = None
        self.uid = ''
        self.user_name = ''
        self.email = email
        self.password = password
        self.skip_login = False
        self.session = None
        self.is_hq = is_hq
        Handler.__init__(self,proxies)
        #self.proxies = proxies
        #self.need_proxy_pool = self.proxies != None

        #if either email or password is empty skip login
        if not email or not password or not is_hq:
            self.skip_login = True
            
        self.member_auth = ''
        #do login
        if self.skip_login:
            LOG.warning(msg.head_xm + msg.dl_128kbps_xm)
            is_hq = False
        else:
            if self.login():
                LOG.info( msg.head_xm + msg.fmt_login_ok_xm % (self.user_name.decode('utf-8'),self.uid) )
            else:
                is_hq = False
Exemplo n.º 2
0
    def __init__(self, email, password, option):
        self.token = None
        self.uid = ''
        self.user_name = ''
        self.email = email
        self.password = password
        self.skip_login = False
        self.session = None
        self.is_hq = option.is_hq
        self.dl_lyric = option.dl_lyric
        self.proxy = option.proxy
        Handler.__init__(self,option.proxy_pool)

        #if either email or password is empty skip login
        if not email or not password or not self.is_hq:
            self.skip_login = True
            
        self.member_auth = ''
        #do login
        if self.skip_login:
            LOG.warning(msg.head_xm + msg.dl_128kbps_xm)
            # is_hq = False
        else:
            if self.login():
                LOG.info( msg.head_xm + msg.fmt_login_ok_xm % (self.user_name.decode('utf-8'),self.uid) )
Exemplo n.º 3
0
    def __init__(self, email, password, is_hq=False, proxies=None):
        self.token = None
        self.uid = ''
        self.user_name = ''
        self.email = email
        self.password = password
        self.skip_login = False
        self.session = None
        self.is_hq = is_hq
        Handler.__init__(self,proxies)
        #self.proxies = proxies
        #self.need_proxy_pool = self.proxies != None

        #if either email or password is empty skip login
        if not email or not password or not is_hq:
            self.skip_login = True
            
        self.member_auth = ''
        #do login
        if self.skip_login:
            LOG.warning(u'[虾] 不登录虾米进行下载, 虾米资源质量为128kbps.')
            is_hq = False
        else:
            if self.login():
                LOG.info( u'[Login] 用户: %s (id:%s) 登录成功.' % (self.user_name.decode('utf-8'),self.uid) )
            else:
                is_hq = False
Exemplo n.º 4
0
 def __init__(self, option):
     Handler.__init__(self,option.proxy_pool)
     self.is_hq = option.is_hq
     self.dl_lyric = option.dl_lyric
     self.proxy = option.proxy
     #headers
     self.HEADERS = {'User-Agent':AGENT}
     self.HEADERS['Referer'] = url_163
     self.HEADERS['Cookie'] = 'appver=1.7.3'
Exemplo n.º 5
0
 def __init__(self, option):
     Handler.__init__(self,option.proxy_pool)
     self.is_hq = option.is_hq
     self.dl_lyric = option.dl_lyric
     self.proxy = option.proxy
     #headers
     self.HEADERS = {'User-Agent':AGENT}
     self.HEADERS['Referer'] = url_163
     timestamp = str(int(time.time() * 1000))
     jsessionid = ''.join(random.choice('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKMNOPQRSTUVWXYZ\\/+') for i in xrange(176)) + ':' + timestamp
     nuid = ''.join(random.choice('0123456789abcdefghijklmnopqrstuvwxyz') for i in xrange(32))
     self.HEADERS['Cookie'] = COOKIE % (jsessionid, nuid, timestamp, nuid)
Exemplo n.º 6
0
 def __init__(self, is_hq=False, proxies = None):
     Handler.__init__(self,proxies)
     self.is_hq = is_hq
Exemplo n.º 7
0
 def __init__(self, option):
     Handler.__init__(self,option.proxies)
     self.is_hq = option.is_hq
     self.dl_lyric = option.dl_lyric
Exemplo n.º 8
0
 def __init__(self, is_hq=False, dl_lyric=False, proxies=None):
     Handler.__init__(self, proxies)
     self.is_hq = is_hq
     self.dl_lyric = dl_lyric