nayrk / Blink

Amazon Blink Video Downloader
60 stars 23 forks source link

Invoke-RestMethod : {"message":"Unauthorized Access","code":101} #9

Closed locvez closed 4 years ago

locvez commented 4 years ago

This has been working okay for me over the last week or two but I now get the following error: - I have made no changes to the script.

Invoke-RestMethod : {"message":"Unauthorized Access","code":101} At N:\media\camera\BlinkVideoDownloader.ps1:89 char:15

  • ... ync_units = Invoke-RestMethod -UseBasicParsing $uri -Method Get -Head ...
  • 
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
    eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
    Invoke-RestMethod : {"message":"Unauthorized Access","code":101}
    At N:\media\camera\BlinkVideoDownloader.ps1:139 char:17
  • ... $response = Invoke-RestMethod -UseBasicParsing $uri -Method Get -Head ...
  • 
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
    eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
TeagenSirrus commented 4 years ago

I am getting the same error. Why won't the let us just mass download with ease?!

locvez commented 4 years ago

To resolve the issue, comment out line 78 shown below. I have forked and submitted a pull request to fix this issue.

# Headers to send to Blink's server after authentication with our token
$headers = @{
   # "Host" = "$blinkAPIServer" <- THIS is line 78, comment this out. Now it works
    "TOKEN_AUTH" = "$authToken"
}
locvez commented 4 years ago

clicked close in error.

nayrk commented 4 years ago

Thanks.