5

I am trying to download YouTube playlist from url "https://www.youtube.com/watch?v=uyVYfSNb_Pc&list=PLBxwSeQlMDNiNt72UmSvKBLsxPgGY_Jy-", but getting the error 'get_throttling_function_name: could not find match for multiple'.

Code block is:

`

from pytube import Playlist

play_list = Playlist('https://www.youtube.com/watch?v=uyVYfSNb_Pc&list=PLBxwSeQlMDNiNt72UmSvKBLsxPgGY_Jy-')

print(f'Downloading: {play_list.title}')

for video in play_list.videos:
    print(video.title)
    st = video.streams.get_highest_resolution()
    st.download(r'path')  `

i am using the latest version of pytube.

kishore naidu
  • 141
  • 3
  • 11
  • The error seems to be happening internally in pytube. Why don't you use [yt-dlp](https://github.com/yt-dlp/yt-dlp)? It's more powerful and reliable in general. – mara004 Apr 15 '22 at 11:53
  • I had a perfectly working scripts with pytube, but suddenly (1-2 days ago) I no longer can get streams from YouTube object and now getting the error: "get_throttling_function_name: could not find match for multiple". But YouTube object still constructs successfully. – Roman March Apr 15 '22 at 13:40

1 Answers1

7

Becuase youtube changed something on its end, and now you have to change pytube's ciper.py's function_patterns to the following

r'a\.[a-zA-Z]\s*&&\s*\([a-z]\s*=\s*a\.get\("n"\)\)\s*&&\s*'
r'\([a-z]\s*=\s*([a-zA-Z0-9$]{2,3})(\[\d+\])?\([a-z]\)'

And you also have to change line 288 to this:

nfunc=re.escape(function_match.group(1))),

You'll have to use this workaround until pytube officially releases a fix.

eroc123
  • 624
  • 1
  • 4
  • 14