lekma / plugin.video.invidious

Invidious Addon for Kodi
GNU General Public License v3.0
50 stars 7 forks source link

Search has stopped working since last week #37

Closed pitsi closed 4 years ago

pitsi commented 4 years ago

As mentioned in the title, invidious has stopped returning search results since last week, maybe a bit more. Searching for a video, a channel or a playlist makes kodi's loading circle spin until I stop it with backspace. When it is stopped, these are written in the log

2020-07-15 10:52:27.331 T:139630142580480 WARNING: CWebServer[8080]: invalid response data with range start at 1 and end at 0
2020-07-15 10:52:27.366 T:139630159365888   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'iapc.RequestError'>
                                            Error Contents: remote traceback: unknown error
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 219, in <module>
                                                dispatch(*sys.argv)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 214, in dispatch
                                                Dispatcher(url, int(handle)).dispatch(**parseQuery(query))
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 208, in dispatch
                                                return action(**kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 32, in wrapper
                                                success = func(self, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 196, in search
                                                return self._search(q, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 162, in _search
                                                client.search(q, **kwargs), kwargs["type"], q=q, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/client.py", line 119, in search
                                                self.query_("search", q=q, page=page, **kwargs), limit=limit)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/client.py", line 40, in query_
                                                return self.client.query(key, *args, **kwargs) or self._defaults_.get(key, [])
                                              File "/storage/.kodi/addons/script.module.iapc/lib/iapc.py", line 195, in __call__
                                                return Request(self.sender).execute((self.name, args, kwargs))
                                              File "/storage/.kodi/addons/script.module.iapc/lib/iapc.py", line 174, in execute
                                                raise self.response
                                            RequestError: remote traceback: unknown error
                                            -->End of Python script error report<--
2020-07-15 10:52:27.377 T:139630062446336   ERROR: GetDirectory - Error getting plugin://plugin.video.invidious/?action=search&q=idies%20proseyxes&type=video
2020-07-15 10:52:27.383 T:139631551453312   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.invidious/?action=search&q=idies%20p

Libreelec 9.2.3 x64, kodi 18.7 and invidious 0.2.5. I have tried deleting ~/.kodi/userdata/addon_data/plugin.video.invidious so as to reset everything to defaults but still no luck. I found your addon some weeks ago after I dumped the official one for youtube due to api key issues and I ONLY use its search function, so I did not test anything else.

lekma commented 4 years ago

I think it's related to iv-org/invidious#1241. Did you try changing the invidious instance in the settings? At this very minute searching seem to be working with, for example, invidio.us or invidious.snopyta.org. Your log excerpt is missing the relevant part, so I can't tell which instance you're using (i.e. I can't test for myself).

pitsi commented 4 years ago

I changed the instance to yewtu.be and invidious.snopyta.org (not sure about the second one, mihgt be the other instance with "invidious" in its name) but nothing changed. It also did not work after resetting everything to defaults. If it helps, I use google's dns servers on every device on my home. Here is a fresh log, although the instance is not mentioned again. Its invidio.us anyway, the default one.

2020-07-20 09:59:30.298 T:140585872643840 WARNING: CWebServer[8080]: invalid response data with range start at 1 and end at 0
2020-07-20 09:59:48.322 T:140585437181696 WARNING: Previous line repeats 38 times.
2020-07-20 09:59:48.322 T:140585437181696   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'iapc.RequestError'>
                                            Error Contents: remote traceback: unknown error
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 219, in <module>
                                                dispatch(*sys.argv)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 214, in dispatch
                                                Dispatcher(url, int(handle)).dispatch(**parseQuery(query))
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 208, in dispatch
                                                return action(**kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 32, in wrapper
                                                success = func(self, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 196, in search
                                                return self._search(q, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 162, in _search
                                                client.search(q, **kwargs), kwargs["type"], q=q, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/client.py", line 119, in search
                                                self.query_("search", q=q, page=page, **kwargs), limit=limit)
                                              File "/storage/.kodi/addons/plugin.video.invidious/lib/client.py", line 40, in query_
                                                return self.client.query(key, *args, **kwargs) or self._defaults_.get(key, [])
                                              File "/storage/.kodi/addons/script.module.iapc/lib/iapc.py", line 195, in __call__
                                                return Request(self.sender).execute((self.name, args, kwargs))
                                              File "/storage/.kodi/addons/script.module.iapc/lib/iapc.py", line 174, in execute
                                                raise self.response
                                            RequestError: remote traceback: unknown error
                                            -->End of Python script error report<--
2020-07-20 09:59:48.330 T:140585872643840   ERROR: GetDirectory - Error getting plugin://plugin.video.invidious/?action=search&q=idies%20proseyxes&type=video
2020-07-20 09:59:48.337 T:140586792945792   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.invidious/?action=search&q=idies%20proseyxes&type=video) failed

I do not give full logs on my systems for privacy reasons, because they report every single thing I use on them.

pitsi commented 4 years ago

Here are the contents of .kodi/userdata/addon_data/plugin.video.invidious/settings.xml in case it helps

# cat .kodi/userdata/addon_data/plugin.video.invidious/settings.xml
<settings version="2">
    <setting id="autogenerated">false</setting>
    <setting id="clearAllSearchHistory" default="true"></setting>
    <setting id="feed">false</setting>
    <setting id="instance" default="true">invidio.us</setting>
    <setting id="path" default="true">api/v1</setting>
    <setting id="popular">false</setting>
    <setting id="removeChannelsFromFeed" default="true"></setting>
    <setting id="search_history">true</setting>
    <setting id="selectInstance" default="true"></setting>
    <setting id="ssl">true</setting>
    <setting id="top">false</setting>
    <setting id="trending">false</setting>
</settings>
lekma commented 4 years ago

I just tried your query with invidio.us and it works from here (it returns a greek music video by Anser, right?). This is the corresponding api request: https://invidio.us/api/v1/search?q=idies+proseyxes&type=video&page=1 Can you try to open this url in a browser on the same machine and see what happens?

It may be an encoding problem or a network/timeout problem or any other kind of problem. Also, I don't know much about libreelec, do they have the correct versions for all dependencies?

Anyway, I'm willing to help but as you can see I cannot do much but guess...

pitsi commented 4 years ago

I can't open the url on a browser on the same machine, because libreelec does not provide a web browser. Actually it does provide chrome on its x64 version only, but it is a pita to install, so I will try it later or tomorrow since you offered to help :)

The video is actually a greek music video from Anser and the request url does open as it should on my desktop pc in brave and chrome unstable. As for the dependencies that you mention, how can I check them? Is it enough if I provide the versions for all these

    <requires>
        <import addon="xbmc.python" version="2.26.0" />
        <import addon="script.module.six" version="1.11.0" />
        <import addon="script.module.kodi-six" version="0.1.2" />
        <import addon="script.module.requests" version="2.22.0" />
        <import addon="script.module.iapc" version="0.1.0" />
        <import addon="script.module.inputstreamhelper" version="0.4.3" />
        <import addon="plugin.video.youtube" version="6.8.0" optional="true" />
    </requires>
pitsi commented 4 years ago

Here goes xbmc.python = 2.26.0 (proof of kodi 18 obviously) script.module.six = 1.13.0 script.module.kodi-six = 0.1.3 script.module.requests = 2.22.0 script.module.iapc = 0.1.0 script.module.inputstreamhelper = 0.5.0 plugin.video.youtube = 6.8.2

---edit I also installed chrome in libreelec and the url does open as it should there.

lekma commented 4 years ago

I can't open the url on a browser on the same machine, because libreelec does not provide a web browser. Actually it does provide chrome on its x64 version only, but it is a pita to install, so I will try it later or tomorrow since you offered to help :)

you can always use curl (or wget) if you have a shell access: curl -fSsL https://invidio.us/api/v1/search?q=idies+proseyxes&type=video&page=1 or wget -q -O - https://invidio.us/api/v1/search?q=idies+proseyxes&type=video&page=1

The video is actually a greek music video from Anser

so the plugin is working correctly

As for the dependencies that you mention, how can I check them?

Settings > System > Add-ons > Manage dependencies (in Advanced or Expert mode)

pitsi commented 4 years ago

The dependencies are all there, both in the menu you mention and in .kodi/addons. The forementioned version numbers were all taken with cat .kodi/addons/plugin.video.youtube/addon.xml | grep version for the ones listed above as mandatory and optional. They are all on the minimum or newer version than the required one, so they should be no issue.

I am installing invidious on my main system now so as to check...

---edit

Preface: A lot of addons, e.g youtube, twitch etc, have a line similar to this one in their addon.xml <extension point="xbmc.service" library="lib/service.py" /> and that is what makes them run as "services" in the background. constantly. I find this behaviour compelely useless, especially for addons that have no need to check for content all the time, thus I made a small script that removes it from every single addon.xml

$ cat deathtoservices.sh 
#!/bin/bash
find ~/.kodi/addons/ -name "addon.xml" -exec sed -i '/xbmc.service/d' {} \;
# verify they are all gone
grep -rl "xbmc.service" ~/.kodi/addons/

And that was the issue with invidious! It worked as it should when I installed it on my main system (debian testing x64, kodi 18.7 etc), but showed the same symptoms when I removed that line and restarted kodi. I added it back and it worked. I now have to find a way to "whitelist" it and I am closing this since it was an issue on my side.