本文整理汇总了Python中Download.Download.get_output_name方法的典型用法代码示例。如果您正苦于以下问题:Python Download.get_output_name方法的具体用法?Python Download.get_output_name怎么用?Python Download.get_output_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Download.Download
的用法示例。
在下文中一共展示了Download.get_output_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dl
# 需要导入模块: from Download import Download [as 别名]
# 或者: from Download.Download import get_output_name [as 别名]
def dl(self):
"""
Downloads the highest Quallitiy picture available.
returns False if something goes wrong.
"""
if(self.orig_url == ""):
if(self.hq_url == ""):
down = Download(self.lq_url, self.config.get_image_folder())
if(down.perform()):
return True
else:
down = Download(self.hq_url, self.config.get_image_folder())
if(down.perform()):
return True
else:
down = Download(self.orig_url, as_var=True)
if(down.perform()):
result = down.get_result()
soup = BeautifulSoup(result.getvalue())
download_link = soup.find("a", text="this link")
orig_url = self.dl_url_base + download_link["href"]
time.sleep(120)
down = Download(orig_url, self.config.get_image_folder())
if(down.perform()):
self.file_name = down.get_output_name()
return True
return False