Convert a URL to internal format. Args: url: URL to extract Returns: ConversionResult containing the processed content Raises: ConversionError: If conversion fails
(self, url: str)
| 231 | return self.extract(file_path) |
| 232 | |
| 233 | def extract_url(self, url: str) -> ConversionResult: |
| 234 | """Convert a URL to internal format. |
| 235 | |
| 236 | Args: |
| 237 | url: URL to extract |
| 238 | |
| 239 | Returns: |
| 240 | ConversionResult containing the processed content |
| 241 | |
| 242 | Raises: |
| 243 | ConversionError: If conversion fails |
| 244 | """ |
| 245 | # Cloud mode doesn't support URL conversion |
| 246 | if self.cloud_mode: |
| 247 | raise ConversionError("URL conversion is not supported in cloud mode. Use local mode for URL processing.") |
| 248 | |
| 249 | # Find the URL processor |
| 250 | url_processor = None |
| 251 | for processor in self.processors: |
| 252 | if isinstance(processor, URLProcessor): |
| 253 | url_processor = processor |
| 254 | break |
| 255 | |
| 256 | if not url_processor: |
| 257 | raise ConversionError("URL processor not available") |
| 258 | |
| 259 | logger.info(f"Converting URL: {url}") |
| 260 | return url_processor.process(url) |
| 261 | |
| 262 | def extract_text(self, text: str) -> ConversionResult: |
| 263 | """Convert plain text to internal format. |
no test coverage detected