df
This commit is contained in:
@@ -309,15 +309,10 @@ def get_provider_credentials(config: Dict[str, Any], provider: str) -> Optional[
|
||||
def resolve_cookies_path(
|
||||
config: Dict[str, Any], script_dir: Optional[Path] = None
|
||||
) -> Optional[Path]:
|
||||
# Support both legacy top-level `cookies=...` and the modular conf style:
|
||||
# Only support modular config style:
|
||||
# [tool=ytdlp]
|
||||
# cookies="C:\\path\\cookies.txt"
|
||||
values: list[Any] = []
|
||||
try:
|
||||
values.append(config.get("cookies"))
|
||||
except Exception as exc:
|
||||
logger.debug("resolve_cookies_path: failed to read top-level cookies: %s", exc, exc_info=True)
|
||||
|
||||
try:
|
||||
tool = config.get("tool")
|
||||
if isinstance(tool, dict):
|
||||
@@ -328,14 +323,6 @@ def resolve_cookies_path(
|
||||
except Exception as exc:
|
||||
logger.debug("resolve_cookies_path: failed to read tool.ytdlp cookies: %s", exc, exc_info=True)
|
||||
|
||||
try:
|
||||
ytdlp_block = config.get("ytdlp")
|
||||
if isinstance(ytdlp_block, dict):
|
||||
values.append(ytdlp_block.get("cookies"))
|
||||
values.append(ytdlp_block.get("cookiefile"))
|
||||
except Exception as exc:
|
||||
logger.debug("resolve_cookies_path: failed to read ytdlp cookies block: %s", exc, exc_info=True)
|
||||
|
||||
base_dir = script_dir or SCRIPT_DIR
|
||||
for value in values:
|
||||
if not value:
|
||||
|
||||
@@ -373,9 +373,6 @@ def normalize_urls(value: Any) -> List[str]:
|
||||
text = raw.strip()
|
||||
if not text:
|
||||
return
|
||||
# Support legacy prefixes like "url:https://...".
|
||||
if text.lower().startswith("url:"):
|
||||
text = text.split(":", 1)[1].strip()
|
||||
|
||||
# Prefer extracting obvious URLs to avoid splitting inside query strings.
|
||||
matches = re.findall(r"https?://[^\s,]+", text, flags=re.IGNORECASE)
|
||||
|
||||
@@ -162,13 +162,13 @@ def _as_dict(item: Any) -> Optional[Dict[str, Any]]:
|
||||
|
||||
def extract_store_value(item: Any) -> str:
|
||||
"""Extract storage backend name from item.
|
||||
|
||||
Searches item for store identifier using multiple field names:
|
||||
store, table, source, storage (legacy).
|
||||
|
||||
|
||||
Searches item for store identifier using field names:
|
||||
store, table.
|
||||
|
||||
Args:
|
||||
item: Object or dict with store information
|
||||
|
||||
|
||||
Returns:
|
||||
Store name as string (e.g., "hydrus", "local", "") if not found
|
||||
"""
|
||||
@@ -176,10 +176,8 @@ def extract_store_value(item: Any) -> str:
|
||||
store = _get_first_dict_value(
|
||||
data,
|
||||
["store",
|
||||
"table",
|
||||
"source",
|
||||
"storage"]
|
||||
) # storage is legacy
|
||||
"table"]
|
||||
)
|
||||
return str(store or "").strip()
|
||||
|
||||
|
||||
@@ -1059,8 +1057,7 @@ class Table:
|
||||
row.add_column("Tag", item.tag_name)
|
||||
|
||||
# Source/Store (where the tag values come from)
|
||||
# Support both 'source' (legacy) and 'store' (new) attribute names
|
||||
source_val = getattr(item, "source", None) or getattr(item, "store", None)
|
||||
source_val = getattr(item, "store", None)
|
||||
if source_val:
|
||||
row.add_column("Store", source_val)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user