Results 1 to 8 of 8

Thread: SchedulesDirect using Powershell

  1. #1
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    207

    SchedulesDirect using Powershell

    Hello. I'm trying to access the SD token needed for schedules access using Windows Powershell.

    If anyone has any experience or wisdom on how to do this, I would appreciate the help.

    This is what I've tried so far but with no success:

    $sdUID = 'abcdef'
    $sdPW = Get-StringHash -String "123456" -HashName "SHA1"
    $sdPW = $sdPW.ToLower()
    $jhsdLogin = @{"username"= $sdUID; "password"= $sdPW} | ConvertTo-Json

    $sdUAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer
    $sdContentType = "application/json;charset=UTF-8"

    $sdToken = Invoke-WebRequest -Uri https://json.schedulesdirect.org/20141201/token -UseBasicParsing -Method Post -Body $jhsdLogin -UserAgent $sdUAgent -ContentType $sdContentType -Debug

    This snippet results in "400 Bad Input."

    I've also posted on the SchedulesDirect Developer forum.

    Thank you.
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - AMD HD6670 Video
    Software: Win 10 Pro(Creators) - NextPVR - WinTV8 - Total Media Extreme - VLC
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

  2. #2
    Join Date
    May 2006
    Location
    Canada
    Posts
    25,771
    I can't help with the code but a while back XP users had troubles and it was noted that SD load balancers started to reject TLS 1.0 and I am not sure that you should be using the SHA1 hash

    If you don't require security for your password change to http:// will be simpler.

    Martin

  3. #3
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    207
    Thanks, Martin. I've taken up this issue with SD and Mr. K has generously agreed to help find out what I'm doing wrong. All the SD documentation shows that the password should be SHA1 encrypted. Maybe the documents are wrong and I hope that Mr K will see that.
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - AMD HD6670 Video
    Software: Win 10 Pro(Creators) - NextPVR - WinTV8 - Total Media Extreme - VLC
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

  4. #4
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    207
    My helper from SchedulesDirect seems to be rather busy of late which I can understand. So...

    sub, would you be kind enough to post the code snippet you use to request a token from SD? Any language.

    Thanks.
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - AMD HD6670 Video
    Software: Win 10 Pro(Creators) - NextPVR - WinTV8 - Total Media Extreme - VLC
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

  5. #5
    Join Date
    May 2006
    Location
    Canada
    Posts
    25,771
    The reference Java source is available at https://github.com/SchedulesDirect/mfdb-json

    Martin

  6. #6
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    207
    Thanks to all who responded.

    I have finally hacked the code to retrieve a token. All data in SchedulesDirect is now available for retrieval and examination. Now I *really* gotta learn Powershell a LOT better! But it's lookin' good!
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - AMD HD6670 Video
    Software: Win 10 Pro(Creators) - NextPVR - WinTV8 - Total Media Extreme - VLC
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

  7. #7
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    84,521
    Quote Originally Posted by jcole998 View Post
    sub, would you be kind enough to post the code snippet you use to request a token from SD? Any language.
    Sorry, I've been travelling the last 10 days, so didn't have a chance to respond to this. It sounds like you've got it sorted now.

  8. #8
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    207
    Hi, sub, and welcome back. Ten days on the road has to be draining, business or pleasure!

    Yeah, I've got SD under control and the data is amazing! A password hash was stopping me, but I've got that beat. Learning Powershell is now the challenge.

    Thanks for checking in!
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - AMD HD6670 Video
    Software: Win 10 Pro(Creators) - NextPVR - WinTV8 - Total Media Extreme - VLC
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •