Jump to content


Photo

NextPVR & Schedules Direct

NextPVR Schedules Direct AutoIt LiveTv Curl Logo Icon

  • Please log in to reply
20 replies to this topic

#1 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 11 September 2015 - 12:19 AM

What this solves:

  • Adding Channel Schedules in bulk to NextPVR
  • User Friendly Channel Names
  • Cleans up Channel Names
  • Prune Channels by Language
  • Download Channel Icons/Logos

Requirements:

References:

 

Notes:

I wrote this against two HDHomeRun Primes (Comcast Cable), so not sure how it will fair with OTA & Satellite. One might also be able to alter this script to work with other services, but since I don't have access to others, I can't add support for them.

 

How:

This is made up of two scripts, one will download & prep 1 or more JSON Channel lineups that you created on your Schedules Direct Account. The other will import information from one of the Lineups, into the data scrapped from a fresh Channel listing XML made by NextPVR, and output a new XML along with downloading all the Icon's\Logo's that Schedules Direct has to offer.

 

Instructions:

Install AutoIt and set it to execute scripts when double clicked.

 

Now Right Click on desktop and select "New\Folder" from the context menu, and Rename it "NextPVR Stuff"

 

Now download & extract Curl and FSUM into "NextPVR Stuff"

 

Now in "NextPVR Stuff" Right Click on the background and select "New\AutoIt v3 Script" from the context menu, and Rename it "Schedules Direct LineUp's.au3"

 

Now Right Click "Schedules Direct LineUp's.au3" & select "Edit Script" from the context menu.

 

Now paste the following code into:

 

Spoiler

 

Be sure to edit the values of $sUserName  and $sUserPassword to match what is used for your Schedules Direct account.

 

Now save the script & execute it by double clicking it and if all went well...then you should now see one or more txt files that are prefixed with "[LineUp]", these are the lineups you setup on your account.

 

Okay at this point one needs to fire up NextPVR.

 

Now with NextPVR open, Right Click on the background and select "Settings" from the context menu.

 

With the Settings Dialog open, Click Devices on the ListView on the left side of the dialog.

 

Select one of your Devices from the ListView on the right, it should be marked as Present & Enabled, (if it doesn't list any Channels, please Click the "Device Setup" Button, then perform a scan by Clicking the "Scan" button, then Click the "OK" button) with the device selected Click the "Export Channels" Button, when the Export Dialog comes up save the file to the location you have "NextPVR Stuff" which according to the instructions I've been giving should be on your Desktop.

 

Once you saved off the file and are back to the Settings dialog, Click the Channels item in the ListView on the left side.

 

With the Channels ListView now shown on the right, select one of the channels and Click the "Details" Button.

 

When the "Channel Details" Dialog pops up, in the EPG Source Group control, select "Schedules Direct"  from the Source comboBox...this should if I recall prompt you for your Schedules Direct account information...when it's done for the first time. After that set things to whatever...as it doesn't really matter...the main purpose is to have your Account info added to NextPVR's config...which I currently don't know the type of encryption used...so I can't automatically add it for you...via a script. Hence...doing this manually now.

 

So Click all the "OK" buttons till you are back to the main NextPVR form...now close NextPVR...as we are done with it for now.

 

Now in "NextPVR Stuff" Right Click on the background and select "New\AutoIt v3 Script" from the context menu, and Rename it "Merge Schedules Direct.au3"

 

Now Right Click "Merge Schedules Direct.au3" & select "Edit Script" from the context menu.

 

Now paste the following code into:

 

Spoiler

 

You will now need to edit some of the variables, at the top of the script, to match what you have or want:

 

$sArtPath

  • this is where your logo's are for NextPVR to make use of them

$sBuffer1

  • this is your Schedules Direct Lineup that you intend to use

$sBuffer2

  • this is the xml with the list of channels detected by NextPVR

$sLangsOnly

  • leave this empty if you do not wish to prune any langs...if you do however wish to remove other langs, add all the langs you wish to keep, but split them with a comma

$bRemoveParentheses

  • this will remove anything in paren's...review your Schedules Direct file to help decide if you wish to prune these or not

$bSplitOnDash

  • this will remove the dash and anything on the right side of it, note that a space must be both before and after the dash, for a split to occure

 

Now save the script & execute it by double clicking it and if all went well...then you should see a bunch of images in the path you set for $sArtPath, and a new file called "New.xml" that is ready to be imported into NextPVR.

 

Alright time to fire up NextPVR once again.

 

Now with NextPVR open, Right Click on the background and select "Settings" from the context menu.

 

With the Settings Dialog open, Click Devices on the ListView on the left side of the dialog.

 

Select one of your Devices from the ListView on the right, (it should be marked as Present & Enabled) now Click "Device Setup" Button, and wait for the new dialog to open, once open Click on the first channel in the ListView, then scroll down to the last and SHIFT + Click on it, then Click on the "Delete" Button followed by the "OK" Button. Once the dialog closes repeat this for every Device you intend to apply a new Channel List to.

 

Select one of your Devices from the ListView on the right, now Click the "Import Channels" Button and navigate to the "NextPVR Stuff" folder, and select "New.xml", then Click the "Open" Button. Repeat this for every device this channel list applies to.

 

Once done with that, Click the Channels item in the ListView on the left side.

 

With the Channels ListView now shown on the right, Click the "Update EPG" Button, then wait till the update is complete, and Click the "OK" Button to close out the Settings dialog.

 

Now when you select the "TV Guide" on the main NextPVR form...you should be greated with all your show info, pretty names...and hopefully a bunch of icons. :)


Edited by Nologic, 03 October 2015 - 08:02 PM.

  • Luke and VladTepz like this

#2 VladTepz OFFLINE  

VladTepz

    Advanced Member

  • Members
  • 74 posts
  • Local time: 02:14 PM

Posted 12 September 2015 - 07:20 AM

Nice :)

Tried it out yesterday & it worked pretty well.

 

A Few Notes:

  • I needed to use Curl with SSL
  • I needed to add the -k switch to all the curl commands in "Schedules Direct LineUp's.au3" to allow "insecure" SSL connections because Schedules Direct was failing on the certificate check.
    RunWait( @ComSpec & ' /c curl.exe -k ...

     

  • Before importing the "New.xml", I needed to remove all existing channels.

 

Other than that, worked well...Thanks :)


  • Nologic likes this

#3 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 12 September 2015 - 05:11 PM

Doh! I completely forgot about removing the channels. The issues with Curl I wasn't aware of because of the build I grabbed had SSL & came with a Cert.

 

Many thanks for a very complete bug report, and sorry you had to trouble shoot things to get it to work correctly.


Edited by Nologic, 12 September 2015 - 05:26 PM.

  • VladTepz likes this

#4 rkulagow OFFLINE  

rkulagow

    Advanced Member

  • Members
  • 143 posts
  • Local time: 01:14 PM

Posted 14 September 2015 - 10:40 PM

The Schedules Direct certificate should be valid; it was generated / authenticated by a valid issuer. If you can let me know what's failing with curl then I can try to see what's happening.



#5 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 15 September 2015 - 03:47 PM

Howdy, it has more to do with Curl being able to validate a websites Cert.

 

The build I used came with a file to validate web certs.

 

Here is the head of the file, along with one cert...from a collection of many in the file:

##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Jun 20 20:21:50 2015
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt).  This file can be found in the mozilla source tree:
## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt
##
## It contains the certificates in PEM format and therefore
## can be directly used with curl / libcurl / php_curl, or with
## an Apache+mod_ssl webserver for SSL client authentication.
## Just configure this file as the SSLCACertificateFile.
##
## Conversion done with mk-ca-bundle.pl version 1.25.
## SHA1: ed3c0bbfb7912bcc00cd2033b0cb85c98d10559c
##


Equifax Secure CA
=================
-----BEGIN CERTIFICATE-----
MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE
ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT
B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR
fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW
8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG
A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE
CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG
A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS
spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB
Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961
zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB
BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95
70+sB3c4
-----END CERTIFICATE-----

So since I had such a file, and I didn't run into the error like VladTepz did, you can safely deduce that your Cert is indeed valid.

 

You can find out more about this file from here and here.

 

Oh and a quote from here.

 

10.2 Certificates

In the HTTPS world, you use certificates to validate that you are the one you claim to be, as an addition to normal passwords. Curl supports client- side certificates. All certificates are locked with a pass phrase, which you need to enter before the certificate can be used by curl. The pass phrase can be specified on the command line or if not, entered interactively when curl queries for it. Use a certificate with curl on a HTTPS server like:

 curl --cert mycert.pem https://secure.example.com

curl also tries to verify that the server is who it claims to be, by verifying the server's certificate against a locally stored CA cert bundle. Failing the verification will cause curl to deny the connection. You must then use --insecure (-k) in case you want to tell curl to ignore that the server can't be verified.

More about server certificate verification and ca cert bundles can be read in the SSLCERTS document, available online here:

 http://curl.haxx.se/docs/sslcerts.html

At times you may end up with your own CA cert store and then you can tell curl to use that to verify the server's certificate:

 curl --cacert ca-bundle.pem https://example.com/


#6 Damstas OFFLINE  

Damstas

    Advanced Member

  • Members
  • 195 posts
  • Local time: 07:14 PM

Posted 22 September 2015 - 04:12 PM

"Now save the script & execute it by double clicking it and if all went well...then you should now see one or more txt files that are prefixed with "[LineUp]", these are the lineups you setup on your account."

This seems to only work for North America, since you can't configure lineups in the Schedules Direct site outside NA. It should be done in an app.


Edited by Damstas, 22 September 2015 - 04:13 PM.


#7 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 23 September 2015 - 07:52 PM

You are correct, the original script only works for North America...I'm looking into making an alternate version that should ideally work for everyone supported by Schedules Direct.

 

Keep in mind my use of Curl is novice level at best...so might fail. Given the API only has examples for Postman...which is honestly better than nothing. :)

 

By app I'm assuming you mean a GUI based one...not sure that is required...but I'm sure a lot of users would feel far more comfortable with controls to interact with...rather than editing variables...for some programming lang they likely know little about. So we'll see how smoothly things go and if I feel up to or feel its worth doing a full blown GUI...right now just need to see if I can make something work.



#8 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 30 September 2015 - 08:49 PM

Okay I started this a little while ago...but had to spend a little time in the hospital so...kind of delayed getting this out the door.
 
So below is the code for a rough GUI to handle all the regions and countries that Schedules Direct supports. This basically replaces the first script at the top of the thread.
 
At present the code doesn't do a good job of try\catch for errors...just gives a weak reason why things went wrong & bails...I'll likely fix this later on.
 
Also when you press a button, I don't give decent feedback at present that the app\script is waiting on a reply from Schedules Direct...so give things a few seconds after clicking.
 
Anyways so it's rough...but works generally.

 

Spoiler

 

*Update 1*

Fixed UTF-8 issue as remarked upon by rkulagow


Edited by Nologic, 03 October 2015 - 08:05 PM.


#9 Nologic OFFLINE  

Nologic

    Advanced Member

  • Members
  • 98 posts
  • Local time: 10:14 AM

Posted 03 October 2015 - 03:35 PM

Note if you are not interested in icons and the other odd ball options my scripts offer...but just want to bulk assign Schedules Direct to all the channels you have in NextPVR, checkout this video that sub pointed out to me.

 

 

Please note that sub has downloading icons lined up for a future release of NextPVR yay! After that a few more options and we can toss my scripts in the trash bin. :)


Edited by Nologic, 03 October 2015 - 03:37 PM.

  • Luke likes this

#10 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 02:19 PM

G'day...I just came accross this thread but noticed that it is 2 years old. Any way I was wondering if you have done any more work on this project because this is just what I have been looking for. I would like to have a way to download all the icons instead of hunting them down individually. I tried out your setup but it failed to write the text file. If this proggy is no longer valid can you direct me to another program which would accomplish the same thing? I have scoured the Internet and have found some possibilities but they turned out to be of no use to me. Thanks in advance...Cheers!



#11 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138295 posts
  • Local time: 02:14 PM

Posted 06 September 2018 - 02:44 PM

What kind of tuner do you have?



#12 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 04:05 PM

Hauppauge Quad Tuner



#13 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 138295 posts
  • Local time: 02:14 PM

Posted 06 September 2018 - 04:14 PM

Ok, you know that you can use this directly in Emby without Next PVR, right?



#14 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 04:17 PM

Wow no I didn't. So will it download all my channel logos and put them in a folder someplace?



#15 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 04:20 PM

Okay, I am going to assume tat it does since that was my main bjective. I will give that a go in a minute and see if it does. I remember using Emby a while back but couldn't recall if the channel logos were in a seperate file. Thanks. Cheers!

 

Just to be clear, tis is what I am after, nice colorful logos.

 

5b918cc3b326d_EmbyEPG.png

 


Edited by snaitaz@aol.com, 06 September 2018 - 04:23 PM.


#16 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3392 posts
  • Local time: 07:14 PM
  • LocationWarrington,UK

Posted 06 September 2018 - 04:21 PM

yes

 

make sure you have wintv installed and upto date etc and things setup in wintv correctly

 

then add your tuner and epg provider to emby

 

and you should be good to go



#17 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 04:25 PM

Got it. So are the logos based on what the provider has since I have noticed that SD does not have coloful ones just mainly blackground logos.



#18 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3392 posts
  • Local time: 07:14 PM
  • LocationWarrington,UK

Posted 06 September 2018 - 04:48 PM

i think they come from SD - you can replace the images on the channel tab of LiveTV if you want different ones



#19 ErikaJ OFFLINE  

ErikaJ

    Advanced Member

  • Members
  • 263 posts
  • Local time: 01:14 PM

Posted 06 September 2018 - 05:08 PM

Thanks. So basically the logos are in the metadata and not in .png or similar format in a folder.


Edited by snaitaz@aol.com, 06 September 2018 - 05:10 PM.


#20 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 3392 posts
  • Local time: 07:14 PM
  • LocationWarrington,UK

Posted 06 September 2018 - 06:14 PM

they are but finding them would take time - just replace them with what you like







Also tagged with one or more of these keywords: NextPVR, Schedules Direct, AutoIt, LiveTv, Curl, Logo, Icon

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users