ZDF: Fix series names when downloading from series page

This commit is contained in:
lambda 2025-08-22 22:54:10 +02:00
parent 176293bb99
commit 04ea9fff63

View File

@ -2,6 +2,7 @@ from __future__ import annotations
from http.cookiejar import MozillaCookieJar from http.cookiejar import MozillaCookieJar
from typing import Any, Optional, Union from typing import Any, Optional, Union
import json
import sys import sys
import re import re
@ -162,7 +163,11 @@ class ZDF(Service):
)]) )])
else: else:
name = video["title"] name = video["title"]
series_title = video["smartCollection"].get("title", "DUMMY") series_title = video["smartCollection"].get("title")
# When loading from series page (handle_series_page), use this hack to get series title
if not series_title:
series_title = video["tracking"]["piano"]["video"]["av_show"]
# Ignore fake episode names like "Episode 123" or "Series Name (1/8)" # Ignore fake episode names like "Episode 123" or "Series Name (1/8)"
if re.match(fr"^(Folge \d+|{series_title} \(\d+/\d+\))$", name): if re.match(fr"^(Folge \d+|{series_title} \(\d+/\d+\))$", name):