sebw / ulauncher-shaarli

Ulauncher extension to search in your Shaarli bookmarks
2 stars 0 forks source link

Doesn't work on a Yunohost instance #1

Open bytersproblem opened 2 years ago

bytersproblem commented 2 years ago

I have Shaarli on a Yunohost setup. But, it does not show the result of the query. I checked the logs, here is what outputs:

2021-09-22 16:52:21,348 | DEBUG | ulauncher.ui.windows.UlauncherWindow: show_results() | render 1 results
2021-09-22 16:52:22,466 | DEBUG | ulauncher.ui.windows.UlauncherWindow: show_results() | render 1 results
2021-09-22 16:52:23,155 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.sebw.ulauncher-shaarli"
2021-09-22 16:52:25,926 | DEBUG | ulauncher.ui.windows.UlauncherWindow: show_results() | render 1 results
2021-09-22 16:52:26,642 | DEBUG | ulauncher.ui.windows.UlauncherWindow: show_results() | render 1 results
2021-09-22 16:52:27,333 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.sebw.ulauncher-shaarli"
bytersproblem commented 2 years ago

I dug up some more logs. Here's what it says:

2021-09-24 20:25:50,001 | DEBUG | ulauncher.api.server.ExtensionController: _send_event() | Send event KeywordQueryEvent to "com.github.sebw.ulauncher-shaarli"
com.github.sebw.ulauncher-shaarli | 2021-09-24 20:25:50,035 | DEBUG | ulauncher.api.client.Client: on_message() | Incoming event KeywordQueryEvent
com.github.sebw.ulauncher-shaarli | 2021-09-24 20:25:50,036 | INFO | __main__: on_event() | preferences {"demo_kw": "shaarli", "setting_url": "https://shaarli.host.com/shaarli/", "setting_api": "f9157c1a4c94", "setting_limit": "10"}
com.github.sebw.ulauncher-shaarli | 2021-09-24 20:25:50,046 | DEBUG | urllib3.connectionpool: _new_conn() | Starting new HTTPS connection (1): shaarli.host.com:443
com.github.sebw.ulauncher-shaarli | 2021-09-24 20:25:50,216 | DEBUG | urllib3.connectionpool: _make_request() | https://shaarli.host.com:443 "GET /shaarli/api/v1/links?limit=10 HTTP/1.1" 401 16
sebw commented 2 years ago

This extension relies on the shaarli-client library. You seem to get a 401. Is the API token valid?

Can you run and check if the following works in a python console?

import shaarli_client.client as c                                                 
response = c.ShaarliV1Client("https://your/shaarli","your-api-token")          
answer = response.get_links({'searchtags': "a-tag-in-your-shaarli", 'limit': "1"})                
answer.text                                                                       

Thanks!