Wiki

Clone wiki

vyupoo / Home

配置config.py文件

USERNAME = '用户名'
PASSWORD = '密码'

APIKEY = 'your apikey'
SECRET = 'your secret'

PICTURE_TEST = 'your album_id'

DEMO

from yupoo import YupooAPI, operate_token_file, config

def main():
    yupoo = YupooAPI()
    token = operate_token_file()
    if token:
        print 'from file'
        yupoo.token = token
    else:
        print 'from new'
        frob = yupoo._auth()
        token = yupoo.get_token(frob)
        operate_token_file(token)
    filename='image.jpg'
    print yupoo.upload(filename, {'album_id': config.PICTURE_TEST})

if __name__ == '__main__':
    main()

Have fun!

Updated