I’m getting an error when using the pytube
library to download YouTube videos. The error occurs when the function runs video = YouTube(audio_link)
and the error message is get_throttling_function_name: could not find match for multiple
.
I’ve tried using different YouTube links and updating pytube
to the latest version, but the error persists.
The code snippet where pytube
is used is as follows:
`
# from pytube import YouTube
# import base64
# Get the video
video = YouTube(audio_link)
# Create a buffer
buffer = io.BytesIO()
# Download audio stream into memory
audio_stream = video.streams.get_audio_only()
audio_stream.stream_to_buffer(buffer)
# Base64 encode audio bytes
b64 = base64.b64encode(buffer.getvalue()).decode()
if download_link:
# Create download link and write to Streamlit
href = f'<a href="data:audio/mp3;base64,{b64}" download="{meeting_name}.mp3">Download audio file</a>'
st.markdown(href, unsafe_allow_html=True)
meeting_audio = buffer.getvalue()
# Close the buffer
buffer.close()
`
Does anyone have any idea why this might be happening and how to fix it? Any help would be greatly appreciated.