[FEATURE] creator source variable (#572)
This commit is contained in:
parent
1965bc0a40
commit
fa6eae7423
3 changed files with 13 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from yt_dlp.utils import sanitize_filename
|
|||
from ytdl_sub.entries.base_entry import BaseEntry
|
||||
from ytdl_sub.entries.base_entry import BaseEntryVariables
|
||||
from ytdl_sub.entries.variables.kwargs import CHANNEL
|
||||
from ytdl_sub.entries.variables.kwargs import CREATOR
|
||||
from ytdl_sub.entries.variables.kwargs import DOWNLOAD_INDEX
|
||||
from ytdl_sub.entries.variables.kwargs import EXT
|
||||
from ytdl_sub.entries.variables.kwargs import PLAYLIST_COUNT
|
||||
|
|
@ -350,6 +351,16 @@ class EntryVariables(BaseEntryVariables):
|
|||
"""
|
||||
return self.kwargs_get(SOURCE_UPLOADER_URL, self.source_webpage_url)
|
||||
|
||||
@property
|
||||
def creator(self: Self) -> str:
|
||||
"""
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
The creator name if it exists, otherwise returns the channel.
|
||||
"""
|
||||
return self.kwargs_get(CREATOR, self.channel)
|
||||
|
||||
@property
|
||||
def channel(self: Self) -> str:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ EXTRACTOR = _("extractor")
|
|||
IE_KEY = _("ie_key")
|
||||
EPOCH = _("epoch")
|
||||
CHANNEL = _("channel")
|
||||
CREATOR = _("creator")
|
||||
EXT = _("ext")
|
||||
TITLE = _("title")
|
||||
DESCRIPTION = _("description")
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ def mock_entry_to_dict(
|
|||
"title_sanitized": "entry {title}",
|
||||
"ext": ext,
|
||||
"description": "",
|
||||
"creator": "abc123",
|
||||
"channel": "abc123",
|
||||
"channel_sanitized": "abc123",
|
||||
"extractor": extractor,
|
||||
|
|
|
|||
Loading…
Reference in a new issue