Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902027 - net-misc/yt-dlp won't upgrade to the latest version and reports old version
Summary: net-misc/yt-dlp won't upgrade to the latest version and reports old version
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Piotr Karbowski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-18 11:11 UTC by Mamadou Babaei
Modified: 2023-03-20 18:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mamadou Babaei 2023-03-18 11:11:46 UTC
OK, I've been using net-misc/yt-dlp for a long time on this PC without any issues. Today, I decided to download a video and it says:

$ youtube-dl 'https://www.youtube.com/watch?v=0NvDplZHDlk'
[youtube] 0NvDplZHDlk: Downloading webpage
[youtube] 0NvDplZHDlk: Downloading android player API JSON
ERROR: [youtube] 0NvDplZHDlk: Unable to extract uploader id; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U

Then, I went to the GitHub page as suggested to report the issue and there was other instructions such as:

> I've verified that I'm running yt-dlp version 2023.03.04 (update instructions) or later (specify commit) *

So, in order to make sure I have the version suggested:

$ yt-dlp --version
2022.11.11

$ youtube-dl --version                                    
2022.11.11

So, I checked the portage version (and also made sure I do not have the old youtube-dl ebuilds):

$ emerge -s youtube                                                                                                                                                                                                                                            
[ Results for search key : youtube ]
Searching...

*  dev-python/youtube-search-python
      Latest version available: 1.6.6
      Latest version installed: [ Not Installed ]
      Size of files: 114 KiB
      Homepage:      https://github.com/alexmercerind/youtube-search-python/
      Description:   Get YouTube video information using link WITHOUT YouTube Data API v3
      License:       MIT

*  net-misc/youtube-viewer
      Latest version available: 3.10.1
      Latest version installed: [ Not Installed ]
      Size of files: 258 KiB
      Homepage:      https://github.com/trizen/youtube-viewer
      Description:   A command line utility for viewing youtube-videos in Mplayer
      License:       || ( Artistic-2 GPL-1+ )

[ Applications found : 2 ]


$ emerge -s yt-dlp                                                                                                                                                                                                                                             
[ Results for search key : yt-dlp ]
Searching...

*  net-misc/yt-dlp
      Latest version available: 2023.03.04
      Latest version installed: 2023.03.04
      Size of files: 5,006 KiB
      Homepage:      https://github.com/yt-dlp/yt-dlp/
      Description:   youtube-dl fork with additional features and fixes
      License:       Unlicense

[ Applications found : 1 ]


Now, the interesting thing is even if I emerge net-misc/yt-dlp-9999 it still reports the same version with the --version switch.

Thus, I guess the Gentoo ebuild does not really update the program.
Comment 1 Mamadou Babaei 2023-03-18 11:15:44 UTC
Here is the confirmation that Portage lies about the version. I installed from pip directly and it works as expected:

$ python -m pip install yt-dlp --upgrade --upgrade-strategy eager --user
Requirement already satisfied: yt-dlp in /home/mamadou/.local/lib/python3.10/site-packages (2022.11.11)
Collecting yt-dlp
  Downloading yt_dlp-2023.3.4-py2.py3-none-any.whl (2.9 MB)
     |████████████████████████████████| 2.9 MB 3.9 MB/s 
Requirement already satisfied: websockets in /home/mamadou/.local/lib/python3.10/site-packages (from yt-dlp) (10.4)
Requirement already satisfied: brotli in /home/mamadou/.local/lib/python3.10/site-packages (from yt-dlp) (1.0.9)
Requirement already satisfied: certifi in /usr/lib/python3.10/site-packages (from yt-dlp) (3021.3.16)
Requirement already satisfied: mutagen in /home/mamadou/.local/lib/python3.10/site-packages (from yt-dlp) (1.46.0)
Requirement already satisfied: pycryptodomex in /home/mamadou/.local/lib/python3.10/site-packages (from yt-dlp) (3.15.0)
Collecting pycryptodomex
  Downloading pycryptodomex-3.17-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 196.3 MB/s 
Installing collected packages: pycryptodomex, yt-dlp
  Attempting uninstall: pycryptodomex
    Found existing installation: pycryptodomex 3.15.0
    Uninstalling pycryptodomex-3.15.0:
      Successfully uninstalled pycryptodomex-3.15.0
  Attempting uninstall: yt-dlp
    Found existing installation: yt-dlp 2022.11.11
    Uninstalling yt-dlp-2022.11.11:
      Successfully uninstalled yt-dlp-2022.11.11
  WARNING: The script yt-dlp is installed in '/home/mamadou/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pycryptodomex-3.17 yt-dlp-2023.3.4
WARNING: You are using pip version 21.2.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/lib/python-exec/python3.10/python -m pip install --upgrade pip' command.

$ ~/.local/bin/yt-dlp 'https://www.youtube.com/watch?v=0NvDplZHDlk'                 
[youtube] Extracting URL: https://www.youtube.com/watch?v=0NvDplZHDlk
[youtube] 0NvDplZHDlk: Downloading webpage
[youtube] 0NvDplZHDlk: Downloading android player API JSON
[info] 0NvDplZHDlk: Downloading 1 format(s): 247+251
[dashsegments] Total fragments: 1
[download] Destination: It Hurts to Move On, Healing is Painful [0NvDplZHDlk].f247.webm
[download] 100% of    7.39MiB in 00:00:00 at 15.74MiB/s
[dashsegments] Total fragments: 1
[download] Destination: It Hurts to Move On, Healing is Painful [0NvDplZHDlk].f251.webm
[download] 100% of    1.71MiB in 00:00:00 at 7.04MiB/s
[Merger] Merging formats into "It Hurts to Move On, Healing is Painful [0NvDplZHDlk].webm"
Deleting original file It Hurts to Move On, Healing is Painful [0NvDplZHDlk].f247.webm (pass -k to keep)
Deleting original file It Hurts to Move On, Healing is Painful [0NvDplZHDlk].f251.webm (pass -k to keep)

$ ~/.local/bin/yt-dlp --version                                         
2023.03.04
Comment 2 Ionen Wolkens gentoo-dev 2023-03-18 11:28:31 UTC
Odds are it's actually because of ~/.local or wherever else you may have previously used pip to install it given they may have priority over system's when loading site-packages, meaning /usr/bin/yt-dlp may load these despite coming from the ebuild.

For me it's all normal:

$ emerge -pvq yt-dlp
[ebuild   R   ] net-misc/yt-dlp-2023.03.04  USE="-test" PYTHON_TARGETS="python3_11 -python3_9 -python3_10"
$ /usr/bin/yt-dlp --version
2023.03.04

I suggest cleaning up pip installed packages to avoid conflicts.
Comment 3 Mamadou Babaei 2023-03-18 11:49:37 UTC
$ equery belongs -e /usr/bin/youtube-dl 
 * Searching for /usr/bin/youtube-dl ... 
net-misc/yt-dlp-2023.03.04 (/usr/bin/youtube-dl)

$ equery belongs -e /usr/bin/yt-dlp 
 * Searching for /usr/bin/yt-dlp ... 
dev-lang/python-exec-2.4.10 (/usr/lib/python-exec/python-exec2)

$ which youtube-dl
/usr/bin/youtube-dl

$ which yt-dlp    
/usr/bin/yt-dlp

$ echo $PATH
/opt/android/ant/bin:/home/mamadou/android-studio/jre/bin:/opt/android/sdk/ndk/25.1.8937393:/opt/android/sdk/extras/android/support:/opt/android/sdk/build-tools:/opt/android/sdk/platform-tools:/opt/android/sdk/tools:/home/mamadou/.local/lib64/perl5/bin:/usr/local/bin:/usr/local/sbin:/opt/android/ant/bin:/home/mamadou/android-studio/jre/bin:/opt/android/sdk/ndk/25.1.8937393:/opt/android/sdk/extras/android/support:/opt/android/sdk/build-tools:/opt/android/sdk/platform-tools:/opt/android/sdk/tools:/home/mamadou/.local/lib64/perl5/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/15/bin:/usr/lib/llvm/14/bin:/home/mamadou/dev/go/bin:/home/mamadou/dev/go/bin


I did not have the pip version before. And I don't have ~/.local/bin in my path either.

That's indeed odd.
Comment 4 Ionen Wolkens gentoo-dev 2023-03-18 11:57:14 UTC
This isn't about PATH, it's about where it reads site-packages from, aka (normally) /usr/lib/python*/site-packages/yt_dlp but could come from somewhere else like /usr/local if not ~/.local, or potentially elsewhere depending on settings.

yt-dlp doesn't control priorities and starting the portage-owned /usr/bin/yt-dlp could read the wrong site-packages and report a different version.
Comment 5 Piotr Karbowski (RETIRED) gentoo-dev 2023-03-19 11:22:18 UTC
This often comes from people running pip as user outside of venv.

The easiest way to see where it might come from would be to run

    python -c 'import yt_dlp; print(yt_dlp.__path__)'

And then act accordingly to what you get if it's anything else than /usr/lib/python*/site-packages/yt_dlp
Comment 6 Mamadou Babaei 2023-03-19 11:27:10 UTC
Thank you for the hint!

I solved it by completely removing the ebuild and re-emerging it. For some esoteric reason emerging (updating) alone did not do it. But a clean emerge did.

Nonetheless, here is the outout:

$ python -c 'import yt_dlp; print(yt_dlp.__path__)'
                
['/usr/lib/python3.10/site-packages/yt_dlp']

It could have happened because of default python version bumps, as I have /usr/lib/python3.10/site-packages and /usr/lib/python3.11/site-packages. No sure, if I had the old version prior to emerge -C.