MCPcopy Create free account
hub / github.com/geekcomputers/Python / ImageDownloader

Function ImageDownloader

ImageDownloader/img_downloader.py:4–18  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

2
3
4def ImageDownloader(url):
5 import os
6 import re
7 import requests
8
9 response = requests.get(url)
10 text = response.text
11
12 p = r'<img.*?src="(.*?)"[^\>]+>'
13 img_addrs = re.findall(p, text)
14
15 for i in img_addrs:
16 os.system("wget {}".format(i))
17
18 return "DONE"
19
20
21# USAGE

Callers 1

img_downloader.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected