def test_get_note_file_api(self): print('----------------') # print('验证使用 Cookies 是否能成功登录\m') session = pull.YoudaoNoteSession() cookies_dict = pull.covert_json_str_to_dict('cookies.json') # logging.info(cookies_dict) session.cookies_login(cookies_dict['cookies']) # root_id = session.get_root_id() # print(root_id) url = 'https://note.youdao.com/yws/api/personal/resource?method=listThumbsInfo&keyfrom=web&cstk=ZzXatKpy' data = { 'fileId': 'WEB8bcb99a589ab9660a10aa5f87ca61675', 'cstk': 'ZzXatKpy' } content = session.post(url, data) logging.info(content)
def test_get_dir_api(self): print('----------------') # print('验证使用 Cookies 是否能成功登录\m') session = pull.YoudaoNoteSession() cookies_dict = pull.covert_json_str_to_dict('cookies.json') logging.info(cookies_dict) session.cookies_login(cookies_dict['cookies']) # root_id = session.get_root_id() # print(root_id) url = 'https://note.youdao.com/yws/api/personal/file?method=listPath&fileId=9d8a2385eeec77338211b4f04bbf844d&keyfrom=web&cstk=01PvSwwu' data = { 'fileId': 'WEB8bcb99a589ab9660a10aa5f87ca61675', 'cstk': '01PvSwwu' } content = session.post(url, data).content.decode('utf-8') logging.info(content)
def test_get_file_api(self): print('----------------') # print('验证使用 Cookies 是否能成功登录\m') session = pull.YoudaoNoteSession() cookies_dict = pull.covert_json_str_to_dict('cookies.json') logging.info(cookies_dict) session.cookies_login(cookies_dict['cookies']) # root_id = session.get_root_id() # print(root_id) url = 'https://note.youdao.com/yws/api/personal/sync?method=download&keyfrom=web&cstk=01PvSwwu' data = { 'fileId': 'WEB4aa8bf8074d61befea1dd20f5593f01c', 'version': -1, 'convert': 'true', 'editorType': 1, 'cstk': '01PvSwwu' } content = session.post(url, data).content.decode('utf-8') logging.info(content)