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

Urlencode channel logo name for Remote Path (Internet address) logo source #210

Closed
allixx opened this issue Dec 22, 2018 · 3 comments
Closed

Comments

@allixx
Copy link
Contributor

allixx commented Dec 22, 2018

According to the docs, channel logo file name is set from tvg-logo attribute ( https://github.com/kodi-pvr/pvr.iptvsimple/blob/master/src/PVRIptvData.cpp#L400 ) or autogenerated from channel name if tvg-logo is missing ( https://github.com/kodi-pvr/pvr.iptvsimple/blob/master/src/PVRIptvData.cpp#L414 ).

Those assignments should have an URL encode conversion call when logo source is configured as Remote Path/Internet address (logoPathType is 1).

It's working fine as long as channel name is ASCII only. In case of UTF-8 names http requests mostly fail as CCurlFile's ::Open ::Stat fetching logo files in the end, doesn't do any URL encoding by itself.

For example, if logo base url is http://192.168.1.1/logos, and a channel tvg-logo is UTF-8 Cyrillic "Логотип Канала HD.png", that's what I have in kodi.log:

ERROR: CCurlFile::Stat - Failed: HTTP response code said error(22) for http://192.168.1.1/logos/Логотип канала HD.png

And that's what web server gets:

"HEAD /logos/\xD0\x9B\xD0\xBE\xD0\xB3\xD0\xBE\xD1\x82\xD0\xB8\xD0\xBF \xD0\xBA\xD0\xB0\xD0\xBD\xD0\xB0\xD0\xBB\xD0\xB0 HD.png HTTP/1.1" 400 0 "-" "-"
"GET /logos/\xD0\x9B\xD0\xBE\xD0\xB3\xD0\xBE\xD1\x82\xD0\xB8\xD0\xBF \xD0\xBA\xD0\xB0\xD0\xBD\xD0\xB0\xD0\xBB\xD0\xB0 HD.png HTTP/1.1" 400 166 "-" "-"

It can be worked around by preprocessing playlist to URL encode tvg-logo attributes, but that doesn't feel right.

@palinek
Copy link

palinek commented Dec 22, 2018

As you seem familiar with the code...why don't you provide the patch (submit PR) directly?

@allixx
Copy link
Contributor Author

allixx commented Dec 22, 2018

Considering #156 I think tvg-logo attribute should be left alone as it is up to user what to put in it.

Channel logo filename autogenerated from channel name is the place where urlencode must happen along with CHANNEL_LOGO_EXTENSION append (for logo Remote Path).

As you seem familiar with the code...why don't you provide the patch (submit PR) directly?

I slapped something together but the need to reinvent UrlEncode function (kodi/Network.h URLEncode cannot be used due to legacy api?) does not please me. Perhaps someone experienced in kodi internals can suggest a better solution/approach.

@phunkyfish
Copy link
Member

Added in last set of PR's

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

No branches or pull requests

3 participants