Disallow downloading unprocessed videos.
This commit is contained in:
parent
be6ed2967c
commit
0366cff62f
3 changed files with 13 additions and 1 deletions
|
|
@ -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`.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue