| import asyncio | |
| import logging | |
| import sys | |
| import os | |
| # Set up paths | |
| sys.path.append(os.path.abspath(os.path.join(os.getcwd(), ".."))) # For d:\lmina\backend | |
| sys.path.append(os.getcwd()) # For current dir | |
| from scraper.extractors.engine import ExtractorEngine | |
| async def test(): | |
| urls = [ | |
| 'https://vidara.to/e/qgrUC3EDRJdGa', # Server 2 | |
| 'https://bysezejataos.com/e/vcnw55kah6kp' # Server 4 | |
| ] | |
| for url in urls: | |
| print(f"\n--- Testing Extraction for: {url} ---") | |
| try: | |
| res = await ExtractorEngine.extract(url) | |
| if res: | |
| print(f"✅ Success!") | |
| print(f"URL: {res.get('url')}") | |
| print(f"Type: {res.get('type')}") | |
| print(f"Headers: {res.get('headers')}") | |
| else: | |
| print("❌ Failed to extract.") | |
| except Exception as e: | |
| print(f"🔥 Error: {e}") | |
| if __name__ == "__main__": | |
| asyncio.run(test()) | |