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

Problem with dir names in "Movies" #1644

Open
ims21 opened this issue Jan 25, 2025 · 2 comments
Open

Problem with dir names in "Movies" #1644

ims21 opened this issue Jan 25, 2025 · 2 comments
Labels
BUG 🐞 Not working as expected

Comments

@ims21
Copy link
Contributor

ims21 commented Jan 25, 2025

When directory on box is created with national char ... f.eg. "ádir", owif crashed in movies.py in def getMovieList(rargs=None, locations=None) when you in "Movies" try select this dir

` File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/ajax.py", line 192, in P_movies
movies = getMovieList(request.args)
File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/movies.py", line 127, in getMovieList
directory = getUrlArg2(rargs, "dirname")
File "/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/utilities.py", line 303, in getUrlArg2
return six.ensure_str(args[k][0])
File "/usr/lib/python3.9/site-packages/six.py", line 917, in ensure_str

builtins.UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 17: invalid continuation byte
`

This incomming wrong from enigma and should be fixed on e2 side or in Owif ?

@ims21 ims21 added the BUG 🐞 Not working as expected label Jan 25, 2025
@ims21
Copy link
Contributor Author

ims21 commented Jan 25, 2025

Problem is "áoř" ... "á" is incomming as lat1, "ř" is incomming in unicode:

({b'dirname': [b'/media/hdd/movie/\xe1o%u0159']})

@ims21
Copy link
Contributor Author

ims21 commented Jan 25, 2025

Temporary how fix, I didn't search further (but I don't want to use that).

import re
...
if b'dirname' in rargs:
	decoded_str = rargs[b'dirname'][0].decode('latin-1')
	decoded_str = re.sub(r'%u([0-9A-Fa-f]{4})', lambda m: chr(int(m.group(1), 16)), decoded_str)
	rargs[b'dirname'][0] = decoded_str.encode('utf-8')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG 🐞 Not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant