向百度网盘中添加离线下载链接

def add_remote_download_task(self, link):
        """
            向百度网盘中添加离线下载链接
        """

        ruokuai_captcha_handler = functools.partial(
            self.ruokuai_captcha_handler,
            self.captcha_params
        )

        # 初始化pcs，这里设置了验证码处理函数和验证码处理参数
        pcs = PCS(
            self.baidu_username,
            self.baidu_password,
            ruokuai_captcha_handler,
            None,
        )

        # 获取下载路径中的文件，防止文件重复添加
        rsp = pcs.list_files(BASE_PATH)
        result = rsp.json()
        exist_list = []
        if result['errno'] == 0:
            exist_list = result['list']
        else:
            print(json.dumps(result))

        exist_names = [exist['server_filename'] for exist in exist_list]

        if link not in exist_names:
            # 网盘中不存在的才添加
            pcs.add_download_task(
                link,
                BASE_PATH
            )
        else:
            print(link + ' 已经存在于网盘中')