Open malinos opened 7 years ago
Actually this repository was not maintained in the past year so I'm not sure whether the links found last year still work now. I'll try getting some spare time to check it soon.
Hi! This code worked with exceptions but when it had reached above 500 words program stopped working, so I changed one of the methods to catch and ignore exceptions and now it works fine:
def download_mp3(word, url, dir_path):
filename = os.path.join(dir_path, word + MP3_FILENAME_EXTENSION)
try:
with open(filename, 'wb') as file:
file.write(requests.get(url).content)
except Exception:
pass
THANKS FOR THIS PROGRAM!!!
Some files are corrupted though (
Hello - thank you a lot for this code! I've releasied that this code doesn't extract all the 119376 due to the following case:
(1288/119376) on/off switch Exception in thread Thread-7: Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner self.run() File "", line 18, in run
download_mp3(word, url, self.dir_path)
File "", line 4, in download_mp3
with open(filename, 'wb') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'download/on/off switch.mp3'
Kind regards, AM