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

Is this still working? #7

Open
SolusCado opened this issue Mar 27, 2016 · 23 comments
Open

Is this still working? #7

SolusCado opened this issue Mar 27, 2016 · 23 comments

Comments

@SolusCado
Copy link

I'll tell you - I've learned more about python and Kodi in the last 48 hours than I ever really expected. I didn't know how to simply run the python scripts from the command line, as indicated in your readme, so I spent most of the weekend merging the code from this into your IP Stalker Plugin, in an attempt to get Kodi to run the web service. After fixing LOTS of indentation errors, I finally realized the python interpreter/compiler is built into OS X, and running the service really was as simple as your readme file indicated. Anyway....

None of the "Play" links seem to work. I tried updating line 96 of server.py with a URL I pulled directly from the mobile site for USTVNow (http://axp.ustvnow.com/i/46F4FWHTMUSTVNOW_DEF@25223/master.m3u8?hdnea=ip=50.249.26.206~st=1459090800~exp=1459119600~acl=/*~hmac=3ad422f3c1db4c81214cfebaac4977d282bf116d81c2dc9ac823940c3f63741e) as a test, and THAT worked. Anything else gives me that dreaded "error probing input format" error in the Kodi logs:

11:33:47 T:123145306673152 ERROR: Open - error probing input format, http://localhost:8787/playaT1odHRwJTNBJTJGJTJGbS51c3R2bm93LmNvbSUyRmltYWdlcyUyRldIVE0ucG5nJnE9MSZjPVdIVE0mdT1taWNoYWVsJTQwYmFpbGV5cG9pbnQuY29tJnA9Q2hlcmllLjA4MjQ=
11:33:47 T:123145306673152 ERROR: Previous line repeats 9 times.
11:33:47 T:123145306673152 ERROR: OpenDemuxStream - Error creating demuxer

So it appears to me that the get_link function is no longer retrieving the correct URLs - and that is why I ask if this is still working.

For my own edification, why don't you set the remote link directly in the channels.m3u? Why go through all the trouble of returning a local URL wrapper that then sends an RTMP link?

@AgileHumor
Copy link

AgileHumor commented May 29, 2016

I can't get this to work in Kodi. Server runs script, but it never the playing stream in Kodi.

Working:

  • The /play URLS in the M3U file will play OK if I use VLC...this is very weird as VLC works every time with the proper redirected to a rtmp://ilv52.ustvnow.com...

Not Working:

  • If I open the /play URL in Chrome, it gives me a error 500 after a timeout.
Error response

Error code 500.

Message: Internal Server Error.

Error code explanation: 500 = Server got itself in trouble.
  • If I open in Kodi IPTV in guide, same thing (well I don't see the 500 error, but it times out and doesn't play). This error in log:
ERROR: CCurlFile::Open failed with code 0 for http://192.168.0.10:8787/playredacted
18:25:24 T:5420   ERROR: XFILE::CFileCache::Open - failed to open source <http://192.168.0.10:8787/playredacted>
18:25:24 T:5420   ERROR: CDVDInputStreamPVRManager::Open - error opening [http://192.168.0.10:8787/playredacted]
18:25:24 T:5420   ERROR: CDVDPlayer::OpenInputStream - error opening [pvr://channels/tv/All channels/pvr.iptvsimple_778278445.pvr]

@SolusCado I believe the proxy is because the RTMP links constantly change. This way, it always has a valid link in your EPG in Kodi (it's never just been updated).

@mathsgrinds
Copy link

I've been searching for days for a script that works :P so I just made one... it's ugly, but it works.

https://github.com/mathsgrinds/ustvnow-iptv-m3u-playlist/blob/master/main.py

@jacknight
Copy link

Thanks @mathsgrinds ! Works like a charm. Gonna use this to try and DVR Jeopardy! tonight.

@mathsgrinds
Copy link

No problem J do you mind pointing me in the right direction for simple DVR addon’s for kodi (pi). I’m trying to record m3u8 streams too. Jeopardy and wheel of fortune is on too late for me here in Ireland J

@jacknight
Copy link

@mathsgrinds I've not been able to find one that works as I expected, yet. After getting the ustvnow m3u working thanks to your script, I realized that the PVR IPTV Simple Client doesn't actually record! As far as I can tell anyway. Very disappointed. I've yet to figure out a way to do it :/ Running Kodi on both Android (Fire TV Stick) and my Mac. No luck yet.

@mathsgrinds
Copy link

Yeah, I was surprised that you can’t record on Simple. I gave avcon (ffmpeg) a go, but it didn’t do a good job or recording the stream on my pi.

@mathsgrinds
Copy link

Hey, just wondering if you got sorted? I got it working with avconv and crontab. Need a hand?

@jacknight
Copy link

@mathsgrinds At the moment I was attempting to use Automator (on a Mac) with a screen capture tool with varying results... I would love to use avconv instead. I've never used it, and my first basic attempts are getting me "HTTP 403 forbidden" errors. How are you doing it?

@mathsgrinds
Copy link

Hi, I have the command at home, I can check. Are you getting the 403
error with wget? Or with avconv?

@jacknight
Copy link

With avconv:

e.g.
sudo avconv -i http://axp.ustvnow.com:80/i/867FFWHP0USTVNOW_DEF@128430/master.m3u8?hdnea=ip=87.228.158.193~st=1476079200~exp=1476108000~acl=/*~hmac=73a30e1488dbb6278d3d338bdf986da8d961be4d0cb152c2d556cca598f07a68

results in

avconv version 11.4, Copyright (c) 2000-2014 the Libav developers
built on Aug 2 2016 18:34:44 with Apple LLVM version 7.3.0 (clang-703.0.31)
[http @ 0x7fccd1c08b80] HTTP error 403 Forbidden
http://axp.ustvnow.com:80/i/867FFWHP0USTVNOW_DEF@128430/master.m3u8?hdnea=ip=87.228.158.193~st=1476079200~exp=1476108000~acl=/*~hmac=73a30e1488dbb6278d3d338bdf986da8d961be4d0cb152c2d556cca598f07a68: Input/output error

@jacknight
Copy link

If I use wget on the same link, it will download a playlist of each of the different quality streams. Then, if I use avconv on one of those http links, I still get 403 Forbidden.

@mathsgrinds
Copy link

Strange, that link doesn't quite seem right, I think you just need to
use the link the python code echos out (or the link in the strm files
it writes to) rather then that link.

@jacknight
Copy link

Same results using the links from the CBS.strm file (for example).

@mathsgrinds
Copy link

How strange, see, in my strm file the link looks like this:

http://ilv12.oedg.ustvnow.com/ilv01/smil:{SHORT CODE HERE}USTVNOW/playlist.m3u8?{LONG TOKEN CODE HERE}

I wonder why it doesn’t look like this for you. Is your account like a premium account or something? Then I just run

avconv -i “ABOVE LINK” -acodec copy -vcodec copy -t “LENGTH OF SHOW IN SECONDS” “FILE NAME”

@jacknight
Copy link

Hm... nope, free account. I'm still within the 45 days free of HD, though. I'll fiddle tomorrow. Thank you for the command line argument though, it will come in handy once this is all sorted.

@mathsgrinds
Copy link

Mine is an email too. Maybe it is a country thing? I'm logging in from
Ireland.

@jacknight
Copy link

Greece. Are you past the 45 HD free trial? That's my best guess so far.

@mathsgrinds
Copy link

Well past it J

@jacknight
Copy link

For whatever reason, ffmpeg (not avconv) seems to be able to handle the link in my CBS.strm file without any problem. I've tested a couple commands and it seems to record without any issue. Gonna take a stab at recording a couple shows tonight and see how it goes. Hopefully this will work, and if and when the link in my CBS.strm files starts looking like yours (say, after my HD trial is over), the command may continue to work without a hitch.

Either way, just wanna say thanks again for taking the time to grind out a workable script.

@mathsgrinds
Copy link

No problem J please note I found using mp4 as an output worked best.

Best of luck.

@jacknight
Copy link

jacknight commented Oct 20, 2016

Using mp4 as well. No hiccups first three nights this week; working beautifully. Gonna miss that HD when it goes, though!

For anyone who may stumble on this, my final command that I have in my cron (the show airs at 2am in my timezone, and airs on Saturday nights as well) is:

00 02 * * 2-7 cat /.../CBS.strm | xargs -I {} /usr/local/bin/ffmpeg -i {} -t 1800 “/.../TV/Wheel of Fortune/Wheel.Of.Fortune.Sdate +%YEdate +%m%d.mp4" 2> “/.../Wheel-date +%Y%m%d.log"

30 02 * * 2-7 cat /.../CBS.strm | xargs -I {} /usr/local/bin/ffmpeg -i {} -t 1800 "/.../TV/Jeopardy/Jeopardy.Sdate +%YEdate +%m%d.mp4" 2> "/.../Jeopardy-date +%Y%m%d.log"

The file comes out as "Wheel.Of.Fortune.S2016E1020.mp4" so Plex will pick it up as Season 2016, Episode 1020 (the date, October 20th).

NOTE: I probably could have done without using xargs there, but I have a bad xargs habit and who are you to question something that works! However, these commands would probably work just as well (untested):

00 02 * * 2-7 /usr/local/bin/ffmpeg -i cat /.../CBS.strm -t 1800 “/.../TV/Wheel of Fortune/Wheel.Of.Fortune.Sdate +%YEdate +%m%d.mp4" 2> “/.../Wheel-date +%Y%m%d.log"

30 02 * * 2-7 /usr/local/bin/ffmpeg -i cat /.../CBS.strm -t 1800 "/.../TV/Jeopardy/Jeopardy.Sdate +%YEdate +%m%d.mp4" 2> "/.../Jeopardy-date +%Y%m%d.log"

And of course make sure your computer is awake at that time. This can be done on a Mac in System Preferences > Energy Saver > Schedule

@mathsgrinds
Copy link

Those are the ones I record too :) lol

@Theangelboii
Copy link

Hi guys!!
I'm new at this here, I have been searching for something like this for a long time :( im looking for a script for psvue to watch usa channels is there anyone who can help me ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants