Skip to content
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

Unable to search or play youtube videos. #126

Open
blindndangerous opened this issue Feb 3, 2025 · 4 comments
Open

Unable to search or play youtube videos. #126

blindndangerous opened this issue Feb 3, 2025 · 4 comments

Comments

@blindndangerous
Copy link

I'm unable to play Youtube videos using the u parameter or the p parameter. If using U, nothing happens, if using P, I get the error that it got an unexpected keyword proxies.

@cyrmax
Copy link
Collaborator

cyrmax commented Feb 4, 2025

This is because of youtube-search-python is out of date.
Manually downgrade httpx to version 0.27.
Execute pip install httpx==0.27.

@blindndangerous
Copy link
Author

blindndangerous commented Feb 4, 2025

I was able to do this and I now see this in my logs. ttmboriginal | yt_dlp.utils.DownloadError: ERROR: [youtube] PyD9cMarVJk: Sign in
to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the au
thentication. See /~https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cooki
es-to-yt-dlp for how to manually pass cookies. Also see /~https://github.com/yt-
dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively ex
porting YouTube cookies
This is the same as @Oliver2213 error. Is their anything I can do to fix this? Looking at the instructions I think I can export my cookies from my windows machine into a txt file and put it in the docker container, but how would I pass that to yt-dlp?

@grishakonzalaev
Copy link
Contributor

as temporary decision, you can add following key:value in self._ydl_config:
"cookiefile": "yourpath/cookies.txt",
how to get cookie file you can read here

@blindndangerous
Copy link
Author

I'm going to leave this issue open as the fix is only a temporary one and I believe the devs would probably want to implement a more permanent one. Here's what you have to do to get the bot working with youtube videos again.
nano requirements.txt: Add at the bottom httpx==0.27.
nano bot/services/yt.py: Thanks to deepseek for helping me find where to put this. Do a search for this: self._ydl_config = {
Once found, go down past the skip download option and add this line. Remember to keep the indentation count the same. It should be 12 spaces.
"cookiefile": "/home/ttbot/data/cookies.txt",
I'll be happy to add this as a pull request if all looks good to you guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants