cgomesu / tvhlink

TVHlink (Tvheadend + Streamlink) integration
https://cgomesu.com/blog/Tvhlink
55 stars 8 forks source link

AttributeError: module 'streamlink.plugin.api.validate' has no attribute 'text' #28

Closed JSDA123 closed 1 year ago

JSDA123 commented 1 year ago

Streamlink installs but no longer works after recently re-creating my tvheadend container.

Streamlink previously worked with the same image Linuxserver.io version:- 62adbebf-ls192 Build-date:- 2023-11-04T15:37:47+00:00

The issue is not resolved after pulling the latest image: Linuxserver.io version:- 62adbebf-ls193 Build-date:- 2023-11-18T15:42:00+00:00

The issue might be a changed dependency in alpine:edge ... so I've waited a few days to see if it is resolved upstream, but so far no joy.

Streamlink installs successfully as usual:

[custom-init] streamlink_for_tvh_container.sh: executing...
***********************************************
****** Streamlink install/upgrade script ******
***********************************************
Author: cgomesu
Repo: https://github.com/cgomesu/tvhlink
***********************************************
[TVHlink] [info] Installing/upgrading Streamlink...
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
(1/67) Upgrading musl (1.2.4-r2 -> 1.2.4_git20230717-r4)
(2/67) Upgrading zlib (1.2.13-r1 -> 1.3-r2)
(3/67) Upgrading readline (8.2.1-r1 -> 8.2.1-r2)
(4/67) Upgrading libffi (3.4.4-r2 -> 3.4.4-r3)
(5/67) Upgrading libgcc (12.2.1_git20220924-r10 -> 13.2.1_git20231014-r0)
(6/67) Upgrading libstdc++ (12.2.1_git20220924-r10 -> 13.2.1_git20231014-r0)
(7/67) Upgrading libexpat (2.5.0-r1 -> 2.5.0-r2)
(8/67) Upgrading libbz2 (1.0.8-r5 -> 1.0.8-r6)
(9/67) Upgrading gmp (6.2.1-r3 -> 6.3.0-r0)
(10/67) Upgrading xz-libs (5.4.3-r0 -> 5.4.5-r0)
(11/67) Upgrading libxml2 (2.11.4-r0 -> 2.11.6-r0)
(12/67) Upgrading libgpg-error (1.47-r1 -> 1.47-r2)
(13/67) Upgrading libgcrypt (1.10.2-r1 -> 1.10.2-r2)
(14/67) Upgrading libxslt (1.1.38-r0 -> 1.1.39-r0)
(15/67) Upgrading sqlite-libs (3.41.2-r2 -> 3.44.0-r0)
(16/67) Upgrading python3 (3.11.6-r0 -> 3.11.6-r1)
(17/67) Upgrading python3-pycache-pyc0 (3.11.6-r0 -> 3.11.6-r1)
(18/67) Upgrading pyc (0.1-r0 -> 3.11.6-r1)
(19/67) Upgrading py3-charset-normalizer (3.1.0-r1 -> 3.3.2-r0)
(20/67) Upgrading py3-charset-normalizer-pyc (3.1.0-r1 -> 3.3.2-r0)
(21/67) Upgrading py3-requests-pyc (2.31.0-r0 -> 2.31.0-r1)
(22/67) Upgrading python3-pyc (3.11.6-r0 -> 3.11.6-r1)
(23/67) Upgrading py3-requests (2.31.0-r0 -> 2.31.0-r1)
(24/67) Installing py3-six (1.16.0-r8)
(25/67) Installing py3-six-pyc (1.16.0-r8)
(26/67) Installing py3-isodate (0.6.1-r4)
(27/67) Installing py3-isodate-pyc (0.6.1-r4)
(28/67) Installing py3-lxml (4.9.3-r1)
(29/67) Installing py3-lxml-pyc (4.9.3-r1)
(30/67) Installing py3-pycountry (22.3.5-r1)
(31/67) Installing py3-pycryptodome (3.19.0-r0)
(32/67) Installing py3-pysocks (1.7.1-r5)
(33/67) Installing py3-pysocks-pyc (1.7.1-r5)
(34/67) Installing py3-attrs (23.1.0-r1)
(35/67) Installing py3-attrs-pyc (23.1.0-r1)
(36/67) Installing py3-async_generator (1.10-r5)
(37/67) Installing py3-async_generator-pyc (1.10-r5)
(38/67) Installing py3-cparser (2.21-r4)
(39/67) Installing py3-cparser-pyc (2.21-r4)
(40/67) Installing py3-cffi (1.16.0-r0)
(41/67) Installing py3-cffi-pyc (1.16.0-r0)
(42/67) Installing py3-cryptography (41.0.5-r0)
(43/67) Installing py3-cryptography-pyc (41.0.5-r0)
(44/67) Installing py3-openssl (23.3.0-r0)
(45/67) Installing py3-openssl-pyc (23.3.0-r0)
(46/67) Installing py3-outcome (1.2.0-r2)
(47/67) Installing py3-outcome-pyc (1.2.0-r2)
(48/67) Installing py3-curio (1.6-r1)
(49/67) Installing py3-curio-pyc (1.6-r1)
(50/67) Installing py3-sniffio (1.3.0-r2)
(51/67) Installing py3-sniffio-pyc (1.3.0-r2)
(52/67) Installing py3-sortedcontainers (2.4.0-r4)
(53/67) Installing py3-sortedcontainers-pyc (2.4.0-r4)
(54/67) Installing py3-trio (0.21.0-r3)
(55/67) Installing py3-trio-pyc (0.21.0-r3)
(56/67) Installing py3-h11 (0.14.0-r3)
(57/67) Installing py3-h11-pyc (0.14.0-r3)
(58/67) Installing py3-wsproto (1.2.0-r2)
(59/67) Installing py3-wsproto-pyc (1.2.0-r2)
(60/67) Installing py3-trio-websocket (0.11.1-r0)
(61/67) Installing py3-trio-websocket-pyc (0.11.1-r0)
(62/67) Installing py3-typing-extensions (4.8.0-r0)
(63/67) Installing py3-typing-extensions-pyc (4.8.0-r0)
(64/67) Installing py3-websocket-client (1.6.4-r0)
(65/67) Installing py3-websocket-client-pyc (1.6.4-r0)
(66/67) Installing streamlink (6.3.1-r0)
(67/67) Installing streamlink-pyc (6.3.1-r0)
Executing busybox-1.36.1-r5.trigger
OK: 642 MiB in 339 packages
[TVHlink] [info] Streamlink version: streamlink 6.3.1.
***********************************************
* Finished Streamlink install/upgrade script
* Message: Reached EOF without critical errors.
***********************************************

