本文整理汇总了Python中downloader.Downloader方法的典型用法代码示例。如果您正苦于以下问题:Python downloader.Downloader方法的具体用法?Python downloader.Downloader怎么用?Python downloader.Downloader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类downloader
的用法示例。
在下文中一共展示了downloader.Downloader方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import downloader [as 别名]
# 或者: from downloader import Downloader [as 别名]
def __init__(self):
# Check the OS first
if not str(sys.platform) == "darwin":
self.u.head("Incompatible System")
print(" ")
print("This script can only be run from macOS/OS X.")
print(" ")
print("The current running system is \"{}\".".format(sys.platform))
print(" ")
self.grab("Press [enter] to quit...")
print(" ")
exit(1)
self.dl = downloader.Downloader()
self.r = run.Run()
self.u = utils.Utils()
self.web_drivers = None
self.os_build_number = None
self.os_number = None
self.wd_loc = None
self.sip_checked = False
self.installed_version = "Not Installed!"
self.get_manifest()
self.get_system_info()
示例2: main
# 需要导入模块: import downloader [as 别名]
# 或者: from downloader import Downloader [as 别名]
def main(url_to_m3u8, download_dir, verbose, ignore_ssl):
"""
:type url_to_m3u8: str
:type download_dir: str
:type verbose: bool
:type ignore_ssl: bool
:rtype: None
"""
http_settings = dict(
headers={
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6)"
" AppleWebKit/602.4.8 (KHTML, like Gecko)"
" Version/10.0.3 Safari/602.4.8"
},
)
if ignore_ssl:
http_settings["verify"] = False
global DOWNLOADER
DOWNLOADER = downloader.Downloader(download_dir=download_dir, http_settings=http_settings,)
logging.basicConfig(level=logging.INFO if verbose else logging.WARNING)
process_main_playlist(url_to_m3u8)
示例3: __init__
# 需要导入模块: import downloader [as 别名]
# 或者: from downloader import Downloader [as 别名]
def __init__(self, **kwargs):
self.dl = downloader.Downloader()
self.r = run.Run()
self.u = utils.Utils("SSDT Time")
self.iasl_url_macOS = "https://bitbucket.org/RehabMan/acpica/downloads/iasl.zip"
self.iasl_url_linux = "http://amdosx.kellynet.nl/iasl.zip"
self.iasl_url_windows = "https://acpica.org/sites/acpica/files/iasl-win-20200528.zip"
self.iasl = self.check_iasl()
if not self.iasl:
raise Exception("Could not locate or download iasl!")
self.dsdt = None
self.dsdt_raw = None
self.dsdt_lines = None
示例4: createDownloader
# 需要导入模块: import downloader [as 别名]
# 或者: from downloader import Downloader [as 别名]
def createDownloader(self, url, filename = None, resume = False):
return Downloader(self.window, url, filename, resume)
# 子进程
示例5: downloadVideo
# 需要导入模块: import downloader [as 别名]
# 或者: from downloader import Downloader [as 别名]
def downloadVideo(self, url, title):
common.log('Trying to download video ' + str(url))
# check url
if url.startswith('plugin'):
common.log('Video is not downloadable')
return None
path = common.getSetting('download_path')
if not path:
path = common.browseFolders(common.translate(30017))
common.setSetting('download_path', path)
title = getKeyboard(default = fu.cleanFilename(title),heading='SportsDevil')
if title == None or title == '':
return None
downloader = Downloader()
downloaded_file = downloader.downloadMovie(url, path, fu.cleanFilename(title), '.flv')
if downloaded_file == None:
common.log ('Download cancelled')
else:
common.log('Video ' + url + " downloaded to '" + downloaded_file + "'")
return downloaded_file