audiogen_http.py 465 B

1234567891011121314151617181920
  1. from larigira.fsutils import download_http
  2. def generate(spec):
  3. """
  4. resolves audiospec-static
  5. Recognized argument is "paths" (list of static paths)
  6. """
  7. if "urls" not in spec:
  8. raise ValueError("Malformed audiospec: missing 'urls'")
  9. for url in spec["urls"]:
  10. ret = download_http(url, copy=True, prefix="http")
  11. if ret is None:
  12. continue
  13. yield ret
  14. generate.description = "Fetch audio from an URL"