Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching using search template within skin not working #1099

Open
bloodhand1990 opened this issue Feb 3, 2025 · 6 comments
Open

Searching using search template within skin not working #1099

bloodhand1990 opened this issue Feb 3, 2025 · 6 comments

Comments

@bloodhand1990
Copy link

bloodhand1990 commented Feb 3, 2025

I am trying to search for Movies/TV Shows using a search template within Arctic Horizon 2 skin:
plugin://plugin.video.elementum/movies/search?q=
plugin://plugin.video.elementum/shows/search?q=

But when I do that with typing a query containing more than one word (example: "the godfather"), I get the following error "URL can't contain control characters" - /movies/search?q=the godfather. This happens because the typed space doesn't get converted to "+".

If I try to add a template of Elementum search to the skin with a predefined search term/query, conversion of space to "+" happens automatically. Using other search templates works as well (example: TMDb, YouTube - typed space gets coverted to "+" in the final search url).

Is this an issue of Elementum or do I have to use another (special) search URL or is this an issue of the skin self?

Thanks.

@antonsoroko
Copy link

@bloodhand1990

I get the following error "URL can't contain control characters"

you get error from what exactly? from Kodi or from skin or from elementum?

also would be useful to see the log at the moment of that error. https://elementum.surge.sh/contribute/log/

i guess that such conversion (" "=>"+") should be done by skin, but hard to say without details.

@antonsoroko
Copy link

antonsoroko commented Feb 6, 2025

@bloodhand1990 so i found the issue. skin gives text with spaces and then python part of elementum sends data to golang part of elementum via http request, and URL can't have spaces, thus it fails. internally elementum always uses encoded text so we never have seen this issue.

you can take fixed file
https://github.com/antonsoroko/plugin.video.elementum/blob/encode-incoming-addon-url/resources/site-packages/elementum/navigation.py
and replace .kodi/addons/plugin.video.elementum/resources/site-packages/elementum/navigation.py file.

then please test all functions of elementum to see if this fix did not break something else.

you can see the content of the fix in https://github.com/elgatito/plugin.video.elementum/pull/1100/files

@patkino it is been a long time since your post in jurialmunkey/skin.arctic.horizon.2#1014 (comment) (i found it while debugging this issue) but maybe you also will find this fix useful since it also fixes issue with non-latin letters - Cyrillic works now.

i am not sure how popular this "search" feature in skins, i see it for the first time. but i guess this fix will not hurt elementum.

@bloodhand1990
Copy link
Author

bloodhand1990 commented Feb 6, 2025

I tried it and it works succesfully. I am deeply grateful for this fix! My many thanks for this! If I encounter other issues, I will let you know. After this one, I now fixed all my issues with my TV box media player.

Maybe it's not so popular because many users use Debrid-based services' addons and not Elementum directly. I added widgets and shortcuts directly pointing to Elementum's lists and only use the TMDb-based interface for the good look of it and for getting details about titles.

Another user (@algoldbe) mentioned this issue on the github page from Arctic Horizon 2 skin some 6 years ago, maybe mentioning this will also help others as well: jurialmunkey/skin.arctic.horizon.2#1014 (comment)

You've done a more than great work with this plugin guys. Long live Elementum!

@bloodhand1990
Copy link
Author

bloodhand1990 commented Feb 6, 2025

One update: I tried searching something like "don't breathe" and I get no results. Did your fix had to do only with spaces? Or do I have to search in another manner?

Later edit: I tried with "dont breathe" and it works perfectly!

@antonsoroko
Copy link

@bloodhand1990 fix does so called URL encoding for the input string - so all "bad" symbols will be properly encoded.

and it works for me with ', see:

Image

@bloodhand1990
Copy link
Author

I tried again now and it works for me, too. I guess I messed myself something up, been a few reboots since then, now working perfectly without issues. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants