mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-05 07:17:52 +10:00
rename media plugin to ytdlp with backwards-compatible aliases
- Rename archivebox/plugins/media/ → archivebox/plugins/ytdlp/ - Rename hook script on_Snapshot__63_media.bg.py → on_Snapshot__63_ytdlp.bg.py - Update config.json: YTDLP_* as primary keys, MEDIA_* as x-aliases - Update templates CSS classes: media-* → ytdlp-* - Fix gallerydl bug: remove incorrect dependency on media plugin output - Update all codebase references to use YTDLP_* and SAVE_YTDLP - Add backwards compatibility test for MEDIA_ENABLED alias
This commit is contained in:
@@ -59,7 +59,6 @@ def get_env_int(name: str, default: int = 0) -> int:
|
||||
|
||||
|
||||
STATICFILE_DIR = '../staticfile'
|
||||
MEDIA_DIR = '../media'
|
||||
|
||||
def has_staticfile_output() -> bool:
|
||||
"""Check if staticfile extractor already downloaded this URL."""
|
||||
@@ -67,12 +66,6 @@ def has_staticfile_output() -> bool:
|
||||
return staticfile_dir.exists() and any(staticfile_dir.iterdir())
|
||||
|
||||
|
||||
def has_media_output() -> bool:
|
||||
"""Check if media extractor already downloaded this URL."""
|
||||
media_dir = Path(MEDIA_DIR)
|
||||
return media_dir.exists() and any(media_dir.iterdir())
|
||||
|
||||
|
||||
# Default gallery-dl args
|
||||
def get_gallerydl_default_args() -> list[str]:
|
||||
"""Build default gallery-dl arguments."""
|
||||
@@ -185,7 +178,7 @@ def main(url: str, snapshot_id: str):
|
||||
# Temporary failure (config disabled) - NO JSONL emission
|
||||
sys.exit(0)
|
||||
|
||||
# Check if staticfile or media extractors already handled this (permanent skip)
|
||||
# Check if staticfile extractor already handled this (permanent skip)
|
||||
if has_staticfile_output():
|
||||
print(f'Skipping gallery-dl - staticfile extractor already downloaded this', file=sys.stderr)
|
||||
print(json.dumps({
|
||||
@@ -195,15 +188,6 @@ def main(url: str, snapshot_id: str):
|
||||
}))
|
||||
sys.exit(0)
|
||||
|
||||
if has_media_output():
|
||||
print(f'Skipping gallery-dl - media extractor already downloaded this', file=sys.stderr)
|
||||
print(json.dumps({
|
||||
'type': 'ArchiveResult',
|
||||
'status': 'skipped',
|
||||
'output_str': 'media already handled',
|
||||
}))
|
||||
sys.exit(0)
|
||||
|
||||
# Get binary from environment
|
||||
binary = get_env('GALLERYDL_BINARY', 'gallery-dl')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user