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

Cat5 Plugin Issue with Kodi Kryton #14

Closed
GitMarshallBill opened this issue Jan 5, 2018 · 51 comments
Closed

Cat5 Plugin Issue with Kodi Kryton #14

GitMarshallBill opened this issue Jan 5, 2018 · 51 comments

Comments

@GitMarshallBill
Copy link

Using Kodi Krypton v17.6 on Windows 10, Debian 9 or Ubuntu 16.04 plugin will load and show in MyAdd-ons but when you select it display remains empty and will not load videos.

@Cat5TV Cat5TV added the bug label Jan 5, 2018
@Cat5TV
Copy link
Owner

Cat5TV commented Jan 5, 2018

@solbu have you encountered this?

@solbu
Copy link
Contributor

solbu commented Jan 5, 2018

@Cat5TV: No.
It works just great in my Mageia 6, running Kodi 17.3.

@GitMarshallBill: Which version of the plugin do you run?
Latest version is 1.1.3.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 5, 2018

Thanks @solbu ... I wonder then if this is a possible compatibility issue with the newer Kodi 17.6. Will need to recreate the error to see what's going on.

@GitMarshallBill
Copy link
Author

GitMarshallBill commented Jan 5, 2018 via email

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 6, 2018

Okay everything was great and working on my Kodi installed from Ubuntu repos... so I removed that and installed 17.6 and sure enough I see the same issue. Debugger log doesn't give any helpful details (ie. an error).

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 6, 2018

I have created a legacy branch which now contains the code we know works in older versions of Kodi. The master branch will now be used for newer versions.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 6, 2018

@nateuk any chance you're interested in working with us on this?

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

I've been testing a few things on our end, like outputting just one show instead of all in case it has something to do with something silly like a French character, but no luck. Still not able to get the new Kodi to load the channel. The error log/debug log is of absolutely no help. Anyone have experience with this stuff and can review the code to see if perhaps something in it is deprecated in 17.6?

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

I have opened a forum thread here: https://forum.kodi.tv/showthread.php?tid=326782

@GitMarshallBill
Copy link
Author

My log file from a Debian Stretch VM is attached.
kodi.log

@da-anda
Copy link

da-anda commented Jan 8, 2018

Talked to one of our python devs. Your add-on uses the content type shows while the correct one is tvshows. Once you change it, it works (just tested on 17.6 on Windows)

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

wow - @da-anda seriously? I will try this right away - thank you!

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

@da-anda: Good catch. I tested the changes, and it works on my kodi v17.3 also, so this change will not impact older working kodi versions.

@Cat5TV: You'll get a pull request from me, soon.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

thanks @solbu - I will wait rather than committing my own. Cheers!

@GitMarshallBill
Copy link
Author

@solbu - let me know when updates have happened and I can test on my devices

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

@GitMarshallBill I'll commit @solbu 's PR as soon as it comes in, so you can re-download at that point. I imagine he'll want to increment the version number as well. :D

solbu added a commit to solbu/plugin.video.category5 that referenced this issue Jan 8, 2018
@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Merged. @GitMarshallBill please test and confirm.

@GitMarshallBill
Copy link
Author

@solbu @Cat5TV tested and functioning on Ubuntu16.04, Debian 9 "Stretch" and Windows 10. Thanks.
:D

@da-anda
Copy link

da-anda commented Jan 8, 2018

btw, if you would like to slightly improve the speed of the add-on on low power devices like the PI, then move as much logic as you can into a separate file and keep the main file as small as possible. Reason is, Kodi will cache the parsed version of imported files (pyo) but not the main file. So every time the add-on is triggered, the entire file needs to be parsed/compiled by the Python interpreter again and again and again, while imported files are only processed once and can be called instantly.
Now this add-on is not that complicated in logic and not really big, so the improvement might be negligable, but it's still best practice. Just FYI

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Oh that is fantastic news. Thank you @solbu @da-anda and @GitMarshallBill ... time to redo our on-air demo of the Kodi channel :)

@Cat5TV Cat5TV closed this as completed Jan 8, 2018
@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

@da-anda - just caught your final comment as I closed this. I'm entirely green at this point regarding Kodi add-on development. If you are able & willing, I'd greatly love more information about how to achieve this. Even a quick demo using our channel, or ultimately a PR would be something else. As it is, I wouldn't know where to look or how to implement what you're recommending :) I'm a PHP/bash/javascript dev so it doesn't take me long to understand the code... just not at the point where I can "create" add-on code yet... have to work from examples. Thanks!

@da-anda
Copy link

da-anda commented Jan 8, 2018

well, I have the same background as you. I only know about python what I read on the forums or catch up on our Slack channel, and that's something I catched up. But this change likely is bringing almost 0 improvement. However you might be able to really improve the speed by adding some caching and maybe improve the XML parsing of the RSS feed (or maybe even switch over to JSON). Again, I'm not a Python dev and can only give some suggestions. Our forum might be the best way to get qualified help.

On a sidenote: It would be nice if you would submit your add-on to our official repository, so that everybody can enjoy your shows and not just people already knowing you. Might get you some more patreons ;)

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

@da-anda: How do we do that?

btw, I already run a public cat5 repo for my own use, and also to learn how it's done.
https://github.com/solbu/repository.cat5

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Ha - thanks @da-anda - as you were typing your message I was typing the Issue to add Cat5 to the add-on repository :D Great minds, right? Thank you. I didn't want to submit it until I had the confirmation that this issue was fixed.

Yeah, I think caching and/or doing as you suggested earlier may have more of an impact than you think. Look at shows.php and look at the size of the RSS files ... especially Category5 Technology TV. It's loading SD, HD, LD, MP3, etc.... for each show... and we've been on the air for 11 years... so yes, I think you are onto something here that could greatly increase the performance - thank you. Now, to see if @solbu can make sense of your comments and I'll just push "merge" LOL!

Thanks again!

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Woh - @solbu what does the repository do? Keep it up to date?! Maybe THAT should be submitted rather than our channel itself? Should I fork it? :)
Maybe we should edit xbmc/repo-plugins#1592 ?

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

@Cat5TV: The idea was that you could use it to run an official cat5 repo. I mailed you info on it before christmas, but perhaps it drowned in other emails. :-)
But if you manage to get this video addon in the official kodi repo, that is the better option.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Oh yes - ha! And yes, it worked its way down and I totally forgot (SORRY!). Yeah, I'd love to see it in the official Repo... feels to me like that's the best way to give our free content to the Kodi community. But I'm still really interested in your repo idea. But as noted above, I have yet to get my head around the Kodi add-on development and how it all works. Thanks for doing what you do... I couldn't do this without you.

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

@Cat5TV: But yes, the repo update the video addon when a new release is made. That way users who install the repo addon will automatically get new releases, when the repo owner run two make commands.

@da-anda
Copy link

da-anda commented Jan 8, 2018

check out http://kodi.wiki/view/HOW-TO:Create_add-on_PRs_using_Git_Subtree_Merging on how to PR a add-on (if I'm not mistaken).
It's basically just a PR to the correct branch of the according add-on type repository

edit: the correct branch would be the min Kodi version this add-on compatible with. So if it's compatible with Helix+, PR to the Helix branch and it will become available for all Kodi versions since Helix. (just as an example)

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Well, it should work with ... everything since at least 2015 when it was first developed, and probably before that. Not sure how to tell the actual ver.

@da-anda
Copy link

da-anda commented Jan 8, 2018

Our python devs just confirmed that JSON parsing should be quite fast in Python, so you might want to switch to JSON if that's easily possible and the service is not used for anything else. Actually, a real webservice that's serving the data in chunks might even be better, but that's up to you and your amount of sparetime ;)

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

@Cat5TV: According to http://kodi.wiki/view/Addon.xml#Dependency_versions
it is claimed to work in kodi v12. (addon="xbmc.python" version="2.1.0")

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Nice, thanks @solbu - I'll update the Issue. @da-anda that sounds cool, and it's easy to change to JSON output on the backend just not sure (again; python n00b) how to switch the channel front-end to accept the new data. :)

@da-anda
Copy link

da-anda commented Jan 8, 2018

just tested it on Jarvis and get some urllib errors. So probably better test it upfront

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Bummer. I had it working fine on Kodi 15, so figured it'd work fine with 16 too. Should I delete my Issue and wait till we've tested more? Or what should I do? What are the urllib errors you're getting? Is it possible one of our site assets is down and that's all you're seeing?

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

I still have kodi 14.0 installed in a system, and it works on that.
@da-anda: Which errors do you get? I don't see any.

@da-anda
Copy link

da-anda commented Jan 8, 2018

22:08:05 T:232   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'urllib2.URLError'>
                                            Error Contents: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>
                                            Traceback (most recent call last):
                                              File "D:\Kodi\Jarvis-16.0\portable_data\addons\plugin.video.category5\default.py", line 274, in <module>
                                                shows(cat5ShowURL)
                                              File "D:\Kodi\Jarvis-16.0\portable_data\addons\plugin.video.category5\default.py", line 102, in shows
                                                sourceCode = getURL(showurl)
                                              File "D:\Kodi\Jarvis-16.0\portable_data\addons\plugin.video.category5\default.py", line 86, in getURL
                                                response = urllib2.urlopen(openurl)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 127, in urlopen
                                                return _opener.open(url, data, timeout)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 404, in open
                                                response = self._open(req, data)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 422, in _open
                                                '_open', req)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 382, in _call_chain
                                                result = func(*args)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 1222, in https_open
                                                return self.do_open(httplib.HTTPSConnection, req)
                                              File "D:\Kodi\Jarvis-16.0\system\python\Lib\urllib2.py", line 1184, in do_open
                                                raise URLError(err)
                                            URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>
                                            -->End of Python script error report<--
22:08:05 T:6192   ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.category5/
22:08:05 T:6192   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.category5/) failed

seems to be an issue with the SSL handshake. When I switch the URL to http it's loading the categories.

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

That looks like an SSL/TLS problem. it fails due to a TLS/SSL problem.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Try changing the shows.php file to http instead of https and tell me if that fixes it. (line 22 of default.py)

@da-anda
Copy link

da-anda commented Jan 8, 2018

yes, that fixes it, but since the URLs returned by shows.php (which has some odd format, being HTML mixed with XML in the body) are also https, it stops working after the categories. It's likely a bug in urllib on my system (i.e. the version shipped with the Windows version)

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

okay point line 22 to http and shows2.php - I will make that http only and you can let me know.

@da-anda
Copy link

da-anda commented Jan 8, 2018

it might be fixable by providing some SSL context to urllib2, but I'm also a python noob
https://docs.python.org/2.7/library/urllib2.html

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

There's no confidential info exchanged. Removing ssl is a fine solution too (there's no reason for it other than just 'best practice') so really, if removing https fixes it, I'm fine with that.

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

No need to change to shows2.php now. I made shows.php auto-detect SSL and act accordingly. Does it work now when you change https:// to http:// on line 22 of default.py?

@da-anda
Copy link

da-anda commented Jan 8, 2018

yes, it's working. Talked to some of our devs and there are known issues with SSL on Jarvis, so best really might be to switch over to http

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Perfect. I'll update the add-on to use http. Thanks!

@da-anda
Copy link

da-anda commented Jan 8, 2018

I'm calling it a night now, I'm a couple hours ahead of Canada ;) Keep up the good work on your channel, checked out a couple episodes. Nice stuff 👍

@solbu
Copy link
Contributor

solbu commented Jan 8, 2018

Nice to know we can still support old kodi versions. :-)

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

Thank you @da-anda - your help today has been invaluable. Same goes to @solbu for the fix, and of course @GitMarshallBill for letting us know of the issue - thanks team!

@da-anda
Copy link

da-anda commented Jan 8, 2018

just noticed that I've been watching you @Cat5TV all the time in your tech talk episodes ;)

@Cat5TV
Copy link
Owner

Cat5TV commented Jan 8, 2018

@da-anda been watching Category5 Technology TV you mean? That's our flagship, and then we've got the smaller shows as well. Hope you've enjoyed it! Glad to finally be seeing it make its way to Kodi (hopefully through the add-on repo). :)

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

4 participants