Open ScrubN opened 9 months ago
This could also be incorporated into a UI element somewhere, allowing users see a visual tree of the steps the downloader is going to perform.
After more thought, the video info should be passed into the builder so we aren't making duplicate requests. It might not seem like a problem, but twitch seems to be A-B testing some API changes and since we don't have a consistent device ID we can get different responses in the UI and the downloader.
Checklist
Write your feature request here
The idea is to replace the current video downloader with an abstract
VideoDownloaderBuilder
of sorts. The goal is to reduce duplicate code and early return statements that would be necessary for implementing some features that change the current logic flow. This would also make destination file type checking come naturally and enable CLI filename templates to be generated during a video info fetching stage.Example API:
Something of this sort would allow us to swap out entire steps without having to touch some existing code and risk breaking it.
i.e. the kick downloader can be reduced to a 1-method change, since the only meaningful difference between it and the twitch video downloader is the video info step:
Or changing the file output is made easier too, without needing to bloat the downloader with early-return logic if a step is not needed.
i.e. making the output a TS file could be: