Skip to main content
Glama

Video Downloader MCP Server

test_real_download_simple.py•2.72 kB
#!/usr/bin/env python3 """ Test a real download with actual file creation """ import sys import json import asyncio import os from pathlib import Path sys.path.append('.') from server import handle_call_tool async def test_real_download(): """Test actual download with file creation""" print("šŸ“„ Testing Real Download with File Creation") print("=" * 50) # Use a very short YouTube video test_url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" # Create download directory download_dir = Path.home() / "video-downloader" / "test_real" download_dir.mkdir(parents=True, exist_ok=True) print(f"šŸ“ Download directory: {download_dir}") print() # Test download with explicit template expansion print("šŸŽÆ Downloading audio with explicit filename...") try: result = await handle_call_tool("download_video", { "url": test_url, "location_id": "default", "relative_path": "test_real", "filename_template": "rick_astley_test.%(ext)s", "format_id": "140" # m4a audio format }) response = json.loads(result[0].text) print(f"Response: {response}") if response.get("success"): print("āœ… Download successful!") download_path = response.get("download_path") print(f" Reported path: {download_path}") # Check the directory for any files print(f"\nšŸ“‚ Checking download directory contents:") if download_dir.exists(): files = list(download_dir.glob("*")) if files: for file_path in files: if file_path.is_file(): size = file_path.stat().st_size print(f" šŸ“„ {file_path.name} ({size:,} bytes)") else: print(" (No files found)") # Also check if any yt-dlp created files in current directory print(f"\nšŸ“‚ Checking current directory for any yt-dlp files:") current_files = [f for f in os.listdir('.') if 'rick' in f.lower() or 'astley' in f.lower()] for file in current_files: if os.path.isfile(file): size = os.path.getsize(file) print(f" šŸ“„ {file} ({size:,} bytes)") else: print(f"āŒ Download failed: {response.get('error')}") except Exception as e: print(f"āŒ Error: {e}") print() print("šŸ“Š Test completed!") if __name__ == "__main__": asyncio.run(test_real_download())

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chazmaniandinkle/video-downloader-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server