def resulter_downloader_img(task): if '.' not in urlparse(task['response'].url).path[1:]: name = urlparse(task['response'].url).path[1:] + '.jpg' else: name = urlparse(task['response'].url).path[1:] write(os.path.join(task['save']['save_path'], 'static'), name, task['response'].content, mode='wb')
def resulter_downloader_img(task): url = task['response'].url g = re.search('(.*?)-', url) if g: url = g.group(1) write(os.path.join(task['save']['save_path'], 'static'), urlparse(url).path[1:], task['response'].content, mode='wb')
def resulter_downloader_img(task): if 'www.zhihu.com/equation' not in task['url']: write(os.path.join(task['save']['save_path'], 'static'), urlparse(task['response'].url).path[1:], task['response'].content, mode='wb') else: write(os.path.join(task['save']['save_path'], 'static'), md5string(task['url']) + '.svg', task['response'].content, mode='wb')
def resulter_downloader_img(task): write(os.path.join(task['save']['save_path'], 'static'), urlparse(task['response'].url).path[1:], task['response'].content, mode='wb')