tamland / xbmc-addon-nrk

NRK Nett-TV for XBMC
http://forum.xbmc.org/showthread.php?tid=52824
GNU General Public License v3.0
43 stars 26 forks source link

Deprecation notice: tvapi.nrk.no will be shut down #50

Closed bjartwolf closed 4 years ago

bjartwolf commented 6 years ago

Hi,

tvapi.nrk.no will be shut down in the not-to-distant future, approximately Q2/Q3 2018. We have no excact date, but when we have migrated our last apps from using this legacy endpoint we will shut it down.

Unfortunately we do not have any alternatives for integration to offer you.

For questions feel free to contact NRK at info@nrk.no (https://www.nrk.no/kontakt/)

Regards,

Bjørn Einar

kjetilk commented 6 years ago

Is there anything up now?

I have always thought that the best would be to just use the website, include some RDFa in there, and not maintain a separate API for third parties...

petterreinholdtsen commented 6 years ago

Was tvapi.nrk.no shut down in the last few days? My Kodi is no longer able to handle NRK content. :(

maghoff commented 6 years ago

Unfortunately we do not have any alternatives for integration to offer you.

It looks like https://psapi.nrk.no/ is a landing page for integration points with NRK. Looking into it, but don't hold your breaths :)

basrieter commented 6 years ago

I am facing the same issue.

bjartwolf commented 6 years ago

Hi,

I am sorry, but NRK will not allow third-parties to build a player on our content. This means that using psapi or scraping websites/apps for content and build a player will possibly have legal implications.

However, the metadata is possible to use and show with a link to existing NRK players, this requires an agreement with NRK - more information can be found here: https://psapi.nrk.no/thirdpartycatalog/Documentation

I am not a lawyer, so this is a bit of a rush answer, I can come back with a more formal/detailed answer from legal hopefully next week. Just wanted to reach out to you so you don't waste your time building integrations. @maghoff @kjetilk @tamland

Regards,

Bjørn Einar

kjetilk commented 6 years ago

OK, then I can stop paying my license. Kodi is the only way I want to use NRK.

You are of course aware that you also broke a lot of systems in Norwegian schools?

That this stops you from participating in any open innovation?

That it prevents you from being a part of emergent social technologies.

That it means that you will have to accept Mark Zuckerberg as your Supreme Editor for foreseeable future?

maghoff commented 6 years ago

@bjartwolf Thanks for getting in touch! 🙂 I'm disappointed about the message, though.

petterreinholdtsen commented 6 years ago

This reminds me of the NRKbeta Doctrine from https://nrkbeta.no/2008/03/26/the-nrkbeta-doctrine/ :

The only way to control your content is to be the best provider of it.

I guess NRK do not believe in it any more...

solbu commented 6 years ago

I am sorry, but NRK will not allow third-parties to build a player on our content. This means that using psapi or scraping websites/apps for content and build a player will possibly have legal implications.

Whether or not we create a player for NRK content is nothing you can legaly stop. Residents in Norway that pay their television receiver license have legal access to the content, regardless of whether they access using their TV receiver sets or using the internett to access it. Having legal access to the content means one can legally copy the content. Playing the content does not even copy it.

Someone is going to figure out a way to create a Kodi player for NRK, and I personally intend to support any such project.

ToreAndreRosander commented 6 years ago

I was under the impression that Nrk wanted to be a leader, not walking backwards.

But since the nrk plugin for kodi was my last linear TV "provider" I will now remove the antenna input on my TV and cancel the nrk license. Way to go nrk, just force more people over to foreign streaming services 👏👏👏

oyvindkvalsvoll commented 6 years ago

This was very unfortunate. Though not exactly politically neutral, for a TV-channel the content had very high quality, it will be missed. Still available using web-browser, but performance and user interface is not suitable for quality home-theater playback, which inevitably will lead to this channel disappearing from my viewing habits, we have so many alternatives today.

awgaan commented 6 years ago

The API hasn't closed yet. #51 should make it work again. (My parents were complaining that NRK had stopped working) I'll gladly invest time to create a working plugin again once the API officially closes. I don't understand why they would close it, but oh well.

solbu commented 6 years ago

I'll gladly invest time to create a working plugin again once the API officially closes.

If you manage to do that, that would be awesome. :-)

ThePrivateGeek commented 6 years ago

51 should make it work again

Can confirm.

petterreinholdtsen commented 6 years ago

Any hope to get a fixed plugin into the official repositories? It would save me a trip to my parents to fix their kodi instance.

-- Happy hacking Petter Reinholdtsen

oy5tein commented 6 years ago

nf

Also confirm, Tried on a windows 10 box. Edited appdata\roaming\kodi\addons\plugin.video.nrk\nrktv.py like shown in #51 and deleted the pyo binary.

StianOby commented 6 years ago

Lawyer and legal academic here. Looking forward to that "more formal/detailed answer from legal". Because I can't really see how you would be able to take legal action against a plugin like this one under Norwegian law.

petterreinholdtsen commented 6 years ago

It did not last long. Yesterday NRK on Kodi stopped working again. Here is the error:

07:54:29.835 T:1443881888   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'requests.exceptions.HTTPError'>
                                            Error Contents: 412 Client Error: Precondition Failed for url: http://tvapi.nrk.no/v1/categories/
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.nrk/main.py", line 21, in <module>
                                                addon.run()
                                              File "/storage/.kodi/addons/plugin.video.nrk/addon.py", line 279, in run
                                                plugin.run()
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 115, in run
                                                self._dispatch(path)
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 126, in _dispatch
                                                view_func(**kwargs)
                                              File "/storage/.kodi/addons/plugin.video.nrk/addon.py", line 229, in browse
                                                items = nrktv.categories()
                                              File "/storage/.kodi/addons/plugin.video.nrk/nrktv.py", line 189, in categories
                                                return [Category.from_response(item) for item in _get('/categories/')]
                                              File "/storage/.kodi/addons/plugin.video.nrk/nrktv.py", line 155, in _get
                                                r.raise_for_status()
                                              File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 939, in raise_for_status
                                                raise HTTPError(http_error_msg, response=self)
                                            HTTPError: 412 Client Error: Precondition Failed for url: http://tvapi.nrk.no/v1/categories/
                                            -->End of Python script error report<--
07:54:29.863 T:1946488848   ERROR: GetDirectory - Error getting plugin://plugin.video.nrk/browse
07:54:29.864 T:1946488848   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.nrk/browse) failed

Anyone got a clue what to put in .kodi/addons/plugin.video.nrk/nrktv.py to use 'Firefox' to get it working again? Given how quickly NRK blocked Kodi this time, I suspect they are intentionally blocking Kodi, and we thus need to change UserAgent and android version to something already used by other applications.

maghoff commented 6 years ago

Meanwhile, to add insult to injury, NRK has implemented integration with another proprietary, closed platform, Google Home, as a value add to a foreign company: https://nrkbeta.no/2018/10/24/vil-du-snakke-med-nrk/

Never mind open access for the public of Norway.

christiankarlsson9 commented 6 years ago

It did not last long. Yesterday NRK on Kodi stopped working again. Here is the error:

07:54:29.835 T:1443881888   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'requests.exceptions.HTTPError'>
                                            Error Contents: 412 Client Error: Precondition Failed for url: http://tvapi.nrk.no/v1/categories/
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.nrk/main.py", line 21, in <module>
                                                addon.run()
                                              File "/storage/.kodi/addons/plugin.video.nrk/addon.py", line 279, in run
                                                plugin.run()
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 115, in run
                                                self._dispatch(path)
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 126, in _dispatch
                                                view_func(**kwargs)
                                              File "/storage/.kodi/addons/plugin.video.nrk/addon.py", line 229, in browse
                                                items = nrktv.categories()
                                              File "/storage/.kodi/addons/plugin.video.nrk/nrktv.py", line 189, in categories
                                                return [Category.from_response(item) for item in _get('/categories/')]
                                              File "/storage/.kodi/addons/plugin.video.nrk/nrktv.py", line 155, in _get
                                                r.raise_for_status()
                                              File "/storage/.kodi/addons/script.module.requests/lib/requests/models.py", line 939, in raise_for_status
                                                raise HTTPError(http_error_msg, response=self)
                                            HTTPError: 412 Client Error: Precondition Failed for url: http://tvapi.nrk.no/v1/categories/
                                            -->End of Python script error report<--
07:54:29.863 T:1946488848   ERROR: GetDirectory - Error getting plugin://plugin.video.nrk/browse
07:54:29.864 T:1946488848   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.nrk/browse) failed

Anyone got a clue what to put in .kodi/addons/plugin.video.nrk/nrktv.py to use 'Firefox' to get it working again? Given how quickly NRK blocked Kodi this time, I suspect they are intentionally blocking Kodi, and we thus need to change UserAgent and android version to something already used by other applications.

Hi Petter,

tvapi.nrk.no was/is merely a proxy server that was created with the sole purpose of being used by our mobile apps for iOS and Android. Our mobile apps has since then been rewritten to use our official API (psapi.nrk.no) and thus we decided to deprecate tvapi.nrk.no. Since we can't control when users decide to update their apps we send out a JSON response telling our users that they need to update their app. This is the "blocking" that you are experiencing now. Once a sufficient amount of users have updated their apps we'll take the server offline completely. There is no intentional blocking of Kodi going here, but the message you receive is based on the fact that the Kodi-app sends a request header identifying itself as an Android app.

/Christian Karlsson NRK

solbu commented 6 years ago

Can one of you guys working at NRK (@bjartwolf or @christiankarlsson9) whom is obviously watching this thread explain why you are starting to block third party players, such as this Kodi player, which was stated by @bjartwolf in the thread? What is wrong with us having a Free Software player that NRK doesn't control?

awgaan commented 6 years ago

@christiankarlsson9 I looked at "API-dokumentasjon for PSAPI", and thought it looked quite good. One problem though. Where can we get an API key? All of the resources here require a key.

solbu commented 6 years ago

@awgaan: There is an api key published on line 66 in the tv.nrk.no page.

maghoff commented 6 years ago

@awgaan You can request a key from the contact persons listed here: https://psapi.nrk.no/thirdpartycatalog/Documentation

solbu commented 6 years ago

@awgaan You can request a key from the contact persons listed here: https://psapi.nrk.no/thirdpartycatalog/Documentation

If we are to believe @bjartwolf, we won't get our own key for the Kodi plugin. But it is worth a try. :-)

ThePrivateGeek commented 6 years ago

@awgaan You can request a key from the contact persons listed here: https://psapi.nrk.no/thirdpartycatalog/Documentation

But it is worth a try. :-)

Sent a request ;)

bjartwolf commented 6 years ago

Please be aware that the generated URLs in the docs are all wrong. The domain should be https://psapi.nrk.no

I don't have a better answer from legal yet, so not saying you can legally use the API, but if you do at least use that domain name (Not going into details, but the others are not stable names and also you will have better performance going through psapi.nrk.no than using the domains from the swagger docs.

oy5tein commented 5 years ago

Might be worth it to check out https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/nrk.py youtube-dl works for both urls from the web player and shared urls from the android nrk-tv app.

@bjartwolf Thanks for your excellent plugin. Its (or was) the only way i watched tv. Well worth the TV license. Hope you get it running again :-)

alfton commented 5 years ago

yeah, agree on this, hope you get the plugin running again. This is the only way i watch NRK, without it I will just gonna stop paying my license.

asplundj commented 5 years ago

I found a sup-optimal solution to watch NRK on kodi. I'm using the SendToKodi https://github.com/firsttris/plugin.video.sendtokodi app to send the URL from the NRK android app to kodi. You simply find the show in the NRK app and then click the share icon and choose "Sendtokodi". This is of course not a perfect solution but at least I'm able to watch NRK on my TV.

petterreinholdtsen commented 5 years ago

Perhaps the best approach is to look at how youtube-dl handle NRK, and rip the information needed from the NRK web pages?

awgaan commented 5 years ago

@petterreinholdtsen We could do that, but it's so dirty. But that might be the only way now as I haven't received a reply on my request for an API key and I doubt I'll get one.

kjetilk commented 5 years ago

Given that streaming abroad is on the agenda, I think that the minister of culture is inclined to review what rights we should have to content that we pay for, and my soon be paying taxes for. I think it makes sense to send her an email. I have argued this in the context of how the current policy empowers the big players and endangers NRKs editorial independence. You may find other angles.

awgaan commented 5 years ago

I somehow managed to look past @solbu's comment. That API key works. I have managed to get the live channels working and will try to finish the rest soon.

bjartwolf commented 4 years ago

The API has been depcreated so this issue is not relevant anymore.