summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-06-05 15:33:03 +0930
committerdaniel-Jones <daniel@danieljon.es>2018-06-05 15:33:03 +0930
commitd18dcf10b027d88cfd02fe7c656ae746479de26a (patch)
treeee9efc35c02976d079d20d2be9c8793561c18233
parent0a9220f18e0dd56314f9aa97b88dd03416c51f6c (diff)
downloadanimedb-d18dcf10b027d88cfd02fe7c656ae746479de26a.tar.gz
animedb-d18dcf10b027d88cfd02fe7c656ae746479de26a.zip
add missing function comments
-rwxr-xr-ximagescraper/imagescraper.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/imagescraper/imagescraper.py b/imagescraper/imagescraper.py
index 6c23a5d..7d83227 100755
--- a/imagescraper/imagescraper.py
+++ b/imagescraper/imagescraper.py
@@ -44,6 +44,9 @@ def dbclose(db):
db.close();
def dbgetanimeids(db):
+ """
+ collect anime ids from the data base and return a list of them
+ """
ids = [];
c = db.cursor();
for id in c.execute("SELECT animeid FROM anime;"):
@@ -51,6 +54,9 @@ def dbgetanimeids(db):
return (ids);
def createlinks(ids):
+ """
+ create MAL links from the ids and return a list of them
+ """
links = [];
for anime in ids:
links.append("https://myanimelist.net/anime/{}".format(anime));
@@ -70,6 +76,9 @@ def scrapelinks(animelinks):
return links;
def getcoverimage(link, animeid):
+ """
+ download the cover image file and save it
+ """
print("downloading {}".format(link));
urllib.request.urlretrieve(link, "covers/{}.jpg".format(animeid))