"out": item['identifier'] + ".apk", "user-agent": settings.USER_AGENT, "split": settings.DOWNLOAD_SPLIT, "min-split-size": settings.DOWNLOAD_MIN_SPLIT_SIZE, "continue": settings.DOWNLOAD_CONTINUE, "max-connection-per-server": settings.DOWNLOAD_MAX_CONNECTION_PER_SERVER, "max-concurrent-downloads": settings.DOWNLOAD_CONCURRENT_DOWNLOADS, "log": settings.DOWNLOAD_LOG_FILE, } arg1 = item['download_url'] sh.aria2c(arg1, **args) import os apkparser = ApkFileParser() class FileParsePipeline(object): """ FileParsePipeline 获取文件信息 获取错误记录 资源队列状态3xxx """ con = con _update_state = _update_state def process_item(self, item, spider=null): apkfile = os.path.join(settings.DOWNLOAD_TMP_DIR, item['identifier'] + ".apk")
def setUp(self): self.parser = ApkFileParser()