speechbrain.utils.check_url module

Libraries for automatic finding URLs in the files and checking if they are reachable.

Authors
  • Mirco Ravanelli 2022

Summary

Functions:

check_url

Cheks if an URL is broken

get_all_urls

This function searches for all the URLs in the specified file list

get_url

This function searches for the URLs in the specified file.

test_links

This test checks if the files in the specified folders contain broken URLs

Reference

speechbrain.utils.check_url.get_url(path)[source]

This function searches for the URLs in the specified file.

Parameters

path (path) – Path of the file where to search for URLs.

Returns

urls – a list of all the URLs found in the specified path.

Return type

list

speechbrain.utils.check_url.get_all_urls(file_lst, avoid_urls)[source]

This function searches for all the URLs in the specified file list

Parameters
  • file_lst (list) – List of the files where to search for URLs.

  • avoid_urls (list) – List of URLs to avoid.

Returns

  • urls (dict) – A dictionary where the keys are the detected URLs and the values

  • are the files where the URLs are found.

speechbrain.utils.check_url.check_url(url)[source]

Cheks if an URL is broken

Parameters

url (string) – URL to check

Returns

False if the URL is broken, True otherwise.

Return type

Bool

This test checks if the files in the specified folders contain broken URLs

Parameters
  • folder (path) – The top Folder for searching for the files.

  • match_or (list) – Used to specify the extensions of the files to check.

  • exclude_or (list) – Used to avoid some file extensions.

  • avoid_files (list) – Used to avoid testing some specific file.