Running streamlink -V returns the expected result:

$ docker exec -it tvheadend streamlink -V
streamlink 6.3.1

However any attempt to use a flag other than -V (for example opening a stream, or just "streamlink -h") results in errors such as:

Traceback (most recent call last):
  File "/usr/bin/streamlink", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/streamlink_cli/main.py", line 883, in main
    setup_plugins(args.plugin_dirs)
  File "/usr/lib/python3.11/site-packages/streamlink_cli/main.py", line 705, in setup_plugins
    load_plugins(PLUGIN_DIRS, showwarning=False)
  File "/usr/lib/python3.11/site-packages/streamlink_cli/main.py", line 613, in load_plugins
    success = streamlink.load_plugins(str(directory))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/streamlink/session.py", line 649, in load_plugins
    mod = load_module(module_name, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/streamlink/utils/module.py", line 14, in load_module
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/.local/share/streamlink/plugins/chaturbate.py", line 14, in <module>
    "url": validate.text,
           ^^^^^^^^^^^^^
AttributeError: module 'streamlink.plugin.api.validate' has no attribute 'text'

Thanks in advance for any support you can provide, this script makes my tvh setup so much more useful!

cgomesu commented 1 year ago

is this related to streamlink/streamlink/issues/5681 by any chance? do you also get this error while using other plugins? (it seems you're sideloading a version of the chaturbate plugin which is the source of the error.)

JSDA123 commented 1 year ago

Thanks that was the issue!