I was recently downloading a list of Youtube URLs…all was working until today where I started receiving this error
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/pytube/main.py", line 181, in fmt_streamsextract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/usr/local/lib/python3.9/dist-packages/pytube/extract.py", line 409, in apply_signaturecipher = Cipher(js=js)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 37, in initself.transform_map = get_transform_map(js, var)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 250, in get_transform_mapfn = map_functions(function)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 698, in map_functionsraise RegexMatchError(caller="map_functions", pattern="multiple")
pytube.exceptions.RegexMatchError: map_functions: could not find match for multiple
During handling of the above exception, another exception occurred:
Traceback (most recent call last):File "/var/www/html/download_youtube_urls.py", line 9, in <module>stream = yt.streams.get_highest_resolution()
File "/usr/local/lib/python3.9/dist-packages/pytube/main.py", line 296, in streamsreturn StreamQuery(self.fmt_streams)
File "/usr/local/lib/python3.9/dist-packages/pytube/main.py", line 188, in fmt_streamsextract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/usr/local/lib/python3.9/dist-packages/pytube/extract.py", line 409, in apply_signaturecipher = Cipher(js=js)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 37, in initself.transform_map = get_transform_map(js, var)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 250, in get_transform_mapfn = map_functions(function)
File "/usr/local/lib/python3.9/dist-packages/pytube/cipher.py", line 698, in map_functionsraise RegexMatchError(caller="map_functions", pattern="multiple")
pytube.exceptions.RegexMatchError: map_functions: could not find match for multiple
Everywhere I searched, I’m only finding the get_throttle_function error, but this seems to be a new issue. I attempted to run the script from another IP address, just to make sure it had nothing to do with my host machine, and I got the same error from the other host machine as well.
I’ve ran python3 -m pip install –upgrade pytube multiple times to verify I have the most current package, no luck.
Here is an example of my code:
#!/bin/python3
import pytube
f = open('urls.txt', 'r')
url = f.readlines()
for i in url:
yt = pytube.YouTube(i)
stream = yt.streams.get_highest_resolution()
stream.download("/var/www/html/tmp")
f.close()
Have anyone ran into this issue? If not, can I please get some help or direction on what is going on?