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

LiveTV not working #2

Open
frostmo84 opened this issue May 24, 2013 · 26 comments
Open

LiveTV not working #2

frostmo84 opened this issue May 24, 2013 · 26 comments
Labels

Comments

@frostmo84
Copy link

error message: "cannot load m3u8: cross-domain access denied"

@eithe
Copy link
Owner

eithe commented May 28, 2013

Thanks for reporting. Pull request #3 should hopefully fix most of the bugs with the current version. Will try to pull this in tonight.

@eithe
Copy link
Owner

eithe commented May 28, 2013

Merged #3 and it should be working again.

@eithe eithe closed this as completed May 28, 2013
@meulie
Copy link

meulie commented Jun 20, 2013

Hmm, again not working...

@eithe
Copy link
Owner

eithe commented Jun 21, 2013

Ok, I'll take a look at it .. They are always changing those URLs ...

@eithe eithe reopened this Jun 21, 2013
@eithe
Copy link
Owner

eithe commented Jun 21, 2013

In case other devs see this, the new urls to the m3u8s seems to be:

http://nrk1us-f.akamaihd.net/i/nrk1us_0@102847/master.m3u8?dw=31
http://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/master.m3u8?dw=31
http://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/master.m3u8?dw=31

@meulie
Copy link

meulie commented Jun 21, 2013

Thanks :-)

Hmm, how do I implement this in the code...?

@johnkors
Copy link

johnkors commented Nov 4, 2013

The API is generating the URLs from the sent user-agents in the request (i.e. Mobile Safari user-agents returns HLS streams, Chrome desktop returns .f4m).

image

eithe referenced this issue Nov 4, 2013
Missing category and season browsing (from A-Å).

Looks like I'm not getting the best streaming resolution. Need to
investigate more on the URL parameters.

Live streaming is not working.
@nemzes
Copy link

nemzes commented Nov 15, 2013

@johnkors What URL are you querying to get that JSON?

@johnkors
Copy link

@eithe
Copy link
Owner

eithe commented Nov 23, 2013

Just a note to where we always can get updated live urls: http://v7.psapi.nrk.no/mediaelement/nrk1

@burnbay
Copy link
Collaborator

burnbay commented Nov 23, 2013

Yes, and that's the source I'm using, but only get errors. Maybe you can
have a look at the service code?

lørdag 23. november 2013 skrev Eirik H følgende:

Just a note to where we always can get updated live urls:
http://v7.psapi.nrk.no/mediaelement/nrk1


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-29132593
.

Erling Brandvik
+4790851110

@eithe
Copy link
Owner

eithe commented Nov 23, 2013

@burnbay I just downloaded the latest source from this rep. and your Live code seems to work quite well here. This is on latest PMS and PHT plexpass releases!

@eithe
Copy link
Owner

eithe commented Nov 25, 2013

Live TV works on latest PHT and Plex/Web, considering closed! However, it does not work on Android, but I think that is to be expected because it's HLS. I will add another issue for this.

@eithe eithe closed this as completed Nov 25, 2013
@thesatman
Copy link

Wanted to watch the horse VM, today on NRK2. Cannot load M3U8: 404 not found. Removed the channel, installed again, checked for updates, restarted Plex. Now I get AES decryption not supported in Premium edition.... ?

@eithe
Copy link
Owner

eithe commented Sep 1, 2014

@thesatman Which client and server is this? I don't have the time to look into it, but in case anyone else is watching, I found https://forums.plex.tv/index.php/topic/108837-error-aes-decryption-not-supported-in-premium-edition/

@eithe eithe reopened this Sep 1, 2014
@thesatman
Copy link

Running the latest Windows PMS 0.9.9.14 (latest update). Clients I have tried are the web gui on Windows Chrome and Roku Wireless USB stick..

@burnbay
Copy link
Collaborator

burnbay commented Sep 8, 2014

Hi,

Looks like Eirik's link is the answer to the web GUI. As for the Roku
stick, it's difficult to say. I have a Roku 3 myself, and it's working.
Need to have a look at your PMS logs (nrk plugin) to investigate more.

Erling

On Mon, Sep 1, 2014 at 10:11 AM, thesatman notifications@github.com wrote:

Running the latest Windows PMS 0.9.9.14 (latest update). Clients I have
tried are the web gui on Windows Chrome and Roku Wireless USB stick..


Reply to this email directly or view it on GitHub
#2 (comment).

