mmmmmtasty / SportScanner

Scanner and Metadata Agent for Plex that uses sportdb
101 stars 31 forks source link

NBA powershell broken #18

Closed zag2me closed 7 years ago

zag2me commented 7 years ago

Now that the season has restarted, looks like there is an error with the NBA.com API.

PS C:> .\nba.ps1 Invoke-WebRequest : Access Denied You don't have permission to access "http://stats.nba.com/stats/scoreboard/?" on this server. Reference #18.1e6f5668.1478959690.724c4e8 At C:\nba.ps1:38 char:17

zag2me commented 7 years ago

Some info and possible fix here, something about setting the referal header. I wonder if thats even possible in Powershell?

https://www.reddit.com/r/nba/comments/3k91g5/finally_some_documentation_for_the_statsnbacom_api/

mmmmmtasty commented 7 years ago

Fixed, pull the latest version.

zag2me commented 7 years ago

Getting a new error now

Invoke-WebRequest : The 'Referer' header must be modified using the appropriate property or method. Parameter name: name At C:\Parse-NBA.ps1:15 char:11

mmmmmtasty commented 7 years ago

What version of powershell are you using? (type $psversiontable in your powershell console) it works on mine, Windows 10,powershell 5.1.

On Sun, 13 Nov 2016, 6:37 p.m. Zag, notifications@github.com wrote:

Getting a new error now

Invoke-WebRequest : The 'Referer' header must be modified using the appropriate property or method. Parameter name: name At C:\Parse-NBA.ps1:15 char:11

  • $teams = (Invoke-WebRequest $teamUrl -WebSession $websession | ConvertFrom-Json) ...
  • 
    - CategoryInfo : NotSpecified: (:) [Invoke-WebRequest],
    ArgumentException
    - FullyQualifiedErrorId :
    System.ArgumentException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/mmmmmtasty/SportScanner/issues/18#issuecomment-260203280, or mute the thread https://github.com/notifications/unsubscribe-auth/ANdfTrhihIW7SSiikUYWjOtHLIlpIhBzks5q91iWgaJpZM4KwbRU .

zag2me commented 7 years ago

Windows 2008 so Powershell 3.0

I'm guessing it can't do that.

I'll investigate upgrading.

mmmmmtasty commented 7 years ago

Can you add the following between line 11 and 12 and send me the output?

$websession return

zag2me commented 7 years ago

output.

Headers : {} Cookies : System.Net.CookieContainer UseDefaultCredentials : False Credentials : Certificates : UserAgent : Mozilla/5.0 (Windows NT; Windows NT 6.0; en-GB) WindowsPowerShell/3.0 Proxy : MaximumRedirection : -1

No go on the upgrade unfortunately. This page seems to indicate 3.0 is the last Powershell version available for 2008 :(

http://social.technet.microsoft.com/wiki/contents/articles/21016.how-to-install-windows-powershell-4-0.aspx

I'm guessing the function was introduced in 4.0

zag2me commented 7 years ago

Should be moving to a new 2016 server soon so I will get this up and running as soon as possible ;)