[BUGFIX] Handle case when yt-dlp returns LazyList
This commit is contained in:
parent
7c217db843
commit
8011b980a2
1 changed files with 7 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ from typing import Type
|
||||||
from typing import TypeVar
|
from typing import TypeVar
|
||||||
from typing import final
|
from typing import final
|
||||||
|
|
||||||
from yt_dlp.utils import sanitize_filename
|
from yt_dlp.utils import sanitize_filename, LazyList
|
||||||
|
|
||||||
from ytdl_sub.entries.script.variable_definitions import VARIABLES
|
from ytdl_sub.entries.script.variable_definitions import VARIABLES
|
||||||
from ytdl_sub.entries.script.variable_definitions import VariableDefinitions
|
from ytdl_sub.entries.script.variable_definitions import VariableDefinitions
|
||||||
|
|
@ -37,6 +37,12 @@ class BaseEntry(ABC):
|
||||||
self._working_directory = working_directory
|
self._working_directory = working_directory
|
||||||
self._kwargs = entry_dict
|
self._kwargs = entry_dict
|
||||||
|
|
||||||
|
# Sometimes yt-dlp can return a LazyList which is not JSON serializable.
|
||||||
|
# Cast it to a native list here. (https://github.com/jmbannon/ytdl-sub/issues/910)
|
||||||
|
for key in self._kwargs.keys():
|
||||||
|
if isinstance(self._kwargs[key], LazyList):
|
||||||
|
self._kwargs[key] = list(self._kwargs[key])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uid(self) -> str:
|
def uid(self) -> str:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue