3

(Using pytube15.0.0)

I am rerunning a code to download audio from YouTube using the following code:

search_kw = tracks[i+1]['Artist'] + '+' + tracks[i+1]['Track Title']

print('Preparing ' + tracks[i+1]['Artist'] + '-' + tracks[i+1]['Track Title'])

search_kw = search_kw.replace(' ','+')

html = urllib.request.urlopen("https://www.youtube.com/results?search_query=" + unidecode(search_kw))
video_ids = re.findall(r"watch\?v=(\S{11})", html.read().decode())
song_yt_link = "https://www.youtube.com/watch?v=" + video_ids[0]

selected_video = YouTube(song_yt_link)

output_path = '/dataset/'
audio = selected_video.streams.filter(file_extension='mp4').first()
audio.download(output_path=output_path)

However, the code is running into error

RegexMatchError: get_throttling_function_name: could not find match for multiple

I did try to apply fixes by changing cipher.py, but that had the same error.

Are there any other solutions I should try or any other module alternatives?

Anthony Reid
  • 89
  • 2
  • 9

0 Answers0