def start_download(self): self.url.assert_no_error() self.username.assert_no_error() self.password.assert_no_error() self.proxy.assert_no_error() self.save_path.assert_no_error() url = self.url.get_input() proxy = self.proxy.get_input() or None username = self.username.get_input() password = self.password.get_input() path_prefix = self.save_path.get_path() if not os.access(path_prefix, os.W_OK): return info("对下载文件夹没有写权限,请重新选择") if self.downloader is not None: if not self.downloader.done: return info("请停止后再重新点击下载...") self.downloader = pixiv_run( url=url, username=username, password=password, proxy=proxy, path_prefix=path_prefix, )
def start_download(self): self.url.assert_no_error() self.save_path.assert_no_error() url = self.url.get_input() path_prefix = self.save_path.get_path() if not os.access(path_prefix, os.W_OK): return info("对下载文件夹没有写权限,请重新选择") if self.downloader is not None: if not self.downloader.done: return info("请停止后再重新点击下载...") self.downloader = self.run( url=url, path_prefix=path_prefix, )
def _get_importer(self): min_size = self._min_size.get_input() if min_size: try: min_size = int(min_size) except Exception: info("最小文件上传大小应该是整数") else: min_size = None return PinryImporter( base_url=self._url.get_input(), username=self._username.get_input(), password=self._password.get_input(), min_upload_size_kb=min_size, )
def _test_login(self): importer = self._get_importer() if importer.test_login() is True: info("登录成功") else: info("情检查用户名密码以及部署路径是否可访问")
def contact(): info("任何问题或者建议请联系作者\n" "用户QQ群: 863404640\n")