cgomesu / tvhlink

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

Unable to update to Streamlink 3.0.0 (from 2.4.0) owing to changed dependencies #10

Closed cgomesu closed 3 years ago

cgomesu commented 3 years ago

Streamlink 3.0.0 has been released and it introduces changes to dependencies that require modification of the streamlink_for_tvh_container.sh script. Per the release notes:

  • BREAKING/requirements: dropped alternative dependency pycrypto and removed the STREAMLINK_USE_PYCRYPTO env var switch (#4174)
  • BREAKING/requirements: switched from iso-639+iso3166 to pycountry and removed the STREAMLINK_USE_PYCOUNTRY env var switch (#4175)
  • BREAKING/setup: disabled unsupported Python versions, disabled the deprecated test setuptools command, removed the NO_DEPS env var, and switched to declarative package data via setup.cfg (#4079, #4107, #4115 #4113)

...

  • Added: official support for Python 3.10 (#4144)

...

  • Requirements: bumped lxml to >4.6.4,<5.0 and websocket-client to >=1.2.1,<2.0 (#4143, #4153)

A few hosts of mine (notably arm-based) are unable to automatically build lxml>4.6.4 (see issue #6 for more details), which keeps them on Streamlink 2.4.0. x86_64 hosts, on the other hand, seem to be able to upgrade just fine (of note, there's an lxml wheel for them though, so they do not need to build from source).


One solution is to bump Python 3.8 (latest version in the Alpine 3.12 branch) to Python 3.9 (latest version in the Alpine edge branch) along with the other related packages (py3-pip, py3-lxml, etc.).

A drawback is that the container will take longer to initialize the TVHeadend server, owing to the additional upgrades going on during startup. That said, I think it is worth it to update the streamlink_for_tvh_container.sh script accordingly to ensure that we are running the latest Streamlink version.

cgomesu commented 3 years ago

updated script successfully installs Python 3.9 from Alpine's edge branch and then install Streamlink 3.0.1 from pip3. tested with both arm64 and x86_64 hosts, so I'm pretty sure it is safe. will push changes to master soon.

will have to monitor how it plays with (somewhat frequent) Python 3.9 upgrades from edge though. currently, the script will attempt to upgrade Python 3.9 (and related packages from apk) whenever the installed version falls behind whatever is available at the time (check_apk_pkg_version python3 '<'). might need to tune this.


arm64 host:

***********************************************
****** Streamlink install/upgrade script ******
***********************************************
Author: cgomesu
Repo: https://github.com/cgomesu/tvhlink
***********************************************
[TVHlink] [info] Upgrading Python3...
[TVHlink] [info] APK: Installing packages from the edge branch.
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
(1/44) Upgrading libgpg-error (1.37-r0 -> 1.42-r1)
(2/44) Upgrading libgcrypt (1.8.8-r1 -> 1.9.4-r0)
(3/44) Upgrading libcrypto1.1 (1.1.1l-r0 -> 1.1.1l-r5)
(4/44) Upgrading libssl1.1 (1.1.1l-r0 -> 1.1.1l-r5)
(5/44) Upgrading ca-certificates-bundle (20191127-r4 -> 20191127-r7)
(6/44) Upgrading readline (8.0.4-r0 -> 8.1.1-r0)
(7/44) Upgrading expat (2.2.9-r1 -> 2.4.1-r0)
(8/44) Upgrading libffi (3.3-r2 -> 3.4.2-r1)
(9/44) Upgrading p11-kit (0.23.22-r0 -> 0.24.0-r1)
(10/44) Upgrading wayland-libs-client (1.18.0-r4 -> 1.19.0-r1)
(11/44) Upgrading py3-lxml (4.6.3-r0 -> 4.6.4-r0)
(12/44) Upgrading gdbm (1.13-r1 -> 1.22-r0)
(13/44) Installing mpdecimal (2.5.1-r1)
(14/44) Upgrading sqlite-libs (3.32.1-r1 -> 3.36.0-r0)
(15/44) Upgrading python3 (3.8.10-r0 -> 3.9.7-r3)
(16/44) Upgrading py3-appdirs (1.4.4-r1 -> 1.4.4-r2)
(17/44) Upgrading py3-certifi (2020.4.5.1-r0 -> 2020.12.5-r1)
(18/44) Installing py3-charset-normalizer (2.0.7-r0)
(19/44) Upgrading py3-idna (2.9-r0 -> 3.3-r0)
(20/44) Upgrading py3-urllib3 (1.25.9-r0 -> 1.26.7-r0)
(21/44) Upgrading py3-requests (2.23.0-r0 -> 2.26.0-r1)
(22/44) Purging py3-chardet (3.0.4-r4)
(23/44) Upgrading py3-msgpack (1.0.2-r0 -> 1.0.2-r1)
(24/44) Upgrading py3-lockfile (0.12.2-r3 -> 0.12.2-r4)
(25/44) Upgrading py3-cachecontrol (0.12.6-r0 -> 0.12.10-r0)
(26/44) Upgrading py3-colorama (0.4.4-r0 -> 0.4.4-r1)
(27/44) Upgrading py3-contextlib2 (0.6.0-r0 -> 21.6.0-r1)
(28/44) Upgrading py3-distlib (0.3.0-r0 -> 0.3.3-r0)
(29/44) Upgrading py3-distro (1.5.0-r1 -> 1.6.0-r0)
(30/44) Upgrading py3-six (1.15.0-r0 -> 1.16.0-r0)
(31/44) Upgrading py3-webencodings (0.5.1-r3 -> 0.5.1-r4)
(32/44) Upgrading py3-html5lib (1.1-r0 -> 1.1-r1)
(33/44) Upgrading py3-parsing (2.4.7-r0 -> 2.4.7-r2)
(34/44) Upgrading py3-packaging (20.4-r0 -> 20.9-r1)
(35/44) Installing py3-tomli (1.2.2-r0)
(36/44) Upgrading py3-pep517 (0.9.1-r0 -> 0.12.0-r0)
(37/44) Purging py3-pytoml (0.1.21-r0)
(38/44) Upgrading py3-progress (1.5-r0 -> 1.6-r0)
(39/44) Upgrading py3-retrying (1.3.3-r0 -> 1.3.3-r2)
(40/44) Upgrading py3-ordered-set (4.0.1-r0 -> 4.0.2-r2)
(41/44) Upgrading py3-setuptools (47.0.0-r0 -> 52.0.0-r4)
(42/44) Upgrading py3-toml (0.10.1-r0 -> 0.10.2-r2)
(43/44) Upgrading py3-pip (20.3.4-r0 -> 20.3.4-r1)
(44/44) Upgrading python2 (2.7.18-r0 -> 2.7.18-r4)
Executing busybox-1.31.1-r20.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 518 MiB in 281 packages
[TVHlink] [info] Installing Streamlink...
[TVHlink] [info] APK and PIP3: Installing required packages.
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/APKINDEX.tar.gz
(1/14) Upgrading .build-deps (20211117.114410 -> 20211117.165307)
(2/14) Purging build-base (0.5-r2)
(3/14) Purging file (5.38-r0)
(4/14) Purging g++ (9.3.0-r2)
(5/14) Purging make (4.3-r0)
(6/14) Purging libc-dev (0.7.2-r3)
(7/14) Purging fortify-headers (1.1-r0)
(8/14) Purging patch (2.7.6-r7)
(9/14) Purging libxslt-dev (1.1.34-r0)
(10/14) Purging libmagic (5.38-r0)
(11/14) Purging libxml2-dev (2.9.12-r0)
(12/14) Purging xz-dev (5.2.5-r0)
(13/14) Purging zlib-dev (1.2.11-r3)
(14/14) Purging pkgconf (1.7.2-r0)
Executing busybox-1.31.1-r20.trigger
OK: 433 MiB in 268 packages
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (52.0.0)
Collecting setuptools
  Downloading setuptools-59.1.1-py3-none-any.whl (951 kB)
Requirement already satisfied: pip in /usr/lib/python3.9/site-packages (20.3.4)
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 52.0.0
    Uninstalling setuptools-52.0.0:
      Successfully uninstalled setuptools-52.0.0
  Attempting uninstall: pip
    Found existing installation: pip 20.3.4
    Uninstalling pip-20.3.4:
      Successfully uninstalled pip-20.3.4
Successfully installed pip-21.3.1 setuptools-59.1.1
[TVHlink] [info] PIP3: Installing Streamlink.
Collecting streamlink
  Downloading streamlink-3.0.1-py3-none-any.whl (326 kB)
Collecting PySocks!=1.5.7,>=1.5.6
  Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Requirement already satisfied: lxml<5.0,>=4.6.4 in /usr/lib/python3.9/site-packages (from streamlink) (4.6.4)
Collecting isodate
  Downloading isodate-0.6.0-py2.py3-none-any.whl (45 kB)
Requirement already satisfied: requests<3.0,>=2.26.0 in /usr/lib/python3.9/site-packages (from streamlink) (2.26.0)
Collecting pycryptodome<4,>=3.4.3
  Downloading pycryptodome-3.11.0.tar.gz (3.8 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pycountry
  Downloading pycountry-20.7.3.tar.gz (10.1 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting websocket-client<2.0,>=1.2.1
  Downloading websocket_client-1.2.1-py2.py3-none-any.whl (52 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (1.26.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (2020.12.5)
Requirement already satisfied: charset_normalizer~=2.0.0 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (2.0.7)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (3.3)
Requirement already satisfied: six in /usr/lib/python3.9/site-packages (from isodate->streamlink) (1.16.0)
Using legacy 'setup.py install' for pycryptodome, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pycountry, since package 'wheel' is not installed.
Installing collected packages: websocket-client, PySocks, pycryptodome, pycountry, isodate, streamlink
    Running setup.py install for pycryptodome: started
    Running setup.py install for pycryptodome: finished with status 'done'
    Running setup.py install for pycountry: started
    Running setup.py install for pycountry: finished with status 'done'
Successfully installed PySocks-1.7.1 isodate-0.6.0 pycountry-20.7.3 pycryptodome-3.11.0 streamlink-3.0.1 websocket-client-1.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[TVHlink] [info] APK: Removing packages no longer required.
(1/10) Purging .build-deps (20211117.165307)
(2/10) Purging gcc (9.3.0-r2)
(3/10) Purging binutils (2.34-r2)
(4/10) Purging libatomic (9.3.0-r2)
(5/10) Purging libgomp (9.3.0-r2)
(6/10) Purging libgphobos (9.3.0-r2)
(7/10) Purging musl-dev (1.1.24-r10)
(8/10) Purging isl (0.18-r0)
(9/10) Purging mpc1 (1.1.0-r1)
(10/10) Purging mpfr4 (4.0.2-r4)
Executing busybox-1.31.1-r20.trigger
OK: 324 MiB in 258 packages
[TVHlink] [info] Streamlink version: streamlink 3.0.1.
***********************************************
* Finished Streamlink install/upgrade script
* Message: Reached EOF without critical errors.
***********************************************

x86_64 host:

***********************************************
****** Streamlink install/upgrade script ******
***********************************************
Author: cgomesu
Repo: https://github.com/cgomesu/tvhlink
***********************************************
[TVHlink] [info] Upgrading Python3...
[TVHlink] [info] APK: Installing packages from the edge branch.
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
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/49) Upgrading musl (1.1.24-r10 -> 1.2.2-r7)
(2/49) Upgrading libcrypto1.1 (1.1.1l-r0 -> 1.1.1l-r5)
(3/49) Upgrading libssl1.1 (1.1.1l-r0 -> 1.1.1l-r5)
(4/49) Upgrading ca-certificates-bundle (20191127-r4 -> 20191127-r7)
(5/49) Upgrading readline (8.0.4-r0 -> 8.1.1-r0)
(6/49) Upgrading expat (2.2.9-r1 -> 2.4.1-r0)
(7/49) Upgrading libffi (3.3-r2 -> 3.4.2-r1)
(8/49) Upgrading p11-kit (0.23.22-r0 -> 0.24.0-r1)
(9/49) Upgrading wayland-libs-client (1.18.0-r4 -> 1.19.0-r1)
(10/49) Upgrading libgcc (9.3.0-r2 -> 10.3.1_git20211027-r0)
(11/49) Upgrading libstdc++ (9.3.0-r2 -> 10.3.1_git20211027-r0)
(12/49) Upgrading libxml2 (2.9.12-r0 -> 2.9.12-r2)
(13/49) Upgrading libgpg-error (1.37-r0 -> 1.42-r1)
(14/49) Upgrading libgcrypt (1.8.8-r1 -> 1.9.4-r0)
(15/49) Upgrading libxslt (1.1.34-r0 -> 1.1.34-r1)
(16/49) Upgrading llvm10-libs (10.0.0-r2 -> 10.0.1-r4)
(17/49) Installing py3-lxml (4.6.4-r0)
(18/49) Upgrading gdbm (1.13-r1 -> 1.22-r0)
(19/49) Installing mpdecimal (2.5.1-r1)
(20/49) Upgrading sqlite-libs (3.32.1-r1 -> 3.36.0-r0)
(21/49) Upgrading python3 (3.8.10-r0 -> 3.9.7-r3)
(22/49) Upgrading py3-appdirs (1.4.4-r1 -> 1.4.4-r2)
(23/49) Upgrading py3-certifi (2020.4.5.1-r0 -> 2020.12.5-r1)
(24/49) Installing py3-charset-normalizer (2.0.7-r0)
(25/49) Upgrading py3-idna (2.9-r0 -> 3.3-r0)
(26/49) Upgrading py3-urllib3 (1.25.9-r0 -> 1.26.7-r0)
(27/49) Upgrading py3-requests (2.23.0-r0 -> 2.26.0-r1)
(28/49) Purging py3-chardet (3.0.4-r4)
(29/49) Installing py3-msgpack (1.0.2-r1)
(30/49) Installing py3-lockfile (0.12.2-r4)
(31/49) Installing py3-cachecontrol (0.12.10-r0)
(32/49) Installing py3-colorama (0.4.4-r1)
(33/49) Installing py3-contextlib2 (21.6.0-r1)
(34/49) Installing py3-distlib (0.3.3-r0)
(35/49) Installing py3-distro (1.6.0-r0)
(36/49) Upgrading py3-six (1.15.0-r0 -> 1.16.0-r0)
(37/49) Installing py3-webencodings (0.5.1-r4)
(38/49) Installing py3-html5lib (1.1-r1)
(39/49) Upgrading py3-parsing (2.4.7-r0 -> 2.4.7-r2)
(40/49) Upgrading py3-packaging (20.4-r0 -> 20.9-r1)
(41/49) Installing py3-tomli (1.2.2-r0)
(42/49) Installing py3-pep517 (0.12.0-r0)
(43/49) Installing py3-progress (1.6-r0)
(44/49) Installing py3-retrying (1.3.3-r2)
(45/49) Upgrading py3-ordered-set (4.0.1-r0 -> 4.0.2-r2)
(46/49) Upgrading py3-setuptools (47.0.0-r0 -> 52.0.0-r4)
(47/49) Installing py3-toml (0.10.2-r2)
(48/49) Installing py3-pip (20.3.4-r1)
(49/49) Upgrading python2 (2.7.18-r0 -> 2.7.18-r4)
Executing busybox-1.31.1-r20.trigger
Executing ca-certificates-20191127-r4.trigger
OK: 479 MiB in 274 packages
[TVHlink] [info] Installing Streamlink...
[TVHlink] [info] APK and PIP3: Installing required packages.
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/11) Downgrading musl (1.2.2-r7 -> 1.1.24-r10)
(2/11) Installing binutils (2.34-r2)
(3/11) Installing isl (0.18-r0)
(4/11) Installing libgomp (9.3.0-r2)
(5/11) Installing libatomic (9.3.0-r2)
(6/11) Installing libgphobos (9.3.0-r2)
(7/11) Installing mpfr4 (4.0.2-r4)
(8/11) Installing mpc1 (1.1.0-r1)
(9/11) Installing gcc (9.3.0-r2)
(10/11) Installing musl-dev (1.1.24-r10)
(11/11) Installing .build-deps (20211117.170216)
Executing busybox-1.31.1-r20.trigger
OK: 611 MiB in 284 packages
Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (52.0.0)
Collecting setuptools
  Downloading setuptools-59.1.1-py3-none-any.whl (951 kB)
Requirement already satisfied: pip in /usr/lib/python3.9/site-packages (20.3.4)
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 52.0.0
    Uninstalling setuptools-52.0.0:
      Successfully uninstalled setuptools-52.0.0
  Attempting uninstall: pip
    Found existing installation: pip 20.3.4
    Uninstalling pip-20.3.4:
      Successfully uninstalled pip-20.3.4
Successfully installed pip-21.3.1 setuptools-59.1.1
[TVHlink] [info] PIP3: Installing Streamlink.
Collecting streamlink
  Downloading streamlink-3.0.1-py3-none-any.whl (326 kB)
Collecting isodate
  Downloading isodate-0.6.0-py2.py3-none-any.whl (45 kB)
Requirement already satisfied: lxml<5.0,>=4.6.4 in /usr/lib/python3.9/site-packages (from streamlink) (4.6.4)
Collecting websocket-client<2.0,>=1.2.1
  Downloading websocket_client-1.2.1-py2.py3-none-any.whl (52 kB)
Collecting PySocks!=1.5.7,>=1.5.6
  Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting pycryptodome<4,>=3.4.3
  Downloading pycryptodome-3.11.0.tar.gz (3.8 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: requests<3.0,>=2.26.0 in /usr/lib/python3.9/site-packages (from streamlink) (2.26.0)
Collecting pycountry
  Downloading pycountry-20.7.3.tar.gz (10.1 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (1.26.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (2020.12.5)
Requirement already satisfied: charset_normalizer~=2.0.0 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (2.0.7)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.9/site-packages (from requests<3.0,>=2.26.0->streamlink) (3.3)
Requirement already satisfied: six in /usr/lib/python3.9/site-packages (from isodate->streamlink) (1.16.0)
Using legacy 'setup.py install' for pycryptodome, since package 'wheel' is not installed.
Using legacy 'setup.py install' for pycountry, since package 'wheel' is not installed.
Installing collected packages: websocket-client, PySocks, pycryptodome, pycountry, isodate, streamlink
    Running setup.py install for pycryptodome: started
    Running setup.py install for pycryptodome: finished with status 'done'
    Running setup.py install for pycountry: started
    Running setup.py install for pycountry: finished with status 'done'
Successfully installed PySocks-1.7.1 isodate-0.6.0 pycountry-20.7.3 pycryptodome-3.11.0 streamlink-3.0.1 websocket-client-1.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[TVHlink] [info] APK: Removing packages no longer required.
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.12/main: No such file or directory
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.12/community: No such file or directory
(1/10) Purging .build-deps (20211117.170216)
(2/10) Purging gcc (9.3.0-r2)
(3/10) Purging binutils (2.34-r2)
(4/10) Purging libatomic (9.3.0-r2)
(5/10) Purging libgomp (9.3.0-r2)
(6/10) Purging libgphobos (9.3.0-r2)
(7/10) Purging musl-dev (1.1.24-r10)
(8/10) Purging isl (0.18-r0)
(9/10) Purging mpc1 (1.1.0-r1)
(10/10) Purging mpfr4 (4.0.2-r4)
Executing busybox-1.31.1-r20.trigger
OK: 479 MiB in 274 packages
[TVHlink] [info] Streamlink version: streamlink 3.0.1.
***********************************************
* Finished Streamlink install/upgrade script
* Message: Reached EOF without critical errors.
***********************************************