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

install/update of yt-dlp and FFmpeg fails with proxy #619

Closed
Bolb389 opened this issue Jan 31, 2024 · 2 comments
Closed

install/update of yt-dlp and FFmpeg fails with proxy #619

Bolb389 opened this issue Jan 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Bolb389
Copy link

Bolb389 commented Jan 31, 2024

Hello, an evil bug stops me from using Tartube :

What operating system are you using?

Windows 11 Education 23H2

What version of Tartube are you using?

Tartube v2.5.0 (portable version from your Github)

Bug description

The network I'm on require a proxy to access Internet.
The proxy url is fine, I can use it with yt-dlp on command line and it's working (like this : .\yt-dlp.exe --proxy http://10.202.1.239:8080 https://tube-numerique-educatif.apps.education.fr/w/ux9nBPMugDxBEbm1Y6SjoL)

When I first started Tartube, the "welcome screen" failed to download yt-dlp and FFmpeg, probably because of the proxy.
So I put the proxy url in the settings (Operations > Proxies; with advanced properties enabled) : http://10.202.1.239:8080

Then I tried to install yt-dlp and FFmpeg :
Operations > Update yt-dlp
It fails, it's like the proxy is not used :

Starting update operation, installing/updating yt-dlp
..\..\..\mingw64\bin\pip3.exe uninstall --yes yt-dlp
WARNING: Skipping yt-dlp as it is not installed.
..\..\..\mingw64\bin\pip3.exe install --upgrade --no-dependencies yt-dlp
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026729e81110>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/yt-dlp/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000026729e81dd0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/yt-dlp/

Operations > Install FFmpeg
It fails too, after trying a lot of mirrors :

[..]
error: failed retrieving file 'mingw-w64-x86_64-aom-3.7.0-1-any.pkg.tar.zst' from mirror.msys2.org : Failed to connect to mirror.msys2.org port 443 after 10004 ms: Timeout was reached
error: failed retrieving file 'mingw-w64-x86_64-crt-git-11.0.0.r404.g3a137bd87-1-any.pkg.tar.zst' from mirror.msys2.org : Failed to connect to mirror.msys2.org port 443 after 10007 ms: Timeout was reached
error: failed retrieving file 'mingw-w64-x86_64-ffmpeg-6.1-1-any.pkg.tar.zst' from mirror.msys2.org : Failed to connect to mirror.msys2.org port 443 after 10011 ms: Timeout was reached
error: failed retrieving file 'mingw-w64-x86_64-ffmpeg-6.1-1-any.pkg.tar.zst' from repo.msys2.org : Failed to connect to repo.msys2.org port 443 after 10006 ms: Timeout was reached
[..]

So even if the proxy is set in the settings, maybe it is only used when downloading a video (like in Youtube-DLG). It would be great if the proxy would be used to download yt-dlp and FFmpeg too.

There is a similar bug with Youtube DLG : the proxy is used when downloading videos, but not when downloading yt-dlp.


I tried to put yt-dlp.exe myself in mingw64/bin/ so I can use Tartube anyway, however it did not work. I still can't download a video (I tried it in classic mode) :

python3 -X utf8 ..\..\..\mingw64\bin\yt-dlp.exe --newline -i --proxy http://10.202.1.239:8080 --hls-prefer-native --cookies C:/Users/user/Downloads/Tartube/cookies.txt --windows-filenames --output C:/Users/user/Downloads/%(title)s.%(ext)s --verbose https://tube-numerique-educatif.apps.education.fr/w/ux9nBPMugDxBEbm1Y6SjoL
SyntaxError: Non-UTF-8 code starting with '\x90' in file C:/Users/user/Programmes/tartube-2.5.0-64bit-portable/tartube/mingw64/bin/yt-dlp.exe on line 1, but no encoding declared; see https://peps.python.org/pep-0263/ for details

This is the same yt-dlp.exe file I use to download videos with Youtube-DLG, so I do not understand what is wrong...
Edit : this part seems similar to this bug : #616

Have a nice day ! :-)

@Bolb389 Bolb389 added the bug Something isn't working label Jan 31, 2024
@axcore
Copy link
Owner

axcore commented Jan 31, 2024

So even if the proxy is set in the settings, maybe it is only used when downloading a video

That is correct. It is a yt-dlp download option, not a Tartube setting.

If you can't install FFmpeg, then use the installer that includes FFmpeg. Install Tartube as normal. When it is finished, create an empty file called settings.json in Tartube's code folder (the one that contains the setup.py file - you can open this folder from Tartube's main menu). Your installation is now identical to the portable one.

pip3 is python's package manager. I have never tried configuring it to use a proxy, but this thread offers some suggestions. Specifically, you can open the mingw64 terminal (again, by using Tartube's main menu), and type the command

pip3 config set global.proxy http://{host}:{port}

...switching (host) and (port) for whatever is required on your network. Once pip3 has been updated correctly, it should be able to install yt-dlp for you.

@Bolb389
Copy link
Author

Bolb389 commented Feb 2, 2024

Hello, thank you very much for your help !

I did this as advised :

  • I installed Tartube with the installer that includes FFmpeg
  • I set the proxy in mingw64 terminal (System > Open MSYS2 Terminal) : pip3 config set global.proxy http://{host}:{port}
  • I set the proxy in Tartube settings (advanced mode, Operations > Proxyes) (for yt-dlp) http://{host}:{port}
  • I Installed yt-dlp (Operations > Update yt-dlp)

Now it's working fine, I'm able to install/update yt-dlp and download videos (I only tried Classic Mode) :-)
I will now install it on my colleague's computer (she need to download videos made by public schools and highschools for a contest of videos/flyers against bullying/harassment).
Have a nice day !

@axcore axcore closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants