Example #1
0
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')
Example #2
0
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')
Example #3
0
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')
Example #4
0
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')