37
wrappers/snapchat_client_subprocess_wrapper.py
Normal file
37
wrappers/snapchat_client_subprocess_wrapper.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Subprocess wrapper for Snapchat Client (direct API) operations.
|
||||
Runs in an isolated subprocess to avoid asyncio event loop conflicts.
|
||||
|
||||
Uses the common wrapper factory from base_subprocess_wrapper.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add parent directory to path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from wrappers.base_subprocess_wrapper import create_download_wrapper, run_wrapper_main
|
||||
|
||||
|
||||
def create_snapchat_client_downloader(config, unified_db):
|
||||
"""Factory function to create a Snapchat Client downloader instance."""
|
||||
from modules.snapchat_client_module import SnapchatClientDownloader
|
||||
|
||||
return SnapchatClientDownloader(
|
||||
show_progress=True,
|
||||
use_database=True,
|
||||
log_callback=None, # Module uses universal logger
|
||||
unified_db=unified_db
|
||||
)
|
||||
|
||||
|
||||
# Create the download function using the factory
|
||||
run_snapchat_client_download = create_download_wrapper(
|
||||
"SnapchatClient", "snapchat_client", create_snapchat_client_downloader
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_wrapper_main(run_snapchat_client_download)
|
||||
Reference in New Issue
Block a user