Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Enter JSON Web tokens!
Many of these sites use an underlying program called youtube-dl. youtube-dl is a program that's capable of downloading videos from YouTube and many other sites.
I'm writing my server in NodeJS, so ideally I would have a wrapper to use with youtube-dl to make it extra easy for me to use. Luckily, someone's already done that, with youtube-dl-wrap! And it can even download the executable file for you (the youtube-dl program itself) so you don't have to manage that at all.
However, there's a catch: most of the time, the highest quality video doesn't have audio. That's just how YouTube seems to work, with the audio and video separate. So in order to download the highest quality video (with audio), they'll have to be downloaded separately. In many cases, you'd want to combine the two into one file so you have the highest quality video and audio. ffmpeg is one way to do that. But in my case, I can simply play both the audio and video at the same time and it will work!
It's actually pretty easy to do with express. You can set up your app and begin specifying what to return to users when you receive a GET request:
Using XMLHttpRequests, I can download any file from the internet without needing to prompt the user. Once it's downloaded, I can store it in the user's IndexedDB, which is a local storage solution on a per-website basis, intended for storing large amounts of structured data. That's perfect for storing video and audio files. As per usual, I wanted a wrapper for IndexedDB to keep things extra simple, so I opted to use Dexie.js.