def show_captcha(self, pdf_captcha_response): """Callback function for PDF captcha response Args: pdf_captcha_response: PDF captcha response """ self._captcha_query = pdf_captcha_response scihub_api = SciHubAPI('', log=self.log, conf=self._conf) _, captcha_img_url = scihub_api.get_captcha_info(pdf_captcha_response) self._captcha_img_file = scihub_api.download_captcha_img( captcha_img_url) captcha_img_local_url = 'file://' + self._captcha_img_file.name self._scihub_captcha.showWindowCaptcha.emit(captcha_img_local_url)
def show_captcha(self, pdf_captcha_response): """Callback function for PDF captcha response Args: pdf_captcha_response: PDF captcha response """ self._captcha_query = pdf_captcha_response scihub_api = SciHubAPI(self._input, None, log=self.log, conf=self._conf) _, captcha_img_url = scihub_api.get_captcha_info(pdf_captcha_response) captcha_img_file = scihub_api.download_captcha_img(captcha_img_url) self._captcha_img_file_path = Path(captcha_img_file.name).as_posix() captcha_img_local_uri = Path(captcha_img_file.name).as_uri() self._scihub_captcha.showWindowCaptcha.emit(captcha_img_local_uri)