script_download_mp3.py 618 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. """script_download_mp3.ipynb
  3. Automatically generated by Colaboratory.
  4. Original file is located at
  5. https://colab.research.google.com/drive/12QC9ULnH-_nhwNOO9phzGEt57rSVysM0
  6. """
  7. # script to download the audio files:
  8. import os
  9. import re
  10. import urllib.request
  11. child_list = ['Joe','The']
  12. for child in child_list:
  13. files = os.listdir(f'Soderstrom/{child}/')
  14. for f in files:
  15. path = f'https://media.talkbank.org/childes/Eng-NA/Soderstrom/{child}/{re.split("[.]",f)[0]}.mp3'
  16. urllib.request.urlretrieve(path, f'soderstrom/recordings/raw/{child}/{re.split("[.]",f)[0]}.mp3')