Use a browser extension like Video DownloadHelper Plus to inspect the codec. It will show you two files: one large (H.264) and one small (H.265). Choose the small one for archiving.
Here is how you can get better, higher-quality downloads with less hassle.
To implement this feature, you could use a combination of technologies such as:
: Employs multi-threading technology to boost download speeds.