matthuisman / i.mjh.nz

Mirror of https://i.mjh.nz + issues / feature requests
282 stars 56 forks source link

Australia 9 Channels Issues #116

Closed matthuisman closed 1 month ago

matthuisman commented 3 months ago

Currently the 9 streams are down.

Around the start of olympics they removed the old linear streams that were used We needed to switch to streams that require a TOKEN These tokens need to be generated by a 9now user account.

Added automation to do this, however the user accounts keep getting suspended. Maybe they are detected as bots? or maybe its human's doing it? Or, could be automation if a token is used by multiple different IPs then kill the account.

Anyway - to get new user accounts - it takes a bit of time to create them and then get the refresh token required to create access tokens that then are used to get the streams.

Im currently a bit "sick of the back and forth" so not jumping to try to keep fixing it.

For now, I'd recommend using the 9now Kodi addon which generates the token for just your instance (not shared).

Another option is to spin up a server to generate the tokens and then points other IPTV players at that server. There is abit about that on this ticket: https://github.com/matthuisman/slyguy.addons/issues/825

matthuisman commented 2 months ago

yup. looks like false hope Ive re-enabled the old streams in my playlists etc anyway in the hope they do come back

ballfam commented 2 months ago

What's the latest on getting Nine channels back in NextPVR? I wish that NextPVR had the ability to FTA but encrypted channels using either cleartype or Widevine - they can be played back with FFplay with appropriate keys - should be fairly easy to pipe the output in FFplay, to ffmpeg, and then onto NextPVR, but some things are more complicated than they appear - but if encrypted links were supported, it would make my life, so much easier...

In theory it all works fine with an extra. I got myself a link using 9now.com.au and M3U sniffer, then I ran streamlink with the link and it worked perfectly and popped up VLC to play channel 9. The problem comes when I add it to the extra XML. When I try to rescan the channel, I'm getting a syntax error on the ampersand (&) in the link. I tried quoting it and dereferencing with a backslash, but it doesn't help. I'm going to post something to the NextPVR forums to see if they can help, otherwise I need some way to alias and forward the link so I can type in some short form link in the NextPVR extra and have it forward to the long link with all the special characters (pretty much exactly what Matt's service does). I don't know if there is any way to "alias" links without an HTML server, but if there is, can someone post how to do it.

If I work it out, I'll post.

OK, good news and bad news. Martin told me how to fix the issue on the NextPVR forum. This is an XML problem in that XML treats the ampersand as a special character; so to fix the issue, you simple need to relace each occurrence of ampersand (&) with the XML dereference, which is "&". Having done that, the link works properly in the extra.

Now, the bad news. These links really do only last 48 hours, so every 48 hours, you have to refresh the link by going to 9now.com.au and using M3U sniffer to get another link, and then editing the extra XML, replacing it with the new link; then do a "Rescan for devices" in the NextPVR settings so it picks up the new link; then re-edit the channel to associate the EPG correctly so that it will start recordings.

It's a major pain, and I'm not sure how badly I want to record stuff from Channel 9 right now. If this is a long-term thing, I would write a shell script to do it and then set up a cron job to run it every 46 hours, but that's a lot of work

ballfam commented 2 months ago

Oops, I guess these forum posts use XML, it just dereferenced my dereferenced characters for ampersand in the last post. urgghhh. So, I'm adding a space between each character so it down't do it again. Dereference for ampersand is "& amp ;" (without any spaces).

YetAnotherChocaholic commented 2 months ago

Anyone know how to prevent the m3u sniffer links from expiring? Some people above are saying that it lasts 48+ hours but mine last often just for a day. I'm starting to get a bit sick of constantly having to refresh the links every evening.

LGSAM59 commented 2 months ago

Same , only get a day also , not sure why.

jamesgallagher commented 2 months ago

There is a timestamp for start and expiry in the parameters. When I looked it was exactly 48hours. It renews on first visit after expiry then each time you come back will still be the same token. So it isn't from when you copy the links, but from when it initially renewed or was issued. At least that's my understanding

Edit: checked today, it is now 24 hour tokens.

trevor68 commented 2 months ago

Any news? a way to update the url's outside of Kodi (ala tivimate) would be awesome. Seems 9 are happy to keep this method now?

jamesgallagher commented 2 months ago

Buy Matt 100 coffee's (read beers) for the proxy that can redirect the links and use the Kodi plugin.

trevor68 commented 2 months ago

Ha, I already know his bloods worth bottling, hence I'm a patreon supporter. Still if we need a bounty, I'm up for it. For myself a docker container that renews the links would be excellent.

matthuisman commented 2 months ago

my secret plan is progressing. One of the many reasons I moved all my addon settings from kodis addon setting to my own plugin / DB system is now settings can be set via my proxy / cmdline interface :)

I also plan to extend this interface to web as well. So I can make web elements that map to the kodi elements.

The plan is to eventually have a really easy container that can just install any of my addons and IPTV Merge and then just able to spit out a M3U8 playlist.

There is something very close to this I have already for TvHeadend but want to make it more generic :)

I also dont want to maintain the same code in different places. eg. a 9now docker container and 9now kodi addon/ If I have a generic container that can just run my addons - then i only need to maintain the addons

ballfam commented 2 months ago

Would any of this work for NextPVR?

Accessing channel 9 via 9now is not an issue, but it is not possible to record anything; NextPVR allows me to record with a lot complexity and flexibility (all shows for a season, all shows that have this string in their name, etc...) based on the EPG XML....all good, except that it requires an M3U8 link which I can add into the NextPVR interface which will stream the channel to be recorded.

Using M3U sniffer gives me a link that works for 48 hours, but editing the NextPVR XML every 48 hours is not really practical. Somehow, I just need a permanent link I can add to NextPVR which forwards on to the 9now link with my token embedded. It would be fine to have a phony 9now account and password which I will add in to the initial link somehow so that the forwarded link with the token can be generated.

I'm fine running a docker container with an Apache web server that is dedicated to auto regenerating the token every 48 hours and forwarding the link, but I'm wondering if this solution wold fit into that somehow.

matthuisman commented 2 months ago

itll be able to work with anything as long as you have the docker container running somewhere on your network And itll be almost unstoppable / blockable as your generating your own links everytime (not shared)

ballfam commented 2 months ago

cool thanks, worth plenty of beers if you can pull it off. I'm planning to run the docker container on the same machine as my NextPVR server (I already have docker installed there for other things).

matthuisman commented 2 months ago

yup. i just want to take the time and make sure its generic and can just run my add-ons "as-is". I dont want to maintain multiple versions of the same auth / login / code etc. nightmare But if it can just run my latest addons and have an update mechanism - then joy! its already 85% there

i also want to rename my kodi.proxy to something like kodi.emulator or something like that. proxy doesnt really make sense anymore

JaxonPlays commented 2 months ago

Tried out the 9Now addon. Can’t change states and max 360p.

smalldog666 commented 2 months ago

For those who might find this useful, here's a version of the script that dispenses with flask and just prints the url for the m3u8. I use this to pipe into streamlink and in turn into tvh. I've not changed the logic so all credits go to Matt and original person who created the modified script, i just made some changes to suit my needs. What this version will do is save copies of the access code and expiry, as well as cache all the URLs into json files, and read them each time the script is called. The script was tested under python 3.8.10 only.

9geturl.txt

matthuisman commented 2 months ago

the IPTV AU Kodi add-on Channel 9's now work as its now "deeplinking" to the 9now addon streams. If you try to play and not have 9now addon installed - itll ask you to install it etc..

The streams also have been removed from the playlists again.

NormBurns commented 2 months ago

why do your links contain: chrome-extension://akkncdpkjlfanomlnpmmolafofpnpjgn/player/player.html?site=https://links.cannardy.com/admin/#

Tivimate wont understand that at all....

For you and everyone else, your playlist should be as simple as

#EXTM3U
#EXTINF:-1 tvg-id="mjh-channel-9-nsw",Channel 9
https://csm-e-nineau1-eb.bln1.yospace.com/csm/ext..............|user-agent=Mozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/98.0.4758.102%20Safari/537.36
#EXTINF:-1 tvg-id="mjh-gem-nsw",9 Gem
https://csm-e-nineau1-eb.bln1.yospace.com/csm/ext..............|user-agent=Mozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit/537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome/98.0.4758.102%20Safari/537.36

Hi all. I've tried to make this work any number of ways in Tivimate but just can't get it to play. Just to clarify, I'm making a m3u8 playlist file with the massive URL sniffed from 9NOW and then adding (pasting) that user agent extension at the end of the URL. Is that all that is required or is there something I'm missing. The URL plays fine in VLC but I just get 403 errors in Tivimate. Do I need to do some additional editing to the sniffed URL? I notice there's a "user agent" heading in Tivimate. Does that require any input? Thanks everyone for all the help.

trevor68 commented 2 months ago

I wouldn't waste any time on those links, they expire in a day or two. We need to wait for Matt to figure out how he wants to export the links from Kodi. On that front do you need any beta testers Matt?

LGSAM59 commented 2 months ago

I was able to use those links for Tivimate but as soon as advertising started it would stop the stream with errors , and also expire in a day or two .

coxy86 commented 2 months ago

Thanks Matt for that update. Appreciate the effort this has taken on your part

NormBurns commented 2 months ago

I finally managed to get these streams to work. Just had a couple of typos in my link but working now. #LGSAM, mine also goes a bit haywire at some add breaks and freezes. The weirdest thing is that this also happens on the 9now app on my TV. I need to change channels and change back and it's all good again. I think channel 9 have lost the plot?

matthuisman commented 2 months ago

i suspect is all due to "SSAI server side ad injection" which can be a mess and lots of players dont support it

nickw444 commented 2 months ago

Matt, I'm wondering if you had made any progress on that docker container that is able to mint these URLs. I'm running Jellyfin + Plex and Threadfin and hoping to get Channel 9 working once again πŸ˜„

Thanks so much for the work you do to keep these m3u's running, as someone with very poor TV signal in my area πŸŽ‰

matthuisman commented 2 months ago

no sorry. its not that high on my list. I support Kodi addons etc first :)

A lot of the stuff im working on should help with that task though :)

LGSAM59 commented 2 months ago

I finally managed to get these streams to work. Just had a couple of typos in my link but working now. #LGSAM, mine also goes a bit haywire at some add breaks and freezes. The weirdest thing is that this also happens on the 9now app on my TV. I need to change channels and change back and it's all good again. I think channel 9 have lost the plot?

The only steady stream I can get is on PC , Bugs out with ads on Firestick , LG TV app and Chromecast with Google TV.

Leatherface75 commented 2 months ago

I finally managed to get these streams to work. Just had a couple of typos in my link but working now. #LGSAM, mine also goes a bit haywire at some add breaks and freezes. The weirdest thing is that this also happens on the 9now app on my TV. I need to change channels and change back and it's all good again. I think channel 9 have lost the plot?

The only steady stream I can get is on PC , Bugs out with ads on Firestick , LG TV app and Chromecast with Google TV.

It's the old ffmpeg issue with discontinuity while showing commersials. Same issue as Pluto, SamsungTV, Plex etc with many streams.

LGSAM59 commented 2 months ago

I take it there are no work arounds for the ad insertion bugs ? seems worse on 9now

NormBurns commented 2 months ago

I need to update my links twice a day now. The only thing that works for watching is to change channels as soon as ads start and then change back to the original channel. This will keep your channel working until the next ad break. This is the same for me even when watching on the 9now app, so it seems like 8 have totally stuffed this up. I actually get less screen freezing in tivimate.

On Sat, 7 Sept 2024, 18:15 LGSAM59, @.***> wrote:

I take it there are no work arounds for the ad insertion bugs ? seems worse on 9now

β€” Reply to this email directly, view it on GitHub https://github.com/matthuisman/i.mjh.nz/issues/116#issuecomment-2335114264, or unsubscribe https://github.com/notifications/unsubscribe-auth/BK2V7CHIZJ7RPZY6ZMXHZ6LZVKYZ7AVCNFSM6AAAAABL3YHZCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZVGEYTIMRWGQ . You are receiving this because you commented.Message ID: <matthuisman/i. @.***>

ballfam commented 2 months ago

don't know if it works for what you are using, but I switched to streamlink a while back. It actually just uses ffmpeg under the hood, but it can handle those ad insertions. It can even handle Pluto

RedRubble commented 1 month ago

For those who might find this useful, here's a version of the script that dispenses with flask and just prints the url for the m3u8. I use this to pipe into streamlink and in turn into tvh. I've not changed the logic so all credits go to Matt and original person who created the modified script, i just made some changes to suit my needs. What this version will do is save copies of the access code and expiry, as well as cache all the URLs into json files, and read them each time the script is called. The script was tested under python 3.8.10 only.

9geturl.txt

I'm trying to get this to work, but getting a fetching error. I'm guessing i've got my token formatting wrong. How do you get this token? I've also changed to region to 'vic' and all 'syd' to 'mel'

smalldog666 commented 1 month ago

For those who might find this useful, here's a version of the script that dispenses with flask and just prints the url for the m3u8. I use this to pipe into streamlink and in turn into tvh. I've not changed the logic so all credits go to Matt and original person who created the modified script, i just made some changes to suit my needs. What this version will do is save copies of the access code and expiry, as well as cache all the URLs into json files, and read them each time the script is called. The script was tested under python 3.8.10 only. 9geturl.txt

I'm trying to get this to work, but getting a fetching error. I'm guessing i've got my token formatting wrong. How do you get this token? I've also changed to region to 'vic' and all 'syd' to 'mel'

I used the associated script that was posted earlier in this thread without changes to generate the token.

9acquire_refresh_token.txt

smalldog666 commented 1 month ago

For those who might find this useful, here's a version of the script that dispenses with flask and just prints the url for the m3u8. I use this to pipe into streamlink and in turn into tvh. I've not changed the logic so all credits go to Matt and original person who created the modified script, i just made some changes to suit my needs. What this version will do is save copies of the access code and expiry, as well as cache all the URLs into json files, and read them each time the script is called. The script was tested under python 3.8.10 only. 9geturl.txt

I'm trying to get this to work, but getting a fetching error. I'm guessing i've got my token formatting wrong. How do you get this token? I've also changed to region to 'vic' and all 'syd' to 'mel'

Also, you might want to leave the region and city as nsw and syd, to make sure you get a working token first, then change to get the vic and mel equiv streams.

i had not looked into the codes (nsw vs vic etc).. having said this, i just changed my script to have region as vic and channel 9 as live-ch9-mel-ssai, and i was able to get a valid stream back..

RedRubble commented 1 month ago

Also, you might want to leave the region and city as nsw and syd, to make sure you get a working token first, then change to get the vic and mel equiv streams.

i had not looked into the codes (nsw vs vic etc).. having said this, i just changed my script to have region as vic and channel 9 as live-ch9-mel-ssai, and i was able to get a valid stream back..

OK so I got this to work with the refresh token, with nsw syd, tried vic and mel and got no URL. I think I have different goals to most of you all here, as I'm using StreamMaster (basically tvheadend but only for iptv to add into Plex). I got a URL and added it in, but its reporting no streams avaliable (can download and watch via VLC though, so not sure if this is a nsw issue or something else). So one at another brick wall unfortunately, but I feel I'm close...

smalldog666 commented 1 month ago

Also, you might want to leave the region and city as nsw and syd, to make sure you get a working token first, then change to get the vic and mel equiv streams. i had not looked into the codes (nsw vs vic etc).. having said this, i just changed my script to have region as vic and channel 9 as live-ch9-mel-ssai, and i was able to get a valid stream back..

OK so I got this to work with the refresh token, with nsw syd, tried vic and mel and got no URL. I think I have different goals to most of you all here, as I'm using StreamMaster (basically tvheadend but only for iptv to add into Plex). I got a URL and added it in, but its reporting no streams avaliable (can download and watch via VLC though). So one at another brick wall unfortunately, but I feel I'm close...

If you changed the region, remove the cached_urls.json and rerun the script..

RedRubble commented 1 month ago

If you changed the region, remove the cached_urls.json and rerun the script..

Oh sweet that worked :P

smalldog666 commented 1 month ago

Also, you might want to leave the region and city as nsw and syd, to make sure you get a working token first, then change to get the vic and mel equiv streams. i had not looked into the codes (nsw vs vic etc).. having said this, i just changed my script to have region as vic and channel 9 as live-ch9-mel-ssai, and i was able to get a valid stream back..

OK so I got this to work with the refresh token, with nsw syd, tried vic and mel and got no URL. I think I have different goals to most of you all here, as I'm using StreamMaster (basically tvheadend but only for iptv to add into Plex). I got a URL and added it in, but its reporting no streams avaliable (can download and watch via VLC though, so not sure if this is a nsw issue or something else). So one at another brick wall unfortunately, but I feel I'm close...

I use tvh, and feed tvh links into plex.. reason i do this is i use pvrlive on android tv, which can pull the channels (and epg) from tvh.. so i get a native interface on the tv with all the channels and guide.. i only do plex live tv when i am not at home..

RedRubble commented 1 month ago

I use tvh, and feed tvh links into plex.. reason i do this is i use pvrlive on android tv, which can pull the channels (and epg) from tvh.. so i get a native interface on the tv with all the channels and guide.. i only do plex live tv when i am not at home..

So I tried adding that URL to the 'Networks' section in tvh, and reporting 0 muxes/services/mapped. Am I missing a step here? Thanks for your help!

smalldog666 commented 1 month ago

I use tvh, and feed tvh links into plex.. reason i do this is i use pvrlive on android tv, which can pull the channels (and epg) from tvh.. so i get a native interface on the tv with all the channels and guide.. i only do plex live tv when i am not at home..

So I tried adding that URL to the 'Networks' section in tvh, and reporting 0 muxes/services/mapped. Am I missing a step here? Thanks for your help!

I don't feed any m3u's directly into tvh.. i normally wash it with streamlink first... below is the shell script that i use.. i have a simple m3u (that's added to tvh's network tab) that basically call pipe://home/hts/nine/nine.sh with an argument of 9/9gem/9go/9life etc for each stream..

!/bin/sh

STREAMLINK=/usr/local/bin/streamlink PYTHON3=/usr/bin/python3 NINE=/home/hts/nine/9geturl.py URL=$PYTHON3 $NINE $1 $STREAMLINK --stdout --default-stream best --hls-audio-select "*" --ringbuffer-size 128M --stream-segment-threads 1 --stream-segment-attempts 2 --stream-segment-timeout 5 --hls-live-edge 6 --hls-segment-stream-data --url $URL

matthuisman commented 1 month ago

9 streams are now back in all playlists as they have removed the tokens. Must have been olympics only.

Closing this issue. See you all in 4 years! hehe

Remember to support me: https://www.matthuisman.nz/support-me

camkerr81 commented 1 month ago

No way!. well thats a win. I literally sent them a support request to remove their tokens stuff about an hour ago. Hahaha. what a coincidence.

nickw444 commented 1 month ago

Wow, thanks for looping back on this. I guess I'm surprised that they didn't keep it as an overall improvement as piracy protection for their regular content 🀷

phoenpc commented 1 month ago

Considering people had issues on 9now, I guess they had to rollback for the sake of their viewers instead of keeping it for good.

In either case this is so good to hear, love it. Thanks for the update.

NormBurns commented 1 month ago

Thanks so much for all your advice and support throughout all this Matt. I have certainly learned a lot about streams....!

LegendMASTER-2024 commented 1 month ago

Awesome stuff. Was tuning into the Newcastle and Northern Rivers streams, but just before the Olympics started, bye bye direct links, was sad. Now I am happy again, and can finally go back to these streams. NBN News and the regional advertising for both areas are the main key takeaways of these streams, otherwise programming is the same as the capital cities.

For anyone who's new here and are looking for the direct links to the (UPDATED) regional streams... https://9now-livestreams-fhd-t.akamaized.net/u/prod/simulcast/new/ch9/hls/r1/index.m3u8 https://9now-livestreams-fhd-t.akamaized.net/u/prod/simulcast/nlm/ch9/hls/r1/index.m3u8

Will these work with the capital cities too? Yes, of course. Just change the city name to "syd" for Sydney, "mel" for Melbourne, "bne" for Brisbane, "adl" for Adelaide, or "per" for Perth. And for the Gold Coast QTQ relay, "gcq" is the one for you.

nihonjin98 commented 1 month ago

Is there anything thst needs to be done for the urls to work? I an no longer getting a 403 error but now get a IllegalStateException error. I have updated the playlists; cleared the cache for the app. What else is needed to get then to work?

matthuisman commented 1 month ago

https://forums.whirlpool.net.au/thread/9kvl5k73?p=12#r74609953

On Thu, 12 Sept 2024, 21:07 nihonjin98, @.***> wrote:

Is there anything thst needs to be done for the urls to work? I an no longer getting a 403 error but now get a IllegalStateException error. I have updated the playlists; cleared the cache for the app. What else is needed to get then to work?

β€” Reply to this email directly, view it on GitHub https://github.com/matthuisman/i.mjh.nz/issues/116#issuecomment-2345700297, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPQAKPKH72KOGGH2BMA6JDZWFKWTAVCNFSM6AAAAABL3YHZCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBVG4YDAMRZG4 . You are receiving this because you modified the open/close state.Message ID: @.***>

coxy86 commented 1 month ago

I've been using sparkle and have had no issues since channel 9 streams have been updated by Matt. Using sparkle on nvidia shield fwiw

trevor68 commented 1 month ago

Yep, tivimate 5.1 problem, roll back to 5.04

psychocircus98 commented 1 month ago

Is there anything thst needs to be done for the urls to work? I an no longer getting a 403 error but now get a IllegalStateException error. I have updated the playlists; cleared the cache for the app. What else is needed to get then to work?

Do you find the error is consistent? I ask because if I first go to the new stream in Tivimate I get the error, but if I flick to another channel and back it typically works. Made me wonder if I needed to specify something further in the URL (browser type?) to avoid the issue but the above suggests a Tivimate 5.1 issue.