Ejemplo n.º 1
0
def analysis_share_page(detail_url: str) -> (str, dict):
    rid = detail_url.split('/')[-1]

    res = s.post(SHARE_URL, data={"rid": rid}, cookies=load_cookies()).json()
    share_code = res['data'].split('/')[-1]
    share_url = SHARE_WEB.format(code=share_code)
    logging.info("Share url is %s", share_url)

    # get api response
    api_response = s.get(SHARE_API.format(code=share_code)).json()
    return share_url, api_response
Ejemplo n.º 2
0
    def __get_share_page(self):
        self.__login_check()
        rid = self.id

        res = session.post(SHARE_URL, data={"rid": rid}, cookies=self.__load_cookies__()).json()
        share_code = res['data'].split('/')[-1]
        share_url = SHARE_WEB.format(code=share_code)
        logging.info("[%s] Share url is %s", self.label, share_url)

        # get api response
        api_response = session.get(SHARE_API.format(code=share_code)).json()
        return share_url, api_response