Garulf / Flow-Raindrop

Access Raindrop.io bookmarks with Flow Launcher/Wox
17 stars 1 forks source link

Extension no longer working #6

Closed emmanuelcandido closed 2 months ago

emmanuelcandido commented 3 months ago

I've tried reinstalling the extension, I've checked all the dependencies, I've changed and checked the API, I've checked that the information in the extension files is correct. The problem persists. The extension gives me the following error:


Flow Launcher version: 1.18.0
OS Version: 22631.3880
IntPtr Length: 8
x64: True

Python Path: C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Environments\Python\PythonEmbeddable-v3.11.4\pythonw.exe
Node Path: C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Environments\Node.js\Node-v16.18.0\node-v16.18.0-win-x64\node.exe
Date: 07/27/2024 09:35:41
Exception:
FlowRaindrop Exception: 
Websites: https://github.com/Garulf/flow-raindrop
Author: Garulf
Version: 1.0.0
Flow.Launcher.Core.ExternalPlugins.FlowPluginException: Traceback (most recent call last):
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\run.py", line 12, in <module>
    plugin.run()
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\plugin.py", line 74, in run
    feedback = self._event_handler(method, *parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\event.py", line 34, in __call__
    raise e
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\event.py", line 29, in __call__
    return self._methods[method](*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\plugin.py", line 39, in wrapper
    return method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\main.py", line 37, in query
    return send_results(
           ^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\result.py", line 74, in send_results
    return {'result': [result.as_dict() for result in results], 'SettingsChange': settings}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\result.py", line 74, in <listcomp>
    return {'result': [result.as_dict() for result in results], 'SettingsChange': settings}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\results.py", line 37, in query_results
    for item in search:
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 76, in search
    yield from self._search(search, collection)['items']
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 64, in _search
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 57, in _request
    response.raise_for_status()
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\httpx\_models.py", line 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://api.raindrop.io/rest/v1/raindrops/0?search=redd'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

 ---> System.IO.InvalidDataException: Traceback (most recent call last):
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\run.py", line 12, in <module>
    plugin.run()
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\plugin.py", line 74, in run
    feedback = self._event_handler(method, *parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\event.py", line 34, in __call__
    raise e
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\event.py", line 29, in __call__
    return self._methods[method](*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\plugin.py", line 39, in wrapper
    return method(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\main.py", line 37, in query
    return send_results(
           ^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\result.py", line 74, in send_results
    return {'result': [result.as_dict() for result in results], 'SettingsChange': settings}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\pyflowlauncher\result.py", line 74, in <listcomp>
    return {'result': [result.as_dict() for result in results], 'SettingsChange': settings}
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\results.py", line 37, in query_results
    for item in search:
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 76, in search
    yield from self._search(search, collection)['items']
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 64, in _search
    return self._request(
           ^^^^^^^^^^^^^^
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\plugin\raindrop.py", line 57, in _request
    response.raise_for_status()
  File "C:\Users\Emmanuel\AppData\Roaming\FlowLauncher\Plugins\FlowRaindrop-1.0.0\lib\httpx\_models.py", line 759, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://api.raindrop.io/rest/v1/raindrops/0?search=redd'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 243
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 248
   at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 261
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass23_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 196
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 34
   at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 195
   --- End of inner exception stack trace ---
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass23_1.<QueryForPluginAsync>b__1(ActionContext _) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 224
   at Flow.Launcher.Plugin.Result.ExecuteAsync(ActionContext context) in /_/Flow.Launcher.Plugin/Result.cs:line 246
   at Flow.Launcher.ViewModel.MainViewModel.OpenResultAsync(String index) in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 307
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Garulf commented 3 months ago

Hello @emmanuelcandido,

Thanks for reporting this issue to me. In your log I see all requests to raindrop are getting a code 401.

Code 401 is usually due to an authentication problem. Please make sure your credentials are correct.

emmanuelcandido commented 3 months ago

Hi @Garulf

So... What do you mean, incorrect credentials?

I'm connecting via API...

The only way I can see that this could be going wrong is when creating the API on the site. You haven't suggested a way of actually solving the problem. I think you could make the integration documentation clearer for non-developer users. But that's just a suggestion.

In any case, since the extension only asks for the API key, I believe I'm doing the process correctly, since that's the only information the extension asks for, and the only thing I might actually be doing wrong is creating the API through the website, but there's nothing documented so that I can identify how to solve it.

Garulf commented 3 months ago

@emmanuelcandido

I apologize I am not really a raindrop user, I was asked to make a raindrop plugin by a few users. You're correct I should have added more documentation as raindrop has multiple ways to register an app now.

Please follow these instructions and let me know if it works for you:

  1. Click on settings: image
  2. Navigate to "Integrations" image
  3. Create a new app image
  4. Name your app whatever you want it should not matter. (make sure to accept the terms and conditions). image
  5. Once created click on your app and it will display your api key to use. image
emmanuelcandido commented 3 months ago

First of all, thank you very much for your support.

This is exactly how I created the API. However, I put the client secret in the "API Token" field in the extension and I still have the same problem.

MohammadRRamis commented 2 months ago

In step 5 mentioned by @Garulf, create a test token and copy its value to the API Token field in Flow Launcher.

Hope this helps! @emmanuelcandido

emmanuelcandido commented 2 months ago

Hey @MohammadRRamis @Garulf,

That worked!

Thank you very much!