Instinctlol / automatic-twitch-recorder

Checks if a user on twitch is currently streaming and then records the stream via streamlink
187 stars 40 forks source link

Auth Problem? #32

Closed Aerodymeus closed 3 years ago

Aerodymeus commented 3 years ago

Hey there, got a problem with using this tool, tried to find with googling around for this issue, but somehow nothing works? Tried it on a Raspi4 and Debian Buster Server now, ending both in this problem that they call the Authentication Error when i use it. Using streamlink in standalone streamlink USERNAME best works fine right away.

But using this tool it throws out this:

(Cmd) add thiseguy Successfully added thiseguy to watchlist. (Cmd) start Daemon is started. Will check every 30 seconds. (Cmd) exception calling callback for <Future at 0x7f302cd20240 state=finished raised PluginError> Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/streamlink/plugin/api/http_session.py", line 166, in request res.raise_for_status() File "/usr/local/lib/python3.7/dist-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://api.twitch.tv/api/channels/thiseguy/access_token.json?as3=t&platform=_

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/concurrent/futures/_base.py", line 324, in _invoke_callbacks callback(self) File "/home/automatic-twitch-recorder/daemon.py", line 128, in _watcher_callback streamer_dict = returned_watcher.result() File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result return self.get_result() File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in get_result raise self._exception File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/home/automatic-twitch-recorder/watcher.py", line 37, in watch streams = streamlink.streams(self.streamer_dict['stream_info']['channel']['url']) File "/usr/local/lib/python3.7/dist-packages/streamlink/api.py", line 13, in streams return session.streams(url, params) File "/usr/local/lib/python3.7/dist-packages/streamlink/session.py", line 439, in streams return plugin.streams(params) File "/usr/local/lib/python3.7/dist-packages/streamlink/plugin/plugin.py", line 317, in streams ostreams = self._get_streams() File "/usr/local/lib/python3.7/dist-packages/streamlink/plugins/twitch.py", line 774, in _get_streams return self._get_hls_streams("live") File "/usr/local/lib/python3.7/dist-packages/streamlink/plugins/twitch.py", line 714, in _get_hls_streams sig, token = self._access_token(stream_type) File "/usr/local/lib/python3.7/dist-packages/streamlink/plugins/twitch.py", line 678, in _access_token schema=_access_token_schema) File "/usr/local/lib/python3.7/dist-packages/streamlink/plugins/twitch.py", line 308, in access_token return self.call("/api/{0}/{1}/access_token".format(endpoint, asset), dict(platform="_", params)) File "/usr/local/lib/python3.7/dist-packages/streamlink/plugins/twitch.py", line 271, in call res = self.session.http.get(url, params=params, headers=headers) File "/usr/local/lib/python3.7/dist-packages/requests/sessions.py", line 546, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python3.7/dist-packages/streamlink/plugin/api/http_session.py", line 175, in request raise err streamlink.exceptions.PluginError: Unable to open URL: https://api.twitch.tv/api/channels/thiseguy/access_token.json (410 Client Error: Gone for url: https://api.twitch.tv/api/channels/thiseguy/access_token.json?as3=t&platform=_)

Instinctlol commented 3 years ago

Have you tried bumping up the streamlink version to e.g. 1.7.0, which is the newest version atm?

You can do so in requirements.txt

You could also wait until a newer version than 1.7.0 is released, because currently, streamlink won't work well with this script anyway.

Aerodymeus commented 3 years ago

Well only thing i tried was installing it it apt -t buster-backports install streamlink where it seems it pulled the 1.7.0 Veriosn, but i can try to bump it in the txt as well.

i am just a tad confused that this script needs all the auth stuff when streamlink works standalone fine.

Aerodymeus commented 3 years ago

Oh, it worked with changing the version number in the requirements.txt or either it was by reinstalling streamlink with pip3 install streamlink

Thanks!