diff --git a/README.md b/README.md index 55db4479..98093040 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ Certain values can be set via environment variables, using the `-e` parameter on * __YTP_OUTPUT_TEMPLATE__: the template for the filenames of the downloaded videos, formatted according to [this spec](https://github.com/yt-dlp/yt-dlp/blob/master/README.md#output-template). Defaults to `%(title)s.%(ext)s`. This will be the default for all downloads unless the request include output template. * __YTP_KEEP_ARCHIVE__: Whether to keep history of downloaded videos to prevent downloading same file multiple times. Defaults to `false`. * __YTP_YTDL_DEBUG__: Whether to turn debug logging for the internal `yt-dlp` package. Defaults to `false`. +* __YTP_ALLOW_MANIFESTLESS__: Allow `yt-dlp` to download live streams videos which are yet to be processed by YouTube. Defaults to `false` * __YTP_HOST__: Which ip address to bind to. Defaults to `0.0.0.0`. * __YTP_PORT__: Which port to bind to. Defaults to `8081`. * __YTP_LOGGING_LEVEL__: Logging level. Defaults to `info`. diff --git a/app/Config.py b/app/Config.py index 2e4d83bd..c0bf668f 100644 --- a/app/Config.py +++ b/app/Config.py @@ -34,9 +34,14 @@ class Config: logging_level: str = 'info' + allow_manifestless: bool = False + version: str = APP_VERSION - _boolean_vars: tuple = ('keep_archive', 'ytdl_debug', 'temp_keep',) + _boolean_vars: tuple = ( + 'keep_archive', 'ytdl_debug', + 'temp_keep', 'allow_manifestless', + ) _immutable: tuple = ('version', '__instance', 'ytdl_options',) @staticmethod diff --git a/app/DownloadQueue.py b/app/DownloadQueue.py index 9d4e031f..ac87a0cc 100644 --- a/app/DownloadQueue.py +++ b/app/DownloadQueue.py @@ -221,12 +221,18 @@ class DownloadQueue: if self.isDownloaded(entry): raise yt_dlp.utils.ExistingVideoReached() + if not self.config.allow_manifestless and 'live_status' in entry and entry.get('live_status') is 'post_live': + raise yt_dlp.utils.YoutubeDLError( + 'Video is in Post-Live Manifestless mode.') + log.debug(f'entry: extract info says: {entry}') except yt_dlp.utils.ExistingVideoReached: return {'status': 'error', 'msg': 'Video has been downloaded already and recorded in archive.log file.'} except yt_dlp.utils.YoutubeDLError as exc: return {'status': 'error', 'msg': str(exc)} + # + return await self.__add_entry( entry=entry, quality=quality,