- Create shared/filename_utils.py for date/time/dimension filename building - Create shared/path_utils.py for output directory handling - Create shared/discord/message_builder.py for Discord message construction - Create shared/discord/cdn_extractor.py for CDN URL extraction - Refactor image_node.py to use shared utilities (-161 lines, 16.3%) - Refactor video_node.py to use shared utilities (-361 lines, 23.1%) - Fix setup_logging missing from logging_config.py - Fix test imports to use new module paths (nodes.* instead of discord_*_node) - Total reduction: 522 lines (20.5%), exceeding PRD target of ~200 lines Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
49 lines
1.1 KiB
Python
49 lines
1.1 KiB
Python
"""
|
|
Discord Integration Utilities
|
|
|
|
Provides webhook client, message building, and CDN URL handling.
|
|
"""
|
|
|
|
from .webhook_client import (
|
|
DiscordWebhookClient,
|
|
validate_webhook_url,
|
|
sanitize_webhook_for_logging,
|
|
send_to_discord_with_retry,
|
|
validate_file_for_discord
|
|
)
|
|
from .message_builder import (
|
|
build_metadata_section,
|
|
build_prompt_section,
|
|
build_discord_message,
|
|
validate_message_content,
|
|
format_file_info,
|
|
format_file_size
|
|
)
|
|
from .cdn_extractor import (
|
|
extract_cdn_urls_from_response,
|
|
create_cdn_urls_content,
|
|
send_cdn_urls_file,
|
|
collect_and_send_cdn_urls
|
|
)
|
|
|
|
__all__ = [
|
|
# Webhook client
|
|
'DiscordWebhookClient',
|
|
'validate_webhook_url',
|
|
'sanitize_webhook_for_logging',
|
|
'send_to_discord_with_retry',
|
|
'validate_file_for_discord',
|
|
# Message building
|
|
'build_metadata_section',
|
|
'build_prompt_section',
|
|
'build_discord_message',
|
|
'validate_message_content',
|
|
'format_file_info',
|
|
'format_file_size',
|
|
# CDN extraction
|
|
'extract_cdn_urls_from_response',
|
|
'create_cdn_urls_content',
|
|
'send_cdn_urls_file',
|
|
'collect_and_send_cdn_urls',
|
|
]
|