Erling Brandvik
+4790851110

@thesatman
Copy link

OK, In other words, Forget about NRK in the web client. But since you mentioned that it works on your Roku3 I decided to give it another go. I tested the live channels and got always the same error "Video unavailable, unable to play, etc ...". Until suddenly a live feed came through. Just for only a few seconds, then buffering, then error.

 

In the com.plexapp.system log I see that the bits and pieces (video fragments) are loaded :

2014-09-08 20:03:19,920 (10d0) :  DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTcxCmh0dHBzOi8vbnJrMnVzLWYuYWthbWFpaGQubmV0L2kvbnJrMnVzXzBAMTA3MjMxL2NyeXB0LWIua2V5P3NkPTEwJnJlYmFzZT1vbiZlPTEmaWQ9QWdCWkM2WXN3ZFN5eDFydkRWUmt3RXlmTVA1MExPWTRkWTJtTzBOWHRKSUg0eUw2JTJmbW9rdWRpRm44bUU2cmwzYTIlMmZpMTFpTkpQNE90USUzZCUzZHMzCnVybHMzMQpfYWxpZF89OWtTczEvbVZSSm5vMWNtaDQ2WGNZQT09czcKY29va2llc3IwCg__

2014-09-08 20:03:19,924 (10d0) :  DEBUG (runtime:49) - Received packed state data (80 bytes)

2014-09-08 20:03:19,926 (10d0) :  DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:19,927 (10d0) :  DEBUG (runtime:49) - Received packed state data (80 bytes)

2014-09-08 20:03:19,930 (10d0) :  DEBUG (networking:172) - Requesting 'https://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/crypt-b.key?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d'

2014-09-08 20:03:20,127 (10d0) :  DEBUG (runtime:106) - Sending packed state data (99 bytes)

2014-09-08 20:03:20,128 (10d0) :  DEBUG (runtime:918) - Response: [200] str, 16 bytes

2014-09-08 20:03:20,535 (9a8) :  DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTg4Cmh0dHA6Ly9ucmsydXMtZi5ha2FtYWloZC5uZXQvaS9ucmsydXNfMEAxMDcyMzEvc2VnbWVudDE0MTAxOTg5NV8zNTI4X2F2LWIudHM%40c2Q9MTAmcmViYXNlPW9uJmU9MSZpZD1BZ0JaQzZZc3dkU3l4MXJ2RFZSa3dFeWZNUDUwTE9ZNGRZMm1PME5YdEpJSDR5TDYlMmZtb2t1ZGlGbjhtRTZybDNhMiUyZmkxMWlOSlA0T3RRJTNkJTNkczMKdXJsczMxCl9hbGlkXz05a1NzMS9tVlJKbm8xY21oNDZYY1lBPT1zNwpjb29raWVzcjAK

2014-09-08 20:03:20,539 (9a8) :  DEBUG (runtime:49) - Received packed state data (80 bytes)

2014-09-08 20:03:20,540 (9a8) :  DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:20,542 (9a8) :  DEBUG (runtime:49) - Received packed state data (80 bytes)

2014-09-08 20:03:20,628 (9a8) :  DEBUG (networking:172) - Requesting 'http://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/segment141019895_3528_av-b.ts?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d'

 

So I guess the limitation is the bandwidth? We are blessed with a 2 Mbps ADSL line. Could this be a typical behaviour (eror, error, play, error, ...) for low internet speeds for streaming? Youtube tends to go OK, but NRK is sending HD or ?

@burnbay
Copy link
Collaborator

burnbay commented Sep 8, 2014

I think you're onto something. The live streams are all over SSL, and some
clients don't support that (Roku among others). In order to fix that, we
need to patch the playlist (m3u8). First of all we read the original m3u8
and pick the highest bitrate (lazy, I know). I guess we can add a bitrate
setting for the plugin so that the proper stream gets picked. The original
playlist looks like this:

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=164000,RESOLUTION=320x180,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=164000,RESOLUTION=320x180,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=264000,RESOLUTION=480x270,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_264_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=264000,RESOLUTION=480x270,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_264_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000,RESOLUTION=640x360,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_464_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000,RESOLUTION=640x360,CODECS="avc1.66.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_464_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=928000,RESOLUTION=640x360,CODECS="avc1.77.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_928_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=928000,RESOLUTION=640x360,CODECS="avc1.77.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_928_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1428000,RESOLUTION=960x540,CODECS="avc1.77.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1428_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1428000,RESOLUTION=960x540,CODECS="avc1.77.30,
mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1428_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1928_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1928_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2728000,RESOLUTION=1280x720
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_2728_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2728000,RESOLUTION=1280x720
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_2728_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3528000,RESOLUTION=1280x720
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3528000,RESOLUTION=1280x720
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_a-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_a-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d

All links are also HTTPS and new playlists. The picked playlist contains
the actual video segments and encryption information:

#EXT-X-KEY:METHOD=AES-128,URI="https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/crypt-b.key?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/crypt-b.key?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d",IV=0xb3aa051776ddb03d2b2457d6960a2532

I guess that line breaks the web client.

If you go to line 140 in ServiceCode.pys located
in C:\Users\AppData\Local\Plex Media
Server\Plug-ins\NRKTV.bundle\Contents\Services\URL\NRK-Live (windows) and
change the line from:

sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = True)

to

sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = False)

you should get the lowest bitrate. Give it try and let me know how it goes
:)

Erling

On Mon, Sep 8, 2014 at 8:27 PM, thesatman notifications@github.com wrote:

OK, In other words, Forget about NRK in the web client. But since you
mentioned that it works on your Roku3 I decided to give it another go. I
tested the live channels and got always the same error "Video unavailable,
unable to play, etc ...". Until suddenly a live feed came through. Just for
only a few seconds, then buffering, then error.

In the com.plexapp.system log I see that the bits and pieces (video
fragments) are loaded :

2014-09-08 20:03:19,920 (10d0) : DEBUG (runtime:717) - Handling request
GET
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTcxCmh0dHBzOi8vbnJrMnVzLWYuYWthbWFpaGQubmV0L2kvbnJrMnVzXzBAMTA3MjMxL2NyeXB0LWIua2V5P3NkPTEwJnJlYmFzZT1vbiZlPTEmaWQ9QWdCWkM2WXN3ZFN5eDFydkRWUmt3RXlmTVA1MExPWTRkWTJtTzBOWHRKSUg0eUw2JTJmbW9rdWRpRm44bUU2cmwzYTIlMmZpMTFpTkpQNE90USUzZCUzZHMzCnVybHMzMQpfYWxpZF89OWtTczEvbVZSSm5vMWNtaDQ2WGNZQT09czcKY29va2llc3IwCg__

2014-09-08 20:03:19,924 (10d0) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:19,926 (10d0) : DEBUG (runtime:814) - Found route
matching
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:19,927 (10d0) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:19,930 (10d0) : DEBUG (networking:172) - Requesting '
https://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/crypt-b.key?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d
'

2014-09-08 20:03:20,127 (10d0) : DEBUG (runtime:106) - Sending packed
state data (99 bytes)

2014-09-08 20:03:20,128 (10d0) : DEBUG (runtime:918) - Response: [200]
str, 16 bytes

2014-09-08 20:03:20,535 (9a8) : DEBUG (runtime:717) - Handling request
GET
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTg4Cmh0dHA6Ly9ucmsydXMtZi5ha2FtYWloZC5uZXQvaS9ucmsydXNfMEAxMDcyMzEvc2VnbWVudDE0MTAxOTg5NV8zNTI4X2F2LWIudHM%40c2Q9MTAmcmViYXNlPW9uJmU9MSZpZD1BZ0JaQzZZc3dkU3l4MXJ2RFZSa3dFeWZNUDUwTE9ZNGRZMm1PME5YdEpJSDR5TDYlMmZtb2t1ZGlGbjhtRTZybDNhMiUyZmkxMWlOSlA0T3RRJTNkJTNkczMKdXJsczMxCl9hbGlkXz05a1NzMS9tVlJKbm8xY21oNDZYY1lBPT1zNwpjb29raWVzcjAK

2014-09-08 20:03:20,539 (9a8) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:20,540 (9a8) : DEBUG (runtime:814) - Found route
matching
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:20,542 (9a8) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:20,628 (9a8) : DEBUG (networking:172) - Requesting '
http://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/segment141019895_3528_av-b.ts?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d
'

So I guess the limitation is the bandwidth? We are blessed with a 2 Mbps
ADSL line. Could this be a typical behaviour (eror, error, play, error,
...) for low internet speeds for streaming? Youtube tends to go OK, but
NRK is sending HD or ?


Reply to this email directly or view it on GitHub
#2 (comment).

Erling Brandvik
+4790851110

@burnbay
Copy link
Collaborator

burnbay commented Sep 8, 2014

Checked out NRK's setup page:
Maks bitrate på programmer i opptak

Bitraten er kvaliteten på videoen. Desto høyere tall du valger, desto bedre
kvalitet. Det er ikke gitt at din dings er i stand til å vise frem den
høyeste kvaliteten. Og dersom du har en treg eller ustabil forbindelse må
du klare deg med lavere kvalitet. Du kan ikke stille på kvaliteten på
direktesendinger.

As you can see live quality cannot be changed. I guess you will not get an
image on lower resolutions. Anyhow, give the code change a try.

Erling

On Mon, Sep 8, 2014 at 10:40 PM, Erling Brandvik erling@burnbay.com wrote:

I think you're onto something. The live streams are all over SSL, and some
clients don't support that (Roku among others). In order to fix that, we
need to patch the playlist (m3u8). First of all we read the original m3u8
and pick the highest bitrate (lazy, I know). I guess we can add a bitrate
setting for the plugin so that the proper stream gets picked. The original
playlist looks like this:

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=164000,RESOLUTION=320x180,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=164000,RESOLUTION=320x180,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=264000,RESOLUTION=480x270,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_264_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=264000,RESOLUTION=480x270,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_264_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000,RESOLUTION=640x360,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_464_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000,RESOLUTION=640x360,CODECS="avc1.66.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_464_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=928000,RESOLUTION=640x360,CODECS="avc1.77.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_928_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=928000,RESOLUTION=640x360,CODECS="avc1.77.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_928_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1428000,RESOLUTION=960x540,CODECS="avc1.77.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1428_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1428000,RESOLUTION=960x540,CODECS="avc1.77.30,
mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1428_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1928_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_1928_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2728000,RESOLUTION=1280x720

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_2728_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2728000,RESOLUTION=1280x720

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_2728_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3528000,RESOLUTION=1280x720

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3528000,RESOLUTION=1280x720
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_3528_av-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_a-p.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"

https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/index_164_a-b.m3u8?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d

All links are also HTTPS and new playlists. The picked playlist contains
the actual video segments and encryption information:

#EXT-X-KEY:METHOD=AES-128,URI="https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/crypt-b.key?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d
https://nrk3us-f.akamaihd.net/i/nrk3us_0@107233/crypt-b.key?sd=10&rebase=on&e=1&id=AgBU6shyUacmRlMRDlRSNeDCVGjeq92xHK2NsavBxLQERxgNLu23qNbaJUQEdt8UlnOWeSzeNcZ90A%3d%3d",IV=0xb3aa051776ddb03d2b2457d6960a2532

I guess that line breaks the web client.

If you go to line 140 in ServiceCode.pys located
in C:\Users\AppData\Local\Plex Media
Server\Plug-ins\NRKTV.bundle\Contents\Services\URL\NRK-Live (windows) and
change the line from:

sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = True)

to

sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = False)

you should get the lowest bitrate. Give it try and let me know how it goes
:)

Erling

On Mon, Sep 8, 2014 at 8:27 PM, thesatman notifications@github.com
wrote:

OK, In other words, Forget about NRK in the web client. But since you
mentioned that it works on your Roku3 I decided to give it another go. I
tested the live channels and got always the same error "Video unavailable,
unable to play, etc ...". Until suddenly a live feed came through. Just for
only a few seconds, then buffering, then error.

In the com.plexapp.system log I see that the bits and pieces (video
fragments) are loaded :

2014-09-08 20:03:19,920 (10d0) : DEBUG (runtime:717) - Handling request
GET
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTcxCmh0dHBzOi8vbnJrMnVzLWYuYWthbWFpaGQubmV0L2kvbnJrMnVzXzBAMTA3MjMxL2NyeXB0LWIua2V5P3NkPTEwJnJlYmFzZT1vbiZlPTEmaWQ9QWdCWkM2WXN3ZFN5eDFydkRWUmt3RXlmTVA1MExPWTRkWTJtTzBOWHRKSUg0eUw2JTJmbW9rdWRpRm44bUU2cmwzYTIlMmZpMTFpTkpQNE90USUzZCUzZHMzCnVybHMzMQpfYWxpZF89OWtTczEvbVZSSm5vMWNtaDQ2WGNZQT09czcKY29va2llc3IwCg__

2014-09-08 20:03:19,924 (10d0) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:19,926 (10d0) : DEBUG (runtime:814) - Found route
matching
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:19,927 (10d0) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:19,930 (10d0) : DEBUG (networking:172) - Requesting '
https://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/crypt-b.key?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d
'

2014-09-08 20:03:20,127 (10d0) : DEBUG (runtime:106) - Sending packed
state data (99 bytes)

2014-09-08 20:03:20,128 (10d0) : DEBUG (runtime:918) - Response: [200]
str, 16 bytes

2014-09-08 20:03:20,535 (9a8) : DEBUG (runtime:717) - Handling request
GET
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMgpzMTg4Cmh0dHA6Ly9ucmsydXMtZi5ha2FtYWloZC5uZXQvaS9ucmsydXNfMEAxMDcyMzEvc2VnbWVudDE0MTAxOTg5NV8zNTI4X2F2LWIudHM%40c2Q9MTAmcmViYXNlPW9uJmU9MSZpZD1BZ0JaQzZZc3dkU3l4MXJ2RFZSa3dFeWZNUDUwTE9ZNGRZMm1PME5YdEpJSDR5TDYlMmZtb2t1ZGlGbjhtRTZybDNhMiUyZmkxMWlOSlA0T3RRJTNkJTNkczMKdXJsczMxCl9hbGlkXz05a1NzMS9tVlJKbm8xY21oNDZYY1lBPT1zNwpjb29raWVzcjAK

2014-09-08 20:03:20,539 (9a8) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:20,540 (9a8) : DEBUG (runtime:814) - Found route
matching
/:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.nrk/NRK-Live/ContentOfURL

2014-09-08 20:03:20,542 (9a8) : DEBUG (runtime:49) - Received packed
state data (80 bytes)

2014-09-08 20:03:20,628 (9a8) : DEBUG (networking:172) - Requesting '
http://nrk2us-f.akamaihd.net/i/nrk2us_0@107231/segment141019895_3528_av-b.ts?sd=10&rebase=on&e=1&id=AgBZC6YswdSyx1rvDVRkwEyfMP50LOY4dY2mO0NXtJIH4yL6%2fmokudiFn8mE6rl3a2%2fi11iNJP4OtQ%3d%3d
'

So I guess the limitation is the bandwidth? We are blessed with a 2 Mbps
ADSL line. Could this be a typical behaviour (eror, error, play, error,
...) for low internet speeds for streaming? Youtube tends to go OK, but
NRK is sending HD or ?


Reply to this email directly or view it on GitHub
#2 (comment).

Erling Brandvik
+4790851110

Erling Brandvik
+4790851110

@thesatman
Copy link

 

Changed the line from:
sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = True)
to
sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = *False*)
 

Got an error message as soon as I clicked on the "Live TV" icon (not responding/unavailable something). The same on my Roku. It looks like NRK is testing the connecting client in the hand shake?

@burnbay
Copy link
Collaborator

burnbay commented Sep 9, 2014

Just to be precise, you changed to False, not False, right?

On Tue, Sep 9, 2014 at 9:42 AM, thesatman notifications@github.com wrote:

Changed the line from:
sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = True)
to
sorted_streams = sorted(streams, key = lambda stream: stream["bitrate"],
reverse = False)

Got an error message as soon as I clicked on the "Live TV" icon (not
responding/unavailable something). The same on my Roku. It looks like
NRK is testing the connecting client in the hand shake?


Reply to this email directly or view it on GitHub
#2 (comment).

Erling Brandvik
+4790851110

@thesatman
Copy link

Yes : reverse = False  

This channel is not responding.

In other words, when using False I am not even getting past the gates. With True the next screen are the 3 NRK logos (1,2+3). With False I get the error

@Allram
Copy link

Allram commented May 20, 2015

Any updates on this? :)

@burnbay
Copy link
Collaborator

burnbay commented May 20, 2015

Sorry, haven't had a chance to follow up this one.

On Wed, May 20, 2015 at 7:47 AM Allram notifications@github.com wrote:

Any updates on this? :)


Reply to this email directly or view it on GitHub
#2 (comment).

@thesatman
Copy link

@Allram : I can use it from my Roku Streaming stick, but can not play the videos from my PCs browser Chrome, nor can I play them from the Android Plex app.

burnbay pushed a commit that referenced this issue Jun 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants