mhogomchungu / media-downloader

Media Downloader is a Qt/C++ front end to yt-dlp, youtube-dl, gallery-dl, lux, you-get, svtplay-dl, aria2c, wget and safari books..
GNU General Public License v2.0
1.34k stars 102 forks source link

Use a static version of yt-dlp #334

Closed gs-foto closed 8 months ago

gs-foto commented 8 months ago

I have a linux binary of yt-dlp installed. Media-downloader is unable to find it, even when linked/installed in /usr/local/bin and in $PATH. Can I somehow via the command line point media-downloader to the binary?

mhogomchungu commented 8 months ago

Newer versions of Media Downloader do not use system provided yt-dlp and it uses its own version and it automatically download it from yt-dlp on first run.

The reason for it is that Media Downloader can easily get confused when it sees an older version of yt-dlp from one location and then attempt to update it but update it to a different location. Also system provided binaries can not get updated by Media Downloader.

Start Media Downloader while you have an active internet connection and it should automatically download yt-dlp and it will tell you where it download it to.

gs-foto commented 8 months ago

I just installed version 3.4 on Ubuntu 18.04, and I have the same problem:

[media-downloader] Checking installed version of yt-dlp
[media-downloader] Failed to find version information, make sure "yt-dlp" is installed and works properly
[media-downloader] Checking installed version of ffmpeg
[media-downloader] Found version: 3.4.11-0ubuntu0.1+esm3
[media-downloader] Checking installed version of aria2c
[media-downloader] Found version: 1.33.1

I tried downloading anyway, and discovered that yt-dlp is indeed there (.local/share/media-downloader/bin/yt-dlp) but throws errors:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./yt-dlp/__main__.py", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
etc

My guess is I'm missing a python module, but I haven't a clue as to which.

gs-foto commented 8 months ago

Apparently this is a python 3.6 issue.

File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)

I used update-alternatives to use 3.8, but the call is still to 3.6. What am I doing wrong?

mhogomchungu commented 8 months ago

Copying the version you have in /usr/local/bin to $HOME/.local/share/media-downloader/bin and check if it works or not.

What is the output of the following command:

whereis python
gs-foto commented 8 months ago

whereis python: python: /usr/bin/python3.7m /usr/bin/python3.6 /usr/bin/python3.8 /usr/bin/python3.6dm-config /usr/bin/python3.7 /usr/bin/python3.6-dbg /usr/bin/python3.6m /usr/bin/python3.6m-config /usr/bin/python3.6-config /usr/bin/python3.6dm /usr/bin/python2.7 /usr/bin/python3.6-dbg-config /usr/bin/python2.7-config /usr/bin/python /usr/lib/python3.6 /usr/lib/python3.8 /usr/lib/python3.7 /usr/lib/python2.7 /etc/python3.6 /etc/python3.8 /etc/python3.7 /etc/python2.7 /etc/python /usr/local/lib/python3.6 /usr/local/lib/python3.8 /usr/local/lib/python3.7 /usr/local/lib/python2.7 /usr/include/python3.6 /usr/include/python3.6m /usr/include/python2.7_d /usr/include/python3.6dm /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz I had already removed the copy in /usr/local/bin. I reinstalled locally to $HOME/.local/bin/ and copied that. Media-downloader finds it, but still fails:

[media-downloader] Checking installed version of yt-dlp
[media-downloader] Found version: 2022.07.18
[media-downloader] cmd: "/home/user/.local/share/media-downloader/bin/yt-dlp" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "--output-na-placeholder" "NA" "-f" "bestvideo[ext=mp4][vcodec^=avc]+bestaudio[ext=m4a]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio/best" "-f" "22" "--compat-options" "2022" "--progress-template" "download:[download] {"filename":"%(progress.filename)s","downloaded_bytes":"%(progress.downloaded_bytes)s","ETA":"%(progress.eta)s","total_bytes_estimate":"%(progress.total_bytes_estimate)s","total_bytes":"%(progress.total_bytes)s","speed":"%(progress.speed)s","fragment_index":"%(progress.fragment_index)s","fragment_count":"%(progress.fragment_count)s"}" "https://www.youtube.com/watch?v=bfNyxAE1YBg"
Usage: yt-dlp [OPTIONS] URL [URL...]
yt-dlp: error: wrong OPTS for --compat-options: 2022
[media-downloader] Download Failed(ErrorCode=2)
mhogomchungu commented 8 months ago

You have "python3.8" installed and use instructions from below link to tell Media Downloader to use it. In the instructions, replace "python3.10" with "python3.8".

https://github.com/mhogomchungu/media-downloader/issues/249#issuecomment-1435519900

gs-foto commented 8 months ago

Success!! Thank you so much! I followed your instructions and changed the symlink to point to python 3.8 and it worked. I did get 503 errors, but a quick search told me to add the --check-formats option and that worked. There are still 503 errors, but it succeeds after several retries. Thanks again, and thanks for a wonderful program.