feat: flat design Sunset Glitch + download manager + settings + recommendations overhaul
- Sunset Glitch color palette applied to all templates - Font Awesome icons throughout UI - Download manager with parallel queue and progress tracking - Settings page with dynamic configuration - Recommendations router enhanced with scoring - Local vendor libs (Alpine.js, HTMX) for offline support - Auto test suite with screenshots - Series releases list component - New download model
This commit is contained in:
@@ -144,12 +144,34 @@ class AnimeSamaDownloader(BaseAnimeSite):
|
||||
logger.info(f"Direct video URL detected: {url[:60]}... -> {filename}")
|
||||
return url, filename
|
||||
|
||||
# Check if URL contains the anime page context (format: video_url|anime_page_url|episode_title?)
|
||||
# Check if URL contains the anime page context (format: video_url|...|anime_page_url|episode_title)
|
||||
# The LAST two parts are always anime_page_url and episode_title.
|
||||
# Everything before them is video URLs (multiple sources for fallback).
|
||||
if "|" in url:
|
||||
parts = url.split("|")
|
||||
video_url = parts[0]
|
||||
anime_page_url = parts[1] if len(parts) > 1 else None
|
||||
episode_title = parts[2] if len(parts) > 2 else None
|
||||
# Correctly identify anime_page_url (2nd to last) and episode_title (last)
|
||||
if len(parts) >= 3:
|
||||
# Multiple video URLs + anime_page_url + episode_title
|
||||
potential_anime_url = parts[-2].strip()
|
||||
potential_title = parts[-1].strip()
|
||||
# Validate: anime_page_url should look like a URL
|
||||
# episode_title should NOT look like a URL
|
||||
if potential_title and not potential_title.startswith("http"):
|
||||
anime_page_url = potential_anime_url if potential_anime_url.startswith("http") else None
|
||||
episode_title = potential_title
|
||||
elif len(parts) >= 5 and parts[-2].startswith("http"):
|
||||
# Last part is also a URL (no episode title) - 2nd to last is anime page URL
|
||||
anime_page_url = potential_anime_url
|
||||
episode_title = None
|
||||
else:
|
||||
anime_page_url = None
|
||||
episode_title = None
|
||||
# Pass the full URL to fallback (it parses correctly)
|
||||
video_url = url
|
||||
else:
|
||||
video_url = parts[0]
|
||||
anime_page_url = parts[1] if len(parts) > 1 else None
|
||||
episode_title = None
|
||||
|
||||
logger.debug(
|
||||
f"Split URL - video: {video_url[:60]}..., anime: {anime_page_url}, episode: {episode_title}"
|
||||
@@ -160,6 +182,7 @@ class AnimeSamaDownloader(BaseAnimeSite):
|
||||
video_url,
|
||||
anime_page_url=anime_page_url,
|
||||
episode_title=episode_title,
|
||||
target_filename=target_filename,
|
||||
)
|
||||
|
||||
# Check if this is a third-party host URL
|
||||
|
||||
Reference in New Issue
Block a user