From f4c590e4c7d2e307f6441eaaf3ebf6fa0e6cdc7d Mon Sep 17 00:00:00 2001 From: martinkg@fedoraproject.org Date: Aug 28 2017 08:41:22 +0000 Subject: not actively maintained, use streamlink instead --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 34aa7e8..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/livestreamer-1.11.1.tar.gz -/livestreamer-1.12.0.tar.gz -/livestreamer-1.12.1.tar.gz -/livestreamer-1.12.2.tar.gz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..7dfc728 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +not actively maintained, use streamlink instead diff --git a/livestreamer.spec b/livestreamer.spec deleted file mode 100644 index 4d1286f..0000000 --- a/livestreamer.spec +++ /dev/null @@ -1,170 +0,0 @@ -Name: livestreamer -Version: 1.12.2 -Release: 8%{?dist} -License: BSD and MIT -Summary: Extracts streams and pipes them into a video player of choice -Url: http://livestreamer.tanuki.se/ -Group: Applications/Internet -Source: https://pypi.python.org/packages/source/l/%{name}/%{name}-%{version}.tar.gz -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-requests -BuildRequires: python3-sphinx -BuildRequires: python-singledispatch -BuildRequires: python-futures -BuildRequires: dos2unix -Requires: python3-requests -Requires: fontawesome-fonts - -BuildArch: noarch - -%description -Livestreamer is a CLI program that extracts streams from various services and -pipes them into a video player of choice. -Livestreamer is built upon a plugin system which allows support for new -services to be easily added. - -%prep -%setup -q -n %{name}-%{version} - -# edit .py file and use python3 -find . -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' - -# delete version-control-internal-file -find . -name .gitignore -exec rm -f {} \; >/dev/null -# remove bundles fonts -rm -r docs/_themes/sphinx_rtd_theme_violet/static/fonts -# Remove bundled egg-info -rm -rf src/livestreamer.egg-info - -%build -%{__python3} setup.py build - -# Generate man page and html documentation (needs python-sphinx) -%{__python3} setup.py build_sphinx -b man -%{__python3} setup.py build_sphinx -b html - -%install -%{__python3} setup.py install --root=%{buildroot} --skip-build -for file in %{buildroot}%{python3_sitelib}/%{name}/packages/flashmedia/{tag,packet,__init__,flv,f4v,util,error}.py; do - chmod a+x $file -done - -# install man page -install -p -d -m755 %{buildroot}%{_mandir}/man1 -# rename manual page due rpmlint warning W: no-manual-page-for-binary python3-livestreamer -install -p -m644 build/sphinx/man/%{name}.1 %buildroot%{_mandir}/man1/%{name}.1 - -# install html docs -install -p -d -m755 %{buildroot}%{_docdir}/%{name} -mv build/sphinx/html %{buildroot}%{_docdir}/%{name} - -# convert to unix format due rpmlint warning W: wrong-file-end-of-line-encoding -dos2unix %{buildroot}/%{_docdir}/%{name}/html/_static/jquery.js - -# convert to utf8 due rpmlint warning W: file-not-utf8 /usr/share/doc/python-livestreamer/html/objects.inv -iconv -f iso-8859-1 -t utf-8 %{buildroot}/%{_docdir}/%{name}/html/objects.inv > objects.inv.utf8; \ -mv objects.inv.utf8 %{buildroot}/%{_docdir}/%{name}/html/objects.inv - -# E: non-executable-script /usr/lib/python3.5/site-packages/livestreamer/plugins/tvplayer.py -chmod a+x %{buildroot}%{python3_sitelib}/%{name}/plugins/{tvplayer,tv3cat}.py - -# convert to unix format due rpmlint warning W: wrong-file-end-of-line-encoding -dos2unix %{buildroot}/%{_docdir}/%{name}/html/objects.inv - -# Sphinx info file for hashing, no longer needed -rm %{buildroot}/%{_docdir}/%{name}/html/.buildinfo - -%check -%{__python3} setup.py test - -%files -%doc *.rst -%license LICENSE* -%{_bindir}/%{name} -%{python3_sitelib}/%{name} -%{python3_sitelib}/%{name}_cli -%{python3_sitelib}/%{name}-%{version}-py*.egg-info -%{_datadir}/doc/%{name}/html -%{_mandir}/man1/%{name}.1.* - -%changelog -* Wed Jul 26 2017 Fedora Release Engineering - 1.12.2-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 1.12.2-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Dec 19 2016 Miro HronĨok - 1.12.2-6 -- Rebuild for Python 3.6 - -* Tue Jul 19 2016 Fedora Release Engineering - 1.12.2-5 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 1.12.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Sat Nov 14 2015 Martin Gansser - 1.12.2-3 -- Changed file permisson due rpmlint warning non-executable-scripts -- Rebuild - -* Wed Jun 17 2015 Fedora Release Engineering - 1.12.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sun May 03 2015 Martin Gansser - 1.12.2-1 -- Update to 1.12.2 - -* Mon Mar 23 2015 Martin Gansser - 1.12.1-1 -- Update to 1.12.1 - -* Mon Mar 02 2015 Martin Gansser - 1.12.0-1 -- Update to 1.12.0 -- dropped plugins-hitbox-Refactor-to-use-the-StreamMapper.patch -- spec file cleanup - -* Sun Feb 15 2015 Martin Gansser - 1.11.1-7 -- renamed package from python-livestreamer to livestreamer -- cleanup spec file -- fixed typos -- removed whitespace - -* Sun Feb 15 2015 Martin Gansser - 1.11.1-6 -- Install html docs directly instead of adding them to %%doc -- Convert files with dos2unix in unix format -- Convert files in utf8 format -- Deleted Sphinx hash file -- Reverted package name -- Dropped url address for patch0 -- Make install preserve timestamps -- Renamed man page -- Used wildcard for manpage -- Added BR dos2unix -- Added R python3-requests - -* Sun Feb 15 2015 Martin Gansser - 1.11.1-5 -- dropped Py2 package, because Py2 support ends in a few months -- cleanup spec file -- renamed package to python3-livestreamer - -* Fri Feb 13 2015 Martin Gansser - 1.11.1-4 -- Dropped CFLAGS for noarch package -- Dropped BR in subpackage python3-livestreamer due redundancy -- Removed bundled livestreamer.egg-info -- Added R python3-requests -- Generate man page and html documentation -- Added BR python-sphinx -- Added plugins-hitbox-Refactor-to-use-the-StreamMapper.patch - -* Thu Feb 12 2015 Martin Gansser - 1.11.1-3 -- Added BR python-futures -- Added BR python-requests -- Added BR python-singledispatch -- Added BR python3-requests to subpackage python3-livestreamer -- Added R fontawesome-fonts to subpackage python3-livestreamer - -* Tue Feb 10 2015 Martin Gansser - 1.11.1-2 -- Removed bundled fonts -- Added fontawesome-fonts requires. - -* Sat Feb 07 2015 Martin Gansser - 1.11.1-1 -- Initial package for fc21 diff --git a/plugins-hitbox-Refactor-to-use-the-StreamMapper.patch b/plugins-hitbox-Refactor-to-use-the-StreamMapper.patch deleted file mode 100644 index 8216cf3..0000000 --- a/plugins-hitbox-Refactor-to-use-the-StreamMapper.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 3cd7f604b9f3327f7626b719a3035c47a68ea9a2 Mon Sep 17 00:00:00 2001 -From: Christopher Rosell -Date: Tue, 16 Dec 2014 23:03:17 +0100 -Subject: [PATCH] plugins.hitbox: Refactor to use the StreamMapper. - -Also add support for HLS streams. - -Resolves #648. ---- - src/livestreamer/plugins/hitbox.py | 139 ++++++++++++++++++++++++------------- - 1 file changed, 92 insertions(+), 47 deletions(-) - -diff --git a/src/livestreamer/plugins/hitbox.py b/src/livestreamer/plugins/hitbox.py -index 306a318..556a3d9 100644 ---- a/src/livestreamer/plugins/hitbox.py -+++ b/src/livestreamer/plugins/hitbox.py -@@ -1,10 +1,13 @@ - import re - -+from itertools import chain -+ - from livestreamer.compat import urlparse - from livestreamer.plugin import Plugin --from livestreamer.plugin.api import http, validate -+from livestreamer.plugin.api import StreamMapper, http, validate - from livestreamer.stream import HLSStream, HTTPStream, RTMPStream - -+HLS_PLAYLIST_BASE = "http://www.hitbox.tv{0}" - LIVE_API = "http://www.hitbox.tv/api/media/live/{0}?showHidden=true" - PLAYER_API = "http://www.hitbox.tv/api/player/config/{0}/{1}?embed=false&showHidden=true" - SWF_BASE = "http://edge.vie.hitbox.tv/static/player/flowplayer/" -@@ -43,7 +46,7 @@ - validate.filter(lambda b: b.get("url") and b.get("label")), - [{ - "label": validate.text, -- "url": validate.text -+ "url": validate.text, - }], - ) - }, -@@ -52,15 +55,20 @@ - validate.optional("netConnectionUrl"): validate.text, - validate.optional("bitrates"): [{ - "label": validate.text, -- "url": validate.text -+ "url": validate.text, -+ "provider": validate.text - }] - }], -- "plugins": { -- validate.optional("clustering"): { -- "netConnectionUrl": validate.text, -- "url": validate.text -+ "plugins": validate.all( -+ dict, -+ validate.filter(lambda k, v: k in ["rtmp", "rtmpHitbox", "hls"]), -+ { -+ validate.text: { -+ validate.optional("netConnectionUrl"): validate.text, -+ "url": validate.text -+ } - } -- } -+ ) - } - ) - -@@ -77,6 +85,79 @@ def _get_quality(self, label): - - return "live" - -+ def _create_hls_streams(self, bitrate): -+ url = bitrate["url"] -+ quality = self._get_quality(bitrate["label"]) -+ -+ if not url.startswith("http"): -+ url = HLS_PLAYLIST_BASE.format(url) -+ -+ if bitrate["label"] == "Auto": -+ try: -+ streams = HLSStream.parse_variant_playlist(self.session, url) -+ return streams.items() -+ except IOError as err: -+ self.logger.warning("Failed to extract HLS streams: {0}", err) -+ else: -+ return quality, HLSStream(self.session, url) -+ -+ def _create_rtmp_stream(self, rtmp, swf_url, bitrate): -+ quality = self._get_quality(bitrate["label"]) -+ url = bitrate["url"] -+ stream = RTMPStream(self.session, { -+ "rtmp": rtmp, -+ "pageUrl": self.url, -+ "playpath": url, -+ "swfVfy": swf_url, -+ "live": True -+ }) -+ -+ return quality, stream -+ -+ def _get_live_streams(self, player): -+ mappers = [] -+ swf_url = SWF_URL -+ for playlist in player.get("playlist", []): -+ bitrates = playlist.get("bitrates") -+ provider = playlist.get("connectionProvider") -+ rtmp = None -+ -+ if bitrates: -+ rtmp = playlist.get("netConnectionUrl") -+ elif provider and provider in player["plugins"]: -+ provider = player["plugins"][provider] -+ swf_name = provider["url"] -+ swf_url = SWF_BASE + swf_name -+ rtmp = provider["netConnectionUrl"] -+ bitrates = player["clip"]["bitrates"] -+ else: -+ continue -+ -+ mapper = StreamMapper( -+ cmp=lambda provider, bitrate: bitrate["provider"].startswith(provider) -+ ) -+ mapper.map("hls", self._create_hls_streams) -+ mapper.map("rtmp", self._create_rtmp_stream, rtmp, swf_url) -+ mappers.append(mapper(bitrates)) -+ -+ return chain.from_iterable(mappers) -+ -+ def _create_video_stream(self, cls, base_url, bitrate): -+ url = base_url + "/" + bitrate["url"] -+ quality = self._get_quality(bitrate["label"]) -+ return quality, cls(self.session, url) -+ -+ def _get_video_streams(self, player): -+ base_url = player["clip"]["baseUrl"] or VOD_BASE_URL -+ mapper = StreamMapper( -+ cmp=lambda ext, bitrate: urlparse(bitrate["url"]).path.endswith(ext) -+ ) -+ mapper.map(".m3u8", self._create_video_stream, HLSStream, base_url) -+ mapper.map(".mp4", self._create_video_stream, HTTPStream, base_url) -+ mapper.map(".flv", self._create_video_stream, HTTPStream, base_url) -+ -+ return mapper(player["clip"]["bitrates"]) -+ - def _get_streams(self): - match = _url_re.match(self.url) - if not match: -@@ -96,46 +177,10 @@ def _get_streams(self): - - res = http.get(PLAYER_API.format(media_type, media_id)) - player = http.json(res, schema=_player_schema) -+ - if media_type == "live": -- swf_url = SWF_URL -- for playlist in player.get("playlist", []): -- bitrates = playlist.get("bitrates") -- provider = playlist.get("connectionProvider") -- rtmp = None -- -- if bitrates: -- rtmp = playlist.get("netConnectionUrl") -- elif provider and provider in player["plugins"]: -- provider = player["plugins"][provider] -- swf_name = provider["url"] -- swf_url = SWF_BASE + swf_name -- rtmp = provider["netConnectionUrl"] -- bitrates = player["clip"]["bitrates"] -- else: -- continue -- -- for bitrate in bitrates: -- quality = self._get_quality(bitrate["label"]) -- url = bitrate["url"] -- stream = RTMPStream(self.session, { -- "rtmp": rtmp, -- "pageUrl": self.url, -- "playpath": url, -- "swfVfy": swf_url, -- "live": True -- }) -- yield quality, stream -+ return self._get_live_streams(player) - else: -- base_url = player["clip"]["baseUrl"] or VOD_BASE_URL -- for bitrate in player["clip"]["bitrates"]: -- url = base_url + "/" + bitrate["url"] -- quality = self._get_quality(bitrate["label"]) -- -- if urlparse(url).path.endswith("m3u8"): -- stream = HLSStream(self.session, url) -- else: -- stream = HTTPStream(self.session, url) -- -- yield quality, stream -+ return self._get_video_streams(player) - - __plugin__ = Hitbox diff --git a/sources b/sources deleted file mode 100644 index 8a65adc..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -63fb477bb3e28b7fe26b3cbba6f7937c livestreamer-1.12.2.tar.gz