Kodi Community Forum
[RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins (/showthread.php?tid=144457)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-14

(2016-03-13, 22:41)laurent-c Wrote: So, after first error message, I installed python for Android. But anyway, I still got the same error and the same message.
Any one has idea how to fix that? No body as used yet this add-on on an Android box?
Thank by advance.

You probably have Python 2.6 in use and that code is not working with it. I made a fix and now it should work

(2016-03-12, 09:50)savis21 Wrote: I have also OE 6.0.3 in my RPi2 and I tried with Max resolution=HD720. I put my appId, appKey and secretKey with Kodi GUI but I cannot stream Yle Areena programs still. I tried some children program, here is log part of it.

Code:
09:41:33 39704.238281 T:1679569984   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeDecodeError'>
                                            Error Contents: 'utf8' codec can't decode byte 0xd2 in position 16: invalid continuation byte
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 751, in <module>
                                                router(sys.argv[2][1:])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 703, in router
                                                play_stream(params['stream'])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 319, in play_stream
                                                log("decrypted path: " + path)
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 40, in log
                                                txt = txt.decode("utf-8")
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
                                            UnicodeDecodeError: 'utf8' codec can't decode byte 0xd2 in position 16: invalid continuation byte
                                            -->End of Python script error report<--
09:41:33 39704.335938 T:1967407104   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.areena/?action=play&stream=1-2158348]
That is odd. Anyway, I made a small change to the logging. Check if it helps, and we would at least get some proper logging of the situation. If not try the Jumak's suggestion.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - savis21 - 2016-03-14

(2016-03-14, 18:15)hirsivaja Wrote: That is odd. Anyway, I made a small change to the logging. Check if it helps, and we would at least get some proper logging of the situation. If not try the Jumak's suggestion.
Moi hirsivaja, where i can find the latest version of plugin? I checked github and it seemed, that there wasn't any changes recently..(?)

EDIT: I put my keys via UI. I tried to find credentials.py script in OE but I cannot find it. If I put keys to credentials.py script, should I create the script or how?
README:
"Alternatively the keys can also be entered to a file called `credentials.py`."


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-14

(2016-03-14, 20:11)savis21 Wrote:
(2016-03-14, 18:15)hirsivaja Wrote: That is odd. Anyway, I made a small change to the logging. Check if it helps, and we would at least get some proper logging of the situation. If not try the Jumak's suggestion.
Moi hirsivaja, where i can find the latest version of plugin? I checked github and it seemed, that there wasn't any changes recently..(?)

EDIT: I put my keys via UI. I tried to find credentials.py script in OE but I cannot find it. If I put keys to credentials.py script, should I create the script or how?
README:
"Alternatively the keys can also be entered to a file called `credentials.py`."

The latest version can be found from https://github.com/hirsivaja/plugin.video.areena/. I made a small update just minutes ago, but those changes I talked about were made 9 hours ago.

The credentials.py needs to created in the addon directory on the OE (for example /storage/.kodi/addons/plugin.video.areena). Usually with a SSH client.
1. Rename credentials.py.sample with
Code:
mv credentials.py.sample credentials.py
2. Open and edit your keys in the renamed file
Code:
nano credentials.py
But you don't need to do that if you have already entered the keys through the settings menu


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - laurent-c - 2016-03-14

(2016-03-14, 18:15)hirsivaja Wrote: You probably have Python 2.6 in use and that code is not working with it. I made a fix and now it should work

Hi,
Thank for your efforts.

I updated the add-on but I have still error.
I got different results in my log file for this one.

Code:
-->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'datetime.timedelta' object has no attribute 'total_seconds'
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.areena-master/main.py", line 765, in <module>
router(sys.argv[2][1:])
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.areena-master/main.py", line 714, in router
list_streams(sub_categories, streams, url)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.areena-master/main.py", line 198, in list_streams
info_labels = info_labels + ('duration', duration.total_seconds())
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'
-->End of Python script error report<--

Let's hope you could find from where comes the problem.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-15

(2016-03-14, 23:20)laurent-c Wrote: I updated the add-on but I have still error.
I got different results in my log file for this one.

Again the problem is with the differences between Python 2.6 and 2.7. Check if the newest version works.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - laurent-c - 2016-03-15

(2016-03-15, 16:43)hirsivaja Wrote: Again the problem is with the differences between Python 2.6 and 2.7. Check if the newest version works.

Kiitos paljon. Nyt se toimi.
Thank you. It's working well now.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - laurent-c - 2016-03-16

Hi Hirsivaja,

If you are interested, I did some modifications of the file "main.py" for my own use ("my wife use" could be right word).

I did in way it's looking like this.

First, I change the order of the menu.
Image
I think that is more logical in this order. I also took off the brackets from it. I think, it was a bit useless.

In second time, I change the "flashy" red colour and replace it by some thing lighter with full text and because I didn't success to use images.
I wrote it in Finnish because I think the add-on is more destined to Finnish people and it's look like we can not propose many languages in this place. I put bold option text for the title of the program too.
See screen shots below.

Without extra infos.
Image

With extra infos.
Image

I don't have any skill in python, so I did like I could by searching on the file and on the web.
My plane was to add image such as calendar and hourglass such as on the YLE Areena website but I didn't success to do that. I don't know if it's possible.

Other thing but, same, I don't know if it's possible : to add information such as synopsis.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - teepean - 2016-03-16

That looks actually quite nice. My wife complained about the menu ordering.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - Huxely - 2016-03-16

I also like the new order too. Now that we are talking the UI, I noticed that both IOS and Android remote apps for controlling Kodi show the color tags as text, while the main Kodi UI shows the text in the color specified by the tag.

For example when I use Kore on Android and play any file from the API Plugin, it show in the "now playing"-field something like:

[GREEN]Hercule Poirot: Cornwallin mysteeri[/GREEN] (out of my memory, not copy-pasta) in normal color.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-16

(2016-03-16, 12:01)laurent-c Wrote: Hi Hirsivaja,

If you are interested, I did some modifications of the file "main.py" for my own use ("my wife use" could be right word).

That looks really cool. Please make a pull request to GitHub with your changes.

BTW. what is your skin?


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - savis21 - 2016-03-16

(2016-03-14, 20:27)hirsivaja Wrote: The latest version can be found from https://github.com/hirsivaja/plugin.video.areena/. I made a small update just minutes ago, but those changes I talked about were made 9 hours ago.

The credentials.py needs to created in the addon directory on the OE (for example /storage/.kodi/addons/plugin.video.areena). Usually with a SSH client.
1. Rename credentials.py.sample with
Code:
mv credentials.py.sample credentials.py
2. Open and edit your keys in the renamed file
Code:
nano credentials.py
But you don't need to do that if you have already entered the keys through the settings menu
I tried like hirsivaja suggested but still any stream can not be opened.
Code:
21:33:32 1490.460938 T:1577677888   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IOError'>
                                            Error Contents: [Errno 2] No such file or directory: '\xa47\xbfg\xee!m{@\x89\xe9\xd7\xc1_\x8f\xd7n\xa8\xa2U\xbd\x85\xa0e\xc4v\x06r\xa1;\x9f\x93do\xb4\x87\x02X\x80\xc4\x85\xa0\xbd\x9bM\x92\xc46 8\xa0\x9e\x80\xfb\xbe\xe1\xce\x17\xf0\x1b\x93\xc0zCKW$a\x0e\xb3'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 766, in <module>
                                                router(sys.argv[2][1:])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 718, in router
                                                play_stream(params['stream'])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 326, in play_stream
                                                path = get_resolution_specific_url(path)
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 345, in get_resolution_specific_url
                                                response = urllib.urlopen(path).read()
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 86, in urlopen
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 207, in open
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 462, in open_file
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 476, in open_local_file
                                            IOError: [Errno 2] No such file or directory: '\xa47\xbfg\xee!m{@\x89\xe9\xd7\xc1_\x8f\xd7n\xa8\xa2U\xbd\x85\xa0e\xc4v\x06r\xa1;\x9f\x93do\xb4\x87\x02X\x80\xc4\x85\xa0\xbd\x9bM\x92\xc46 8\xa0\x9e\x80\xfb\xbe\xe1\xce\x17\xf0\x1b\x93\xc0zCKW$a\x0e\xb3'
                                            -->End of Python script error report<--
21:33:32 1490.566895 T:1967824896   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.areena/?action=play&stream=1-3262573]
21:33:34 1492.947632 T:1577677888  NOTICE: Thread BackgroundLoader start, auto delete: false
21:33:38 1496.651733 T:1577677888  NOTICE: Thread LanguageInvoker start, auto delete: false
21:33:38 1496.790283 T:1577677888  NOTICE: -->Python Interpreter Initialized<--
21:33:39 1497.269043 T:1577677888   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: must be encoded string without NULL bytes, not str
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 766, in <module>
                                                router(sys.argv[2][1:])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 718, in router
                                                play_stream(params['stream'])
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 326, in play_stream
                                                path = get_resolution_specific_url(path)
                                              File "/storage/.kodi/addons/plugin.video.areena-master/main.py", line 345, in get_resolution_specific_url
                                                response = urllib.urlopen(path).read()
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 86, in urlopen
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 207, in open
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 462, in open_file
                                              File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.3/Python-2.7.3/.install_pkg/usr/lib/python2.7/urllib.py", line 474, in open_local_file
                                            TypeError: must be encoded string without NULL bytes, not str
                                            -->End of Python script error report<--
21:33:39 1497.376587 T:1967824896   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.areena/?action=play&stream=1-2894300]
21:33:39 1497.377563 T:1577677888  NOTICE: Thread BackgroundLoader start, auto delete: false

Onko tuolla pluginin polutuksella merkitystä, kun lopussa on "-master", kun sen nimisen zipin latasin GitHubista?


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - laurent-c - 2016-03-16

(2016-03-16, 20:19)hirsivaja Wrote:
(2016-03-16, 12:01)laurent-c Wrote: Hi Hirsivaja,

If you are interested, I did some modifications of the file "main.py" for my own use ("my wife use" could be right word).

That looks really cool. Please make a pull request to GitHub with your changes.

BTW. what is your skin?

My skin is "Eminence".


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-17

(2016-03-16, 12:01)laurent-c Wrote: In second time, I change the "flashy" red colour and replace it by some thing lighter with full text and because I didn't success to use images.
I wrote it in Finnish because I think the add-on is more destined to Finnish people and it's look like we can not propose many languages in this place. I put bold option text for the title of the program too.
I added translations to those texts you put there. This addon supports English, Finnish and Swedish (the Swedish translation might be quite horrible and it would be nice if somebody skilled in Swedish could take a look...).

(2016-03-16, 12:01)laurent-c Wrote: Other thing but, same, I don't know if it's possible : to add information such as synopsis.
Yes, actually that information is added, but I think it depends on the skin if it is shown or not. The data is added to Kodi infolabel 'plot'.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - hirsivaja - 2016-03-17

(2016-03-16, 21:43)savis21 Wrote: I tried like hirsivaja suggested but still any stream can not be opened.

Onko tuolla pluginin polutuksella merkitystä, kun lopussa on "-master", kun sen nimisen zipin latasin GitHubista?

Could you try again and enable debug logging in the addon settings? You also need to enable the debug for Kodi.
That path is fine.


RE: [RELEASE] Finnish TV: YleAreena and Ruutu (Video) plugins - laurent-c - 2016-03-17

(2016-03-17, 20:48)hirsivaja Wrote: I added translations to those texts you put there. This addon supports English, Finnish and Swedish (the Swedish translation might be quite horrible and it would be nice if somebody skilled in Swedish could take a look...).

Great work!