Commit Graph

66 Commits (a8f9611d93b44fb06eeb5db50465f3132f91a578)

Author SHA1 Message Date
Mike Lang 1dce14bf77 downloader: Fix and improve the stop mechanism, stop on SIGTERM
Allows for graceful shutdown
6 years ago
Mike Lang 7b10429846 downloader: Dockerfile fixes to make it work 6 years ago
Mike Lang 6c3501db6f downloader: Fix dateutil lib, which is actually called python-dateutil 6 years ago
Mike Lang 7257fb9b73 downloader: Include channel name in path, instead of assuming it's already in base_dir
Previously, downloader would put files under BASE_DIR/VARIANT/HOUR/FILE.ts
now, it will put files under BASE_DIR/STREAM/VARIANT/HOUR/FILE.ts

This brings downloader in line with restreamer's concept of base_dir
6 years ago
Christopher Usher efe30c1942 Added a comment to highlight recursion 6 years ago
Mike Lang 75c9793eac Remove central config file as it's more trouble than it's worth
Simpler and easier for testing to stick to configuration via CLI args.
We'll worry about deployment later.
6 years ago
Mike Lang 031dd60897 downloader: Fix some typos around the max age calculation 6 years ago
Mike Lang 6377db2aa2 downloader: Bug fixes and improvements
* Fix bug where soft timeout is not cancelled if an exception occurs
* Various logging tweaks
* Prevent master playlist wait time from going negative
* Stop gracefully if stream worker detects end of stream
* Don't treat master playlist 404 as an error, it just means the stream isn't up
6 years ago
Mike Lang 6e0dcd5e22 downloader: Fix bugs and missing bits in initial implementation
* Set a reasonable log format
* Make soft timeouts not always fire
* Change soft_hard_timeout signature slightly for ease-of-use
* Make renames not fail if file already exists
* Misc typos
6 years ago
Mike Lang f193bd0f54 Re-write downloader to be resilient to failures as much as possible
This makes the code crazy complicated and messy, but means we can be persistent about
not giving up, while still retrying at the same time, and trying multiple urls at once
until we find one that works.

See docstrings for a full discussion on some of the failures we're trying to work around.
6 years ago
Mike Lang 10241b6190 Downloader: Implement a very basic proof of concept version
Missing a LOT of tankiness, ways to configure, conversion to bustime, etc.
6 years ago
Mike Lang 8993773a22 downloader.twitch: Deals with twitch specifics of playlist management 6 years ago
Mike Lang 961712b919 downloader: Import hls_playlist from streamlink
This is a useful library and we might as well use it.
Copying it over and slightly modifying it to work was easier than importing all of streamlink.

The original version may be found at 30043408c7/src/streamlink/stream/hls_playlist.py
6 years ago
Mike Lang 30612f00ad downloader: basic startup path 6 years ago
Mike Lang 1b21694c27 Add a simple build script to build docker images and a basic dockerfile 6 years ago
Mike Lang 439b623599 Add skeleton of downloader service 6 years ago