1
0
mirror of https://github.com/obskyr/khinsider.git synced 2025-09-01 09:03:01 +02:00

Added friendlier message when stopping a download.

Also fixed a docstring a bit, and added the magic word to an error message.
This commit is contained in:
obskyr
2016-08-16 00:23:25 +02:00
parent 7a8286cf9f
commit faef28190f

View File

@@ -134,7 +134,7 @@ def getImageInfo(soup):
return images
def getFileList(ostName):
"""Get a list of songs from the OST with ID `ostName`."""
"""Get a list of files (songs & images) from the OST with ID `ostName`."""
# Each entry is in the format [name, url].
soup = getOstContentSoup(ostName)
songPageUrls = getSongPageUrlList(soup)
@@ -197,7 +197,7 @@ def downloadSong(songUrl, path, name="song", numTries=3, verbose=False,
outfile.write(song.content)
except IOError:
if verbose:
print("Couldn't save {}. Check your permissions.".format(name))
print("Couldn't save {}. Please check your permissions.".format(name))
def search(term):
"""Return a list of OST IDs for the search term `term`."""
@@ -260,5 +260,7 @@ if __name__ == '__main__':
if madeDir:
os.rmdir(outPath)
return
except KeyboardInterrupt:
print("Stopped download.")
doIt()