Download Videos to your Windows PC (Open Source Code)

Hello All,

This is for those that want to view videos or archive their videos to their local Windows PC. I am aware another excellent member has kindly created an online web viewer, but many are wary of where data is sent to.

Requirements:
General knowledge level of Windows command (shell/prompt).
Windows Powershell - Windows 7/10 users, you should already have Windows Powershell installed. For older versions, please see official Microsoft site.
IFTTT Integration Already Enabled

Security:
You can verify every line of code yourself (and modify as you see fit) to make sure you know where your data is being sent to. The URL link where data is sent to is the same exact link when IFTT asks for permission to link to Blink.

Instructions
https://github.com/nayrk/Blink/blob/master/README.md

Windows Powershell Code
https://github.com/nayrk/Blink/blob/master/BlinkVideoDownloader.ps1

Credits for Blink API Information (Has Python Code Video Downloader for MAC OS/Linux Users): https://github.com/MattTW/BlinkMonitorProtocol

P.S. - I’m a system / network administrator and not a programmer/developer. Be gentle on my code :smile:

6 Likes

Interesting. Thanks for posting.

I’ll probably check it out.

And just so I’m clear how it works, this is something to run and download right then. As in, it doesn’t schedule or automatically copy or anything. That’s not a criticism - not by a longshot! Just want to make sure I understand what it is supposed to do.

Yes. You will have to run this every time you want to get newly uploaded videos from Blink. You can also schedule this on Microsoft Windows scheduler if you want. You may need to remove the word “pause” at the very end of the code.

My personal reasoning without releasing a prompted user/password and automation is due to the fact I wanted the user to copy/edit the code. This is just my way letting the community to approve/verify the validity/security of the code.

Well, fortunately for me, the code is elegantly simple. :slight_smile: I’m no expert, though. Thank you for sharing it.

That’s good to hear. Please let me know if encounter any issues.

Also, forgot to mention there are two URLs used in the code, both of which are signed and issued by Amazon if you check the SSL Certificate from your web browser when clicking on the “Lock” Icon.

Login URL:
https://rest-prod.immedia-semi.com/ (Redirected from https://prod.immedia-semi.com)

Videos/Others:
https://rest-u004.immedia-semi.com/ (Region changes based on your country…?, u004 is United States)

Hello Ryan

Thanks for this. As mentioned, the code is sufficiently clear, so as to at least see what is going on. Thank you for doing this work.

Now, if I could indulge you for an additional request. Nutcracker’s web based solution, before he took it down, due to the identified security issue, had an option to download the snapshots, or thumbnails, that show in the app to identify each camera. Do you know where these are, and could you include a section in your script to bring these down too?

Although I can follow the script, I wouldn’t be able to create a section of my own to get the thumbnails, even if I knew where they were.

Thanks again for your efforts.

No worries. I have updated the code to add the thumbnail for each camera. Not sure why you want it though :smile:
Maybe I am missing something for the use of it? Let me know! Thanks.

https://github.com/nayrk/Blink/blob/master/BlinkVideoDownloader.ps1

Happy to let you know Ryan, and thank you for the new code. I’ll try it momentarily.

I have a system deployed at a remote fishing cabin. It serves two purposes, one for security, and two for river fishing levels. When I use the app, I can take a new screenshot of the river, from my ‘river cam’, and when I can download that to a PC, I can see it sufficiently clearly to tell exactly what the state of the water is, and whether any given planned fishing trip is worth it or not. All three cameras serve as security, but the river cam in particular is the most important to me. Seeing these small thumbnails only on the phone, with writing and tools on them too, is not good enough for me.

If I could do record on demand, I could screenshot a downloaded video, or even just watch it, which would give me more info, but I can’t anyway, and I really want to maximise battery life for the camera in this location, with it being high up a tree, and over the river, so a quick pic will be best for battery life, even if record on demand were available.

See below for an example image.

Wow :open_mouth:! That is quite the use case there. Thanks for sharing in detail and happy fishing.

Also, for the file name of the thumbnail, it will be in the format: “thumbnail_<unique_blink_name>”. I’m using the same name as what Blink has saved on their servers with “thumbnail_” attached to the front of the name. Be sure to mind the timestamp at the end of the filename. Unfortunately I am unable to locate, if it even exists, the thumbnail timestamp from Blink. Only videos have a timestamp. So please be mindful of the timestamp in the filename when you do use it for fishing :slight_smile:

e.x. - thumbnail_clip_tUB8U1Mo_2018_12_27__20_18PM.jpg

If you have any more ideas or requests, I am more than happy to try and implement them if it is within my ability.

Hello Ryan

Yes, maybe quite unusual, but I can imagine many similar needs, if not specifically for fishing. Has to be said though, in the vast majority of cases, I would think a quick glance on the phone would normally be good enough. From my perspective, if it were possible to invoke the taking of a high res image, which could then be downloaded, I could even get the camera to show an actual river level monitor, such as a stick, lol.

Not sure why, but having replaced the code in my script file, I got no thumbnails in the Blink directory created, when I ran it. I deleted one video, just to make sure the rest was still working, and I ran it again. I got the deleted video back on my desktop, but still no thumbs. Maybe something is not quite right, or maybe me being in the UK affects it?

Thanks for your efforts, and for the well wishes regarding fishing trips. Nice one.

Hello!

Oh that is no good. I’m glad you got the code working for the videos though. I am in the United States which is the only location I can test against.

I can give you a few output statement code for you to help me debug on your end so I can see the full image link to see what is different, but I would like to take this outside of this thread :slight_smile:

Please message me directly if you would like to pursue this. Meanwhile, I will keep checking on my end, but so far it is working as expected for me.

1 Like

PM sent, and thank you again.

nayrk
getting and error of invalid credentials, have inserted my email and pass?
Invoke-RestMethod : {“message”:“Invalid credentials”,“code”:200}
At C:\Users\Miked\Desktop\blink.ps1:53 char:13

  • $response = Invoke-RestMethod -UseBasicParsing $uri -Method Post -Hea …
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
      Invalid credentials provided. Please verify email and password.
      Supermicr

Hello Supermicr,

Please be sure you have set it correctly and exactly like below. Quotes are required.

$email = “test_email@gmail.com
$password = “SecretPassword”

Code has been updated as of 12/29/2018 5:25 Pacific Time. Please verify and use new code if you have multiple sync modules attached to your account.

https://github.com/nayrk/Blink/blob/master/BlinkVideoDownloader.ps1

2 Likes

nayrk
I changed my password, it had a special symbol as the first character, has no special characters now. Still getting the invalid credentials. I used the get variable to display what is being sent.
Name Value


$
? True
^
args {}
blinkAPIServer prod.immedia-semi.com
body {…
ConfirmPreference High
ConsoleFileName
DebugPreference SilentlyContinue
email xxxxxxandmmmm@gmail.com
Error {{“message”:“Invalid credentials”,“code”:200}, {“message”:“Invalid credentials”,“code”:200}}
ErrorActionPreference Continue
ErrorView NormalView
ExecutionContext System.Management.Automation.EngineIntrinsics
false False
FormatEnumerationLimit 4
headers {Host, Content-Type}
HOME C:\Users\Miked
Host System.Management.Automation.Internal.Host.InternalHost
InformationPreference SilentlyContinue
input System.Collections.ArrayList+ArrayListEnumeratorSimple
LASTEXITCODE 0
MaximumAliasCount 4096
MaximumDriveCount 4096
MaximumErrorCount 256
MaximumFunctionCount 4096
MaximumHistoryCount 4096
MaximumVariableCount 4096
MyInvocation System.Management.Automation.InvocationInfo
NestedPromptLevel 0
null
OutputEncoding System.Text.SBCSCodePageEncoding
password xxx54321
PID 6324
profile C:\Users\Miked\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
ProgressPreference Continue
PSBoundParameters {}
PSCommandPath
PSCulture en-US
PSDefaultParameterValues {}
PSEdition Desktop
PSEmailServer
PSHOME C:\Windows\System32\WindowsPowerShell\v1.0
psISE Microsoft.PowerShell.Host.ISE.ObjectModelRoot
PSScriptRoot
PSSessionApplicationName wsman
PSSessionConfigurationName http://schemas.microsoft.com/powershell/Microsoft.PowerShell
PSSessionOption System.Management.Automation.Remoting.PSSessionOption
PSUICulture en-US
psUnsupportedConsoleApplica… {wmic, wmic.exe, cmd, cmd.exe…}
PSVersionTable {PSVersion, PSEdition, PSCompatibleVersions, BuildVersion…}
PWD C:\Users\Miked\Desktop
saveDirectory C:\Users\Miked\Desktop
ShellId Microsoft.PowerShell
StackTrace at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)…
true True
uri https://prod.immedia-semi.com/login
VerbosePreference SilentlyContinue
WarningPreference Continue
WhatIfPreference False

Supermicr

Hello Supermicr,

Are you located in the US or UK or elsewhere?
Can you verify your credentials are the ones you use for the Blink App?
If you are currently using, or have used IFTTT Integration.
Can you verify the “Login Page” from what IFTT does when linking Blink?
The URL for that page that Blink uses to “Grant Access” to IFTTT will be one the following servers listed below. Screenshot below for reference.

You can also try changing the Blink Login Server:
$blinkAPIServer = 'prod.immedia-semi.com' to $blinkAPIServer = 'prde.immedia-semi.com'

“prde” is supposedly the other server used to server other regions outside of the US.

Quick note on this. I just tried to run this while on a public wifi and got a ton of errors, beginning with an authentication error. It appears that the wifi uses some whitelist/blacklist arrangement for the connection, which caused errors that looked like authentication problems.

Just another data point.

Hello Tperkinsesq,

You are correct in that free public wifi providers uses a security appliance known as content/web filters which intercepts the traffic for blacklisting before it goes out to the internet.

Also, I would highly suggest not using any public wifi to access any of your private accounts such as bank accounts, work resources, and even Blink, etc… Your data is not encrypted between you and the access point router unless you use a VPN connection. You should stick with using 4g/3g from your cellular network which is encrypted.

nayrk
In the US
Credentials are good
I am not using IFTTT, will set that up and try again
Thanks for your help and quick response
Supermicr