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

yt-dlp-FixupMtimeが、yt-dlpが参照するプラグインパスにインストールされない #297

Closed
cradle8810 opened this issue Oct 12, 2024 · 5 comments
Labels
bug Something isn't working console.hayaworld.home mac.hayaworld.home 👈Manually Fixed Fixed by hand currently, but need to make automation 🐇 Rapid Fix Required Priority High skylark.hayaworld.home

Comments

@cradle8810
Copy link
Owner

cradle8810 commented Oct 12, 2024

もともとのエラーは次のとおり。

Traceback (most recent call last):
  File "yt_dlp/__main__.py", line 17, in <module>
  File "yt_dlp/__init__.py", line 1086, in main
  File "yt_dlp/__init__.py", line 984, in _real_main
  File "yt_dlp/YoutubeDL.py", line 809, in __init__
  File "yt_dlp/postprocessor/__init__.py", line 42, in get_postprocessor
KeyError: 'FixupMtimePP'
[PYI-181804:ERROR] Failed to execute script '__main__' due to unhandled exception!

これは、yt-dlp-FixupMtimeのREADMEのとおり、pipでインストールした場合のインストール先ディレクトリが、今のyt-dlpのバージョンでは正しくないため。yt-dlpが参照するパス配下にインストールされない。

skylark.hayaworld.home[~]% find . -name 'yt_dlp_plugins'
./.local/lib/python3.10/site-packages/yt_dlp_plugins

HayabookAir2023.hayaworld.home[~]% find . -name 'yt_dlp_plugins'
./Library/Python/3.9/lib/python/site-packages/yt_dlp_plugins

プラグインとして参照するディレクトリは下記のとおり。
https://github.com/yt-dlp/yt-dlp#installing-plugins

めんどっちいことにpythonのバージョンがディレクトリ名に入るため、pythonのバージョンを確認のうえ、
~/.yt-dlp/plugins/配下に、~/.local/lib/python3.(バージョン)/site-packages/yt_dlp_pluginsへのシンボリックリンクを作成するのがいいかもしれない

@cradle8810
Copy link
Owner Author

HayabookAir2023.hayaworld.home[~]% pip3 show -v yt-dlp-FixupMtime | grep Location
Location: /Users/hayato/Library/Python/3.9/lib/python/site-packages

skylark.hayaworld.home[~]% pip3 show -v yt-dlp-FixupMtime | grep Location
Location: /home/hayato/.local/lib/python3.10/site-packages

インストール先は上記のコマンドでとれるので、前段に置くとよい

@cradle8810
Copy link
Owner Author

Linuxの場合は下記のコマンドに相当する

% mkdir -p ~/.yt-dlp/plugins/yt-dlp-FixupMtime/yt_dlp_plugins
% ln -s ~/.local/lib/python3.10/site-packages/yt_dlp_plugins/postprocessor ~/.yt-dlp/plugins/yt-dlp-FixupMtime/yt_dlp_plugins

@cradle8810 cradle8810 added 🐇 Rapid Fix Required Priority High 👈Manually Fixed Fixed by hand currently, but need to make automation labels Oct 24, 2024
@cradle8810
Copy link
Owner Author

Ubuntu24.04ではここ。

/usr/local/lib/python3.12/dist-packages/yt_dlp_plugins/postprocessor/fixup_mtime.py

前段にPythonのバージョンを確認するtaskを入れたほうがよさそう

@cradle8810
Copy link
Owner Author

ansible_python_versionというfactsがある。システムに直接yt-dlpをインストールしているので、バージョンは同一と考えて差し支えなさそう

@cradle8810
Copy link
Owner Author

#343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working console.hayaworld.home mac.hayaworld.home 👈Manually Fixed Fixed by hand currently, but need to make automation 🐇 Rapid Fix Required Priority High skylark.hayaworld.home
Projects
None yet
Development

No branches or pull requests

1 participant