def video_downloader(video_url_list: List[str], download_folder: str) -> None:
"""
Download videos from a list of YouTube video URLs.
Args:
video_urls (List[str]): The list of YouTube video URLs to download.
download_folder (str): The folder to save the downloaded videos.
"""
successful_downloads = 0
valid_urls: List[str] = []
for url in video_url_list:
if not url:
continue
try:
with tempfile.TemporaryDirectory() as temp_dir:
cleaned_url = clean_youtube_url(url=url)
if _get_streams(url=cleaned_url, temp_dir=temp_dir):
create_folder(download_folder)
_merge_streams(
temp_dir=temp_dir, url=url, download_folder=download_folder
)
logger.info(f"The video from {url} was downloaded successfully")
successful_downloads += 1
valid_urls.append(url)
else:
logger.warning(f"No valid video found at the URL: {url}")
except Exception as e:
logger.error(
f"Error has occurred while downloading the video from {url}: {e}"
)
print(e)
if successful_downloads != 0 and (successful_downloads == len(valid_urls)):
messagebox.showinfo(
title="Finished download",
message=f"Your download is complete!.\n\n\t{successful_downloads}/{len(video_url_list[1:])}",
)
This is the main function I was using to download YouTube videos using Pytube. It was working fine last night, but this morning it's not. I'm getting the error "pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple", which prevents me from downloading any video or audio. Any possible solutions?