Bug 275325 - www/yt-dlp: where is the Python module installed?
Summary: www/yt-dlp: where is the Python module installed?
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-25 06:21 UTC by Thomas Guymer
Modified: 2023-12-21 22:29 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Guymer 2023-11-25 06:21:41 UTC
Hi,

"www/yt-dlp" installs fine and the binary "yt-dlp" works fine too. Where is the Python module "yt_dlp" installed though? In the "EMBEDDING YT-DLP" section of the README on GitHub there are examples of how to use the Python module directly for enhanced functionality. I have a script which does this on MacOS and it works fine, but running the script on FreeBSD returns the following error:

>>> import yt_dlp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'yt_dlp'

I tried searching my filesystem for a folder called "yt_dlp" but nothing came up. There doesn't appear to be any reference to copying files over in the Port definition either, the only things that I could find were some references to "yt_dlp" in https://github.com/freebsd/freebsd-ports/blob/main/www/yt-dlp/files/patch-Makefile#L31-L34 but these appear to be just making the binary.

Any help would be greatly appreciated, thanks. Is it as simple as appending a path to my "sys.path", if so, which path should I append?

Cheers,

Tom
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2023-11-25 09:04:53 UTC
Hi,

Installed files are listed here: https://cgit.freebsd.org/ports/tree/www/yt-dlp/pkg-plist

The port of yt-dlp doesn't package the module. Looking at GitHub that also seems to be the case looking at official release packages.

Please don't open bug reports for support requests, use the mailing list(s) instead.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-11-25 18:08:03 UTC
(In reply to Thomas Guymer from comment #0)

Hi Thomas,

The way how yt-dlp install itself is into one binary pre-compoled file.

For the Python module to be available python files need to be installed separately.

I didn't realize that yt-dlp is usable seeparately.

I will resolve this next week.

Yuri
Comment 3 Thomas Guymer 2023-11-26 07:52:08 UTC
That's great, thank you Yuri.
Comment 4 Thomas Guymer 2023-12-20 19:36:38 UTC
Hi Yuri,

Have you been able to take a look at getting the port to install the Python module as well as the compiled binary? Did it turn out to be non-trivial?

Thanks,

Tom
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2023-12-21 06:02:46 UTC
I've added the port www/py-yt-dlp-devel with all python files for the purpose of extending yt-dlp.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-12-21 06:04:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9854c15ac39641f99d498dd5c5b876a8987b5e28

commit 9854c15ac39641f99d498dd5c5b876a8987b5e28
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-12-21 06:01:16 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-12-21 06:02:55 +0000

    www/py-yt-dlp-devel: New port: Program for downloading videos from various platforms (devel files)

    PR:             275325

 www/Makefile                                       |    1 +
 www/py-yt-dlp-devel/Makefile (new)                 |   56 +
 www/py-yt-dlp-devel/distinfo (new)                 |    3 +
 www/py-yt-dlp-devel/files/patch-Makefile (new)     |   16 +
 .../files/patch-yt__dlp_update.py (new)            |   22 +
 www/py-yt-dlp-devel/pkg-descr (new)                |    4 +
 www/py-yt-dlp-devel/pkg-plist (new)                | 1150 ++++++++++++++++++++
 7 files changed, 1252 insertions(+)
Comment 7 Thomas Guymer 2023-12-21 19:54:14 UTC
That's great, thanks Yuri. I have just installed it now and I am pleased to report that it appears to be working well, cheers!
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2023-12-21 22:29:34 UTC
(In reply to Thomas Guymer from comment #7)

This is great!

Please let me know if you'd encounter any problems.


Yuri