Jump to content


Photo

Installing yt-dlp on OpenPLi 9.0 - is there any way?

yt-dlp liveproxy

  • Please log in to reply
5 replies to this topic

#1 mp107

  • Member
  • 5 posts

0
Neutral

Posted 27 January 2024 - 13:39

Hi,
I'm working on making work the yt-dlp and liveproxy on OpenPLi 9.0 based image to make it possible to put yt-dlp based channel list entries directly on the channel list (as an alternative to the OpenATV's YTDLPWrapper plugin). I've noticed that on the official image repository there is no yt-dlp package so I decided to try out installing it through pip (pip3) but it didn't work.

In short: Is there any way to install yt-dlp on OpenPLi 9.0?

After fresh install of OpenPLi's developer build (as well as on 9.0) I've run these commands to install liveproxy and yt-dlp...

root@sf8008:~# pip3 install --upgrade liveproxy                                                                                                                       
Collecting liveproxy                                                                                                                                                   
  Downloading liveproxy-2.0.0-py3-none-any.whl (8.5 kB)                                                                                                                
Installing collected packages: liveproxy                                                                                                                               
Successfully installed liveproxy-2.0.0                                                                                                                                 
root@sf8008:~# pip3 install --upgrade yt-dlp                                                                                                                           
Collecting yt-dlp                                                                                                                                                      
  Downloading yt_dlp-2023.12.30-py2.py3-none-any.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 1.4 MB/s
Collecting urllib3<3,>=1.26.17
  Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
     |████████████████████████████████| 104 kB 6.6 MB/s
Collecting certifi
  Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
     |████████████████████████████████| 162 kB 1.2 MB/s
Collecting requests<3,>=2.31.0
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 443 kB/s
Collecting websockets>=12.0
  Downloading websockets-12.0-py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 996 kB/s
Collecting pycryptodomex
  Downloading pycryptodomex-3.20.0.tar.gz (4.8 MB)
     |████████████████████████████████| 4.8 MB 1.5 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 331, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 151, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 255, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 63, in _build_backend
obj = import_module(mod_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 16, in <module>
from .dist import Distribution
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 27, in <module>
from .extern.packaging.markers import InvalidMarker, Marker
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.py", line 11, in <module>
from ._parser import (
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_parser.py", line 10, in <module>
from ._tokenizer import DEFAULT_RULES, Tokenizer
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_tokenizer.py", line 3, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'[/code]
... and stuck on the "ModuleNotFoundError: No module named 'dataclasses'" error.

After running that code in the Python's console I've made sure it is not included/installed...

root@sf8008:~# python3
Python 3.9.9 (main, May 22 2023, 19:10:24)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dataclasses import dataclass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dataclasses'
>>> exit()
root@sf8008:~#

As far as I know that package should be included in Python > 3.6. But either way I've tried to install it manually and check if it is being detected in Python...

root@sf8008:~# pip3 install dataclasses
Collecting dataclasses
Downloading dataclasses-0.6-py3-none-any.whl (14 kB)
Installing collected packages: dataclasses
Successfully installed dataclasses-0.6
root@sf8008:~# python3
Python 3.9.9 (main, May 22 2023, 19:10:24)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dataclasses import dataclass
>>> exit()
root@sf8008:~#

After that I've tried to install the yt-dlp once again but still got the same error...

root@sf8008:~# pip3 install --upgrade yt-dlp
Collecting yt-dlp
Using cached yt_dlp-2023.12.30-py2.py3-none-any.whl (3.0 MB)
Collecting websockets>=12.0
Using cached websockets-12.0-py3-none-any.whl (118 kB)
Collecting brotli; implementation_name == "cpython"
Downloading Brotli-1.1.0.tar.gz (7.4 MB)
|████████████████████████████████| 7.4 MB 416 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 331, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 151, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 255, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 63, in _build_backend
obj = import_module(mod_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 16, in <module>
from .dist import Distribution
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 27, in <module>
from .extern.packaging.markers import InvalidMarker, Marker
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.py", line 11, in <module>
from ._parser import (
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_parser.py", line 10, in <module>
from ._tokenizer import DEFAULT_RULES, Tokenizer
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_tokenizer.py", line 3, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

Is there any way to install the yt-dlp on OpenPLi 9.0 image?

 



Re: Installing yt-dlp on OpenPLi 9.0 - is there any way? #2 WanWizard

  • PLi® Core member
  • 70,542 posts

+1,812
Excellent

Posted 27 January 2024 - 14:49

Given the fact it is a fork of youtube-dl, it should be possible to adapt that build recipe.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Installing yt-dlp on OpenPLi 9.0 - is there any way? #3 longtimeuser

  • Member
  • 10 posts

+1
Neutral

Posted 7 June 2024 - 12:54

I had the same problem. Finally found two simple solutions.

 

Solution one

Goto official python site (h**ps://www.python.org/downloads/release/python-390/) (OpenPli 9.0 uses python version 3.9) download tarball,

extract missing dataclasses.py and copy it to /usr/lib/python3.9/ on your box.

 

Solutions two (recommended)

Install a package which contains the missing dataclasses.pyc:

> opkg install python-3-profile

 

Thats all. Happy yt-dlp - ing!



Re: Installing yt-dlp on OpenPLi 9.0 - is there any way? #4 littlesat

  • PLi® Core member
  • 57,181 posts

+699
Excellent

Posted 9 June 2024 - 09:43

I suggest solution 2 is the best and it looks like the plugin missed a dependancy.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Installing yt-dlp on OpenPLi 9.0 - is there any way? #5 Beeker

  • PLi® Contributor
  • 1,604 posts

+203
Excellent

Posted 12 July 2024 - 13:26

I've added pyhton3-dlp to Scarthgap branch

https://github.com/O...df6f8f60c7cd96b

 

Can't test it with Develop/Release as I don't have build-env for it, at the moment.


Dreambox dm920, Uclan Ustym4Kpro, Gigablue UHD TRIO 4K and Dreambox dm8000. Wavefrontier T55 13.0|19.2|23.5|28.2 + Ziggo.


Re: Installing yt-dlp on OpenPLi 9.0 - is there any way? #6 WanWizard

  • PLi® Core member
  • 70,542 posts

+1,812
Excellent

Posted 12 July 2024 - 19:58

I've looked at backporting it, but no luck, it's above my pay grade... ;)


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users