| 56 | print(f"Error altering database to add {new_column} column: {e}") |
| 57 | |
| 58 | async def aget_cached_url(self, url: str) -> Optional[Tuple[str, str, str, str, str, str, str, bool, str]]: |
| 59 | try: |
| 60 | async with aiosqlite.connect(self.db_path) as db: |
| 61 | async with db.execute('SELECT url, html, cleaned_html, markdown, extracted_content, success, media, links, metadata, screenshot FROM crawled_data WHERE url = ?', (url,)) as cursor: |
| 62 | return await cursor.fetchone() |
| 63 | except Exception as e: |
| 64 | print(f"Error retrieving cached URL: {e}") |
| 65 | return None |
| 66 | |
| 67 | async def acache_url(self, url: str, html: str, cleaned_html: str, markdown: str, extracted_content: str, success: bool, media: str = "{}", links: str = "{}", metadata: str = "{}", screenshot: str = ""): |
| 68 | try: |