From 20fe69719a6970a0785b76b324f0fcd7b7ec2988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9A=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D1=85?= Date: Sun, 12 Dec 2021 22:42:09 +0300 Subject: [PATCH] Update streamlink to 3.0.0 OAuth fork is not needed anymore because streamlink now supports custom HTTP headers for API requests. --- requirements.txt | 2 +- setup.py | 2 +- twitch_utils/record.py | 2 +- twitch_utils/twitch.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 07d64317..a75f93f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ requests python-dateutil -git+https://github.com/TheDrHax/streamlink.git@2.0.0-oauth +streamlink==3.0.3 docopt==0.6.2 praat-parselmouth==0.4.0 numpy<1.19.0,>=1.16.0 diff --git a/setup.py b/setup.py index 7b9438e7..5019410b 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ EXTRAS = { 'record': [ - 'streamlink>=2.4.0', + 'streamlink>=3.0.0', 'parse>=1.19.0' ], 'offset': [ diff --git a/twitch_utils/record.py b/twitch_utils/record.py index 21805add..32d85ab4 100755 --- a/twitch_utils/record.py +++ b/twitch_utils/record.py @@ -78,7 +78,7 @@ def _args(self) -> list: 'hls-segment-threads': self.threads} if self.oauth: - params['twitch-oauth-token'] = self.oauth + params['twitch-api-header'] = f'Authorization=OAuth {self.oauth}' if self.start > 0: params['hls-start-offset'] = math.floor(self.start) diff --git a/twitch_utils/twitch.py b/twitch_utils/twitch.py index 911f5fee..0d4c4f88 100644 --- a/twitch_utils/twitch.py +++ b/twitch_utils/twitch.py @@ -6,7 +6,7 @@ class TwitchAPI: def _session(token: str) -> Session: s = Session() s.headers['Client-ID'] = 'kimne78kx3ncx6brgo4mv6wki5h1ko' - s.headers['Authorization'] = f'Bearer {token}' + s.headers['Authorization'] = f'OAuth {token}' return s def __init__(self, oauth: str):