Repository: streamlink/streamlink
Pull request #2889 (2020-04-12 07:13:48)

AUTHORS: removed unused script and removed outdated list
Removed the list because it is **totally outdated**,
if someone wants to search the Authors list for whatever reason just use the git command.

closes https://github.com/streamlink/streamlink/issues/2175

codecov[bot]: # [Codecov](https://codecov.io/gh/streamlink/streamlink/pull/2889?src=pr&el=h1) Report
> Merging [#2889](https://codecov.io/gh/streamlink/streamlink/pull/2889?src=pr&el=desc) into [master](https://codecov.io/gh/streamlink/streamlink/commit/2007b32102db68b738c655d382976e55d0d686c3&el=desc) will **not change** coverage by `%`.
> The diff coverage is `100.00%`.


```diff
@@           Coverage Diff           @@
##           master    #2889   +/-   ##
=======================================
  Coverage   52.68%   52.68%           
=======================================
  Files         250      250           
  Lines       15701    15701           
=======================================
  Hits         8272     8272           
  Misses       7429     7429           
```


Patch:
diff --git a/AUTHORS b/AUTHORS
index eecd5a16..4bb7afc6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,123 +1,5 @@
-This AUTHORS file is generated by ./script/authors.sh
-Thank you to everyone whom has contributed to streamlink / livestreamer.
+Thank you to everyone who has contributed to streamlink / livestreamer.
 
-
-433
-Agustin Carrasco
-Alan Love
-Alexander
-Andreas Streichardt
-Andrew Bashore
-Andy Mikhailenko
-Anton
-Athanasios Oikonomou
-Benedikt Gollatz
-Benoit Dien
-blxd
-Brainzyy
-Brian Callahan
-btimo
-Charlie Drage
-Charmander
-che
-Christopher Rosell
-Chris-Werner Reimer
-chvrn
-CommanderRoot
-Damien D Jones
-Damien Jones
-Daniel Meißner
-Daniel Miranda
-Daniel Wallace
-David Arvelo
-Dominik Dabrowski
-Dominik Sokal
-dotsam
-e00E
-Ed Holohan
-Emil Stahl
-Erik G
-Ethan Jones
-fat deer
-Fat Deer
-fcicq
-Forrest
-Forrest Alvarez
-frontendloader
-Gapato
-Gaspard Jankowiak
-Gijs
-Guillaume Depardon
-hannespetur
-int3l
-intact
-Jaime Marquínez Ferrándiz
-Jan Tore Morken
-Javier Cantero
-JaxxC
-Jeremy Symon
-jkieberk
-John Peterson
-John S. Peterson
-Jon Bergli Heier
-Joseph Glanville
-Julian
-Kacper Michajłow
-Kari Hänninen
-kasper93
-kviktor
-livescope
-liz1rgin
-mammothb
-maop
-Marcus Soll
-Martin Panter
-MasterofJOKers
-Mateusz Starzak
-Max Nordlund
-medina
-Michael Cheah
-Michael Copland
-Michael Hoang
-Michiel
-mindhalt
-MonkeyPhysics
-Moritz Blanke
-neutric
-Niall McAndrew
-Niels Kräupl
-nitpicker
-nixx quality
-oyvindln
-papplampe
-Pascal Romahn
-Paul LaMendola
-Pavlos Touboulidis
-ph0o
-pulviscriptor
-Raziel-23
-Robin Schroer
-Ryan Braganza
-Seth Creech
-Simon Bernier St-Pierre
-Stefan
-Stefan Breunig
-steven7851
-Suhail Patel
-Summon528
-SUNAGA Takahiro
-Swirt
-t0mm0
-Tang
-termac
-ToadKing
-Toad King
-trocknet
-undido
-Vitaly Evtushenko
-Warnar Boekkooi
-WeinerRinkler
-whizzoo
-wolftankk
-wormeyman
-yeeeargh
+For a list of contributors, see
+https://github.com/streamlink/streamlink/graphs/contributors
+or use the command `git log --format='%aN' | sort -uf`
diff --git a/docs/plugin_matrix.rst b/docs/plugin_matrix.rst
index 53f543bd..e33c51bc 100644
--- a/docs/plugin_matrix.rst
+++ b/docs/plugin_matrix.rst
@@ -299,6 +299,7 @@ zattoo                  - zattoo.com         Yes   Yes
                         - www.vtxtv.ch
                         - www.1und1.tv
 zdf_mediathek           zdf.de               Yes   Yes   Streams may be geo-restricted to Germany.
+zeenews                 zeenews.india.com    Yes   No
 zengatv                 zengatv.com          Yes   No
 zhanqi                  zhanqi.tv            Yes   No
 ======================= ==================== ===== ===== ===========================
diff --git a/script/authors.sh b/script/authors.sh
deleted file mode 100755
index 61c6eb93..00000000
--- a/script/authors.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-# This file fill generate and output all authors whom have contributed to the project
-# to the root dir AUTHORS file.
-
-if [ ! -f AUTHORS ]; then
-  echo "AUTHORS file not found. Are you not in the root directory?"
-else
-  echo -e "This AUTHORS file is generated by ./script/authors.sh\nThank you to everyone whom has contributed to streamlink / livestreamer.\n\n" > AUTHORS
-  git log --format='%aN' | sort -u >> AUTHORS
-fi
diff --git a/src/streamlink/__init__.py b/src/streamlink/__init__.py
index 85f2f474..4bd18592 100644
--- a/src/streamlink/__init__.py
+++ b/src/streamlink/__init__.py
@@ -16,59 +16,7 @@ __title__ = "streamlink"
 __license__ = "Simplified BSD"
 __author__ = "Streamlink"
 __copyright__ = "Copyright 2020 Streamlink"
-__credits__ = [
-    "Agustín Carrasco (@asermax)",
-    "Andrew Bashore (@bashtech)",
-    "Andy Mikhailenko (@neithere)",
-    "Athanasios Oikonomou (@athoik)",
-    "Brian Callahan (@ibara)",
-    "Che (@chhe)",
-    "Christopher Rosell (@streamlink)",
-    "Daniel Meißner (@meise)",
-    "Daniel Miranda (@danielkza)",
-    "Daniel Wallace (@gtmanfred)",
-    "David Arvelo (@darvelo)",
-    "Dominik Dabrowski (@doda)",
-    "Erik G (@tboss)",
-    "Eric J (@wormeyman)",
-    "Ethan Jones (@jonesz)",
-    "Gaspard Jankowiak (@gapato)",
-    "Jaime Marquínez Ferrándiz (@jaimeMF)",
-    "Jan Tore Morken (@jantore)",
-    "John Peterson (@john-peterson)",
-    "Jon Bergli Heier (@sn4kebite)",
-    "Joseph Glanville (@josephglanville)",
-    "Julian Richen (@FireDart)",
-    "Kacper (@kasper93)",
-    "Martin Panter (@vadmium)",
-    "Max Nordlund (@maxnordlund)",
-    "Michael Cheah (@cheah)",
-    "Moritz Blanke",
-    "Niall McAndrew (@niallm90)",
-    "Niels Kräupl (@Gamewalker)",
-    "Pascal Romahn (@skulblakka)",
-    "Sam Edwards (@dotsam)",
-    "Stefan Breunig (@breunigs)",
-    "Suhail Patel (@suhailpatel)",
-    "Sunaga Takahiro (@sunaga720)",
-    "Vitaly Evtushenko (@eltiren)",
-    "Warnar Boekkooi (@boekkooi)",
-    "@blxd",
-    "@btiom",
-    "@daslicious",
-    "@MasterofJOKers",
-    "@mammothb",
-    "@medina",
-    "@monkeyphysics",
-    "@nixxquality",
-    "@papplampe",
-    "@Raziel-23",
-    "@t0mm0",
-    "@ToadKing",
-    "@unintended",
-    "@wolftankk",
-    "@yeeeargh"
-]
+__credits__ = ["https://github.com/streamlink/streamlink/blob/master/AUTHORS"]
 
 from .api import streams
 from .exceptions import (StreamlinkError, PluginError, NoStreamsError,
diff --git a/src/streamlink/plugins/zattoo.py b/src/streamlink/plugins/zattoo.py
index e04be31b..56404b2e 100644
--- a/src/streamlink/plugins/zattoo.py
+++ b/src/streamlink/plugins/zattoo.py
@@ -50,7 +50,7 @@ class Zattoo(Plugin):
         )/
         (?:
             (?:
-                recordings\?recording=
+                recording(?:s\?recording=|/)
                 |
                 (?:ondemand/)?(?:watch/(?:[^/\s]+)(?:/[^/]+/))
             )(?P<recording_id>\d+)
@@ -155,7 +155,11 @@ class Zattoo(Plugin):
 
         # a new session is required for the app_token
         self.session.http.cookies = cookiejar_from_dict({})
-        res = self.session.http.get(self.base_url)
+        if self.base_url == 'https://zattoo.com':
+            app_token_url = 'https://zattoo.com/int/'
+        else:
+            app_token_url = self.base_url
+        res = self.session.http.get(app_token_url)
         match = self._app_token_re.search(res.text)
 
         app_token = match.group(1)
diff --git a/src/streamlink/plugins/zeenews.py b/src/streamlink/plugins/zeenews.py
new file mode 100644
index 00000000..30acd425
--- /dev/null
+++ b/src/streamlink/plugins/zeenews.py
@@ -0,0 +1,31 @@
+import logging
+import re
+
+from streamlink.plugin import Plugin
+from streamlink.stream import HLSStream
+
+log = logging.getLogger(__name__)
+
+
+class ZeeNews(Plugin):
+    _url_re = re.compile(r'https?://zeenews\.india\.com/live-tv')
+
+    HLS_URL = 'https://z5ams.akamaized.net/zeenews/index.m3u8{0}'
+    TOKEN_URL = 'https://useraction.zee5.com/token/live.php'
+
+    @classmethod
+    def can_handle_url(cls, url):
+        return cls._url_re.match(url) is not None
+
+    def get_title(self):
+        return 'Zee News'
+
+    def _get_streams(self):
+        res = self.session.http.get(self.TOKEN_URL)
+        token = self.session.http.json(res)['video_token']
+        log.debug('video_token: {0}'.format(token))
+        for s in HLSStream.parse_variant_playlist(self.session, self.HLS_URL.format(token)).items():
+            yield s
+
+
+__plugin__ = ZeeNews


Test patch:
diff --git a/tests/plugins/test_zattoo.py b/tests/plugins/test_zattoo.py
index fe0adbab..2af55783 100644
--- a/tests/plugins/test_zattoo.py
+++ b/tests/plugins/test_zattoo.py
@@ -39,15 +39,17 @@ class TestPluginZattoo(unittest.TestCase):
             "https://zattoo.com/ondemand/watch/srf_zwei/110223896-die-schweizermacher/52845783/1455130800000"
             + "/1455137700000/6900000",
             "https://zattoo.com/watch/tve/130920738-viaje-al-centro-de-la-tele/96847859/1508777100000/1508779800000/0",
+            "https://zattoo.com/recording/193074536",
             "https://zattoo.com/recordings?recording=186466965"
         ]
         for url in should_match:
-            self.assertTrue(Zattoo.can_handle_url(url))
+            self.assertTrue(Zattoo.can_handle_url(url), url)
 
+    def test_can_handle_url_negative(self):
         should_not_match = [
             "https://ewe.de",
             "https://netcologne.de",
             "https://zattoo.com"
         ]
         for url in should_not_match:
-            self.assertFalse(Zattoo.can_handle_url(url))
+            self.assertFalse(Zattoo.can_handle_url(url), url)
diff --git a/tests/plugins/test_zeenews.py b/tests/plugins/test_zeenews.py
new file mode 100644
index 00000000..66c411bd
--- /dev/null
+++ b/tests/plugins/test_zeenews.py
@@ -0,0 +1,20 @@
+import unittest
+
+from streamlink.plugins.zeenews import ZeeNews
+
+
+class TestPluginZeeNews(unittest.TestCase):
+    def test_can_handle_url(self):
+        should_match = [
+            'https://zeenews.india.com/live-tv',
+            'https://zeenews.india.com/live-tv/embed',
+        ]
+        for url in should_match:
+            self.assertTrue(ZeeNews.can_handle_url(url), url)
+
+    def test_can_handle_url_negative(self):
+        should_not_match = [
+            'https://example.com/index.html',
+        ]
+        for url in should_not_match:
+            self.assertFalse(ZeeNews.can_handle_url(url), url)