mariano-git / plugin.video.flow

Personal Flow plugin for KODI :argentina:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error de login (UNAUTHORIZED)

MaxiReggi opened this issue · comments

Hola Mariano! Cómo estás?

Una consulta, volví a instalar el plugin en LibreElec (siempre lo tuve instalado en OSMC), para ver si el tema del buffering y cortes que tengo se deba al sistema operativo en sí y no a Kodi.
El problema es que ahora, luego de instalar el plugin de cero y todo el tema en LibreElec, no me deja loguearme. Sabrás qué podrá ser?
En el log veo "unauthorized", así que al parecer me está denegando el acceso. La cuenta es de mi mamá y hace poco ella cambió la contraseña, pero actualmente desde cualquier dispositivo uso la nueva clave y se loguea perfectamente, por ende no sé qué podrá ser.
Lo único extraño es que en el último mes, luego de que mi mamá cambió la clave, en OSMC me tiraba un error de la app al iniciar Kodi (el pop-up que sale arriba a la derecha cuando hay algún error), que nunca vi en el log de qué se trataba (quizás era el mismo de logueo que me está tirando ahora) pero los canales andaban bien y podía usar la app.

¿Será que me pudieron haber baneado al detectar que estaba usando la aplicación en Kodi? El tema es que me deberían haber negado el acceso por MAC, ya que la IP es la misma, todos mis equipos salen con la misma IP Pública. Igualmente no sé si ésto es posible, seguramente vos sepas.

Te dejo el fragmento del log.
Muchísimas gracias desde ya!
Saludos!

2023-06-16 02:29:53.684 T:620 INFO : [plugin.video.flow v1] Starting Service...
2023-06-16 02:29:55.090 T:620 ERROR : [plugin.video.flow v1] ERROR: execute (174) - 401 Client Error: Unauthorized for url: https://web.flow.com.ar/auth/v2>
{'error': 'No Authorization was found in request.headers', 'statusMessage': 'No Authorization was found in request.h>
2023-06-16 02:29:55.099 T:620 ERROR : Traceback (most recent call last):

2023-06-16 02:29:55.099 T:620 ERROR :
2023-06-16 02:29:55.099 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 174, in execute
response.raise_for_status()

2023-06-16 02:29:55.099 T:620 ERROR :
2023-06-16 02:29:55.099 T:620 ERROR : File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)

2023-06-16 02:29:55.099 T:620 ERROR :
2023-06-16 02:29:55.100 T:620 ERROR : requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://web.flow.com.ar/auth/v2/device

2023-06-16 02:29:55.100 T:620 ERROR :
2023-06-16 02:29:55.100 T:620 ERROR : [plugin.video.flow v1] ERROR: execute (174) - 401 Client Error: Unauthorized for url: https://web.flow.com.ar/auth/v2>
Status.UNAUTHORIZED
2023-06-16 02:29:55.100 T:620 ERROR : Traceback (most recent call last):

2023-06-16 02:29:55.100 T:620 ERROR :
2023-06-16 02:29:55.101 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 174, in execute
response.raise_for_status()

2023-06-16 02:29:55.101 T:620 ERROR :
2023-06-16 02:29:55.101 T:620 ERROR : File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)

2023-06-16 02:29:55.101 T:620 ERROR :
2023-06-16 02:29:55.101 T:620 ERROR : requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://web.flow.com.ar/auth/v2/device

2023-06-16 02:29:55.101 T:620 ERROR :
2023-06-16 02:29:55.101 T:620 ERROR : [plugin.video.flow v1] ERROR: isJwtValid (292) - NotAuthorizedException: UNAUTHORIZED
2023-06-16 02:29:55.105 T:620 ERROR : Traceback (most recent call last):

2023-06-16 02:29:55.105 T:620 ERROR :
2023-06-16 02:29:55.105 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 174, in execute
response.raise_for_status()

2023-06-16 02:29:55.105 T:620 ERROR :
2023-06-16 02:29:55.105 T:620 ERROR : File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)

2023-06-16 02:29:55.105 T:620 ERROR :
2023-06-16 02:29:55.105 T:620 ERROR : requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://web.flow.com.ar/auth/v2/device

2023-06-16 02:29:55.105 T:620 ERROR :
2023-06-16 02:29:55.105 T:620 ERROR :
During handling of the above exception, another exception occurred:

2023-06-16 02:29:55.105 T:620 ERROR :
2023-06-16 02:29:55.105 T:620 ERROR : Traceback (most recent call last):

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:55.106 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/flow/client/flow_client.py", line 292, in isJwtValid
check = self.authApi.device()

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:55.106 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/init.py", line 24, in wrapper
return piggyInvoker.execute(api=self.resource.name, call=func, kwargs=kwargs)

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:55.106 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 202, in execute
self.handleError(errh)

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:55.106 T:620 ERROR : File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 129, in handleError
raise NotAuthorizedException(message=status.name, cause=cause, response=rsResponse)

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:55.106 T:620 ERROR : ext.ws.rs.NotAuthorizedException: UNAUTHORIZED

2023-06-16 02:29:55.106 T:620 ERROR :
2023-06-16 02:29:56.563 T:620 ERROR : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'requests.exceptions.JSONDecodeError'>
Error Contents: [Errno Expecting value] : 0
Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 174, in execute
response.raise_for_status()
File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 509 Server Error: Unknown Code for url: https://web.flow.com.ar/auth/v2/provision/login

                                               During handling of the above exception, another exception occurred:

                                               Traceback (most recent call last):
                                                 File "/usr/lib/python3.8/site-packages/simplejson/scanner.py", line 37, in _scan_once
                                               IndexError: string index out of range

                                               During handling of the above exception, another exception occurred:

                                               Traceback (most recent call last):
                                                 File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 910, in json
                                                   return complexjson.loads(self.text, **kwargs)
                                                 File "/usr/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
                                                 File "/usr/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
                                                 File "/usr/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
                                                 File "/usr/lib/python3.8/site-packages/simplejson/scanner.py", line 79, in scan_once
                                                 File "/usr/lib/python3.8/site-packages/simplejson/scanner.py", line 39, in _scan_once
                                               simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

                                               During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/storage/.kodi/addons/plugin.video.flow/service.py", line 149, in
currentStep = currentStep.invoke()
File "/storage/.kodi/addons/plugin.video.flow/service.py", line 76, in invoke
isValid = apiDriver.doLogin()
File "/storage/.kodi/addons/plugin.video.flow/flow/client/flow_client.py", line 333, in doLogin
response: LoginResponse = self.authApi.login(loginData=loginData)
File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/init.py", line 24, in wrapper
return piggyInvoker.execute(api=self.resource.name, call=func, kwargs=kwargs)
File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 202, in execute
self.handleError(errh)
File "/storage/.kodi/addons/plugin.video.flow/ext/piggy_rs/invoker.py", line 120, in handleError
Logger.log_error(f"{cause} \n {cause.response.json()}")
File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 917, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] : 0
-->End of Python script error report<--

2023-06-16 02:29:56.915 T:620 INFO : Python interpreter stopped

Hola @mariano-git!

Estuve viendo un poco el error, será que ahora están recibiendo el authorization token en los headers y antes no? Quizás agregando eso al código se solucione, no sé.

Haciendo la prueba con el browser hace un rato en Linux vi que mandaba el authorization en el login request. Ahora no lo veo en el login request, pero sí lo veo en cachetoken. Te mando un print de pantalla:

image

Saludos y gracias!

@MaxiReggi
Creo que este es el problema.
#15 (comment)

Yo estoy teniendo el mismo problema

Hola @MaxiReggi @MarcoMiretti Pronto volvemos!!!

image