azihassan / youtube-d

A fast command-line Youtube downloader
MIT License
6 stars 0 forks source link

Cache initial HTML page retrieval #28

Closed azihassan closed 10 months ago

azihassan commented 1 year ago

The initial download of the HTML page can be slow, sometimes slower than the video itself. Caching would be beneficial, but it's worth noting that video URLs expire after a while. The expire parameter can be useful in the invalidation strategy. Additionally, a --no-cache argument should be supported for good measure.

azihassan commented 1 year ago

Parsing the video URL from the HTML requires downloading a 2 MB base.js file to correctly decrypt the URL. For now I'll rely on the signatureCipher instead since it's present in the HTML in clear text.

azihassan commented 10 months ago

Reopening this to implement caching of base.js

It seems like many videos share the same base.js file, it would make more sense to cache it by base.js URL instead of by video URL