-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
downloading video bug #1754
Comments
Thank you for contributing to PyTube. Please remember to reference Contributing.md |
same error |
Apply #1707 (comment) if you haven't already, then change cipher.py line 30 to:
YMMV |
seemed to work |
@amckee Yeah, this fixes the bug. Congratulations to you. |
@amckee I was testing line 30, but didn't find out that it was just "$", so, you've noticed it well and really fast. |
works perfectly, thanks |
This worked for me , and the download speeds are better now. |
awesome thank you |
This did not solve the issue for me. It just started manifesting for me about noon central today. I've done the usual regex fixes mentioned here and on other related threads, and it's still having this error. |
maybe try uninstalling pytube and reinstalling and then redoing this step? |
that did the trick. shoulda turned it off and back on again. |
GOAT thank you bro! |
I am experiencing the same issue. However, I recall encountering this problem last year as well. Why is it happening again? Does anyone have any ideas? |
When Youtube makes changes, as it does frequently, the parser needs updated accordingly. |
I am still having the same issue even after changing line 30. This is the error I am getting: |
var_regex = re.compile(r"^$*\w+\W") does not work |
@oncename Really? |
@anushnandyala the regex is incorrect. @oncename the regex is incorrect. After making the change, of course, you will need to restart the script to reload the new code. |
|
@oncename That looks correct. The dollar sign needs to be escaped. |
You are a legend bro it works now tysm |
i changed it on my local machine. |
The $'s not always there. So add ? after it to check for 0 or 1 occurrence:
|
yesterday, pytube was working just fine for me but today all of a sudden when i run my yt to mp3 converter it stops recognizing the link and gives me the pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W. ive done as much debugging as i can, i printing out the link before this statement runs so i know that the link is correctly passed through. even asked chat gpt and it blamed pytube and not my code.
To Reproduce
Please provide the following information:
Ive tried several videos and none work so ill just give one https://www.youtube.com/watch?v=l_FWkOR4QvU
the code where it isnt worknig is here:
def download_vid(self, link):
self.label2 = customtkinter.CTkLabel(self.mainframe,text="downloading...")
self.label2.grid(row=3,column=0)
name = self.Entry.get()
#gui stuff ^^
print(link)
#printing to test if the link was correctly passed through ^^
yt = YouTube(link)
filename = yt.title + ".mp4"
newname = name + ".mp4"
stream = yt.streams.filter(only_audio=True,file_extension="mp4").first()
Itag = stream.itag
stream = yt.streams.get_by_itag(Itag)
stream.download()
#downlaods song^^
os.rename(filename, newname)
song = newname
sound = AudioSegment.from_file(song)
length = sound.duration_seconds
sound = sound - 15
sound.export(name + ".mp3", format="mp3", bitrate="320k")
os.remove(newname)
shutil.move(f"{name}.mp3", f"songs")
#converts the mp4 to an mp3
self.update_song_list()
#updates the gui^^
self.playsong("songs\" + f"{name}.mp3",length)
#runs the next function
Expected behavior
What is supposed to happen is you input the link and the name you want to give the file and it will download it, rename it and make it an mp3, and then put it in a file then calls the next function which request if you would like to play the song
Output
once again the error code:
pytube.exceptions.RegexMatchError: init: could not find match for ^\w+\W
System information
Please provide the following information:
The text was updated successfully, but these errors were encountered: