Code Injection that Allows Download of Custom Clips on Frigate 0.12 #9199
MrCaspan
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have seen that others have had the same issue that I had that if you have recordings but no events there seemed to be no easy way to download a copy of that recording. I found out that there is a back end system that allows you to manually download records but if you are not a techy person then this can be difficult and it required converting dates and times to Unix time stamps... So I careted a chunk of code that when injected into a cameras recording page it will allow you to download that 1 hour recording that you are currently on. It does require that you install a Chrome Plugin so that you can inject the code to the page but all the code is commented to exapling what it is doing!! This in no way affects Frigates base code its just get the current URL and generates a URL for downloading that recording. Nothing is alterd or changed in Frigate!!
Steps to get it to work:
recording/camera_name/yyyy-mm-dd/hh
I use the URL to generate the download URL for frigateKnown bugs: if you try to download the most recent hour camera recording, Because it takes the current hour you are looking at and adds 1 hour to it you are trying to get clips from the future that dont exist and it will error out. I will add some code later that will check to see if the time you selected +1 hour is in the future then just use the time now and the end time not +1 hour.
Hopefully this helps someone else because even the new 0.13 export menu is not really user friendly and this make it really simple to download 1 hour clips from Frigate! Please be nice I am not a programmer by trade I do it as a hobby so this code migh be gross to some hardcore JavaScript people. If you want to help clean it up be my guest!
Please note this will most likley NOT work with 0.13 as they are now using the /api/export/ feature i have not tested it with 0.13 but if someone else can test as maybe this old backend code got left in this might still work!
JavaScript Code
Beta Was this translation helpful? Give feedback.
All reactions