Download backend/app/article_fetchers/base.py from jackmouse/videoNote: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/spaces/jackmouse/videoNote/resolve/main/backend/app/article_fetchers/base.py
- Command line
-
hf download hf://spaces/jackmouse/videoNote/backend/app/article_fetchers/base.py
-
curl -L -o base.py https://huggingface.co/spaces/jackmouse/videoNote/resolve/main/backend/app/article_fetchers/base.py
791 Bytes
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Protocol | |
| class ArticleContent: | |
| platform: str | |
| url: str | |
| article_id: str | |
| title: str | |
| author_name: str = "" | |
| author_id: str = "" | |
| content_text: str = "" | |
| image_urls: list[str] = field(default_factory=list) | |
| cover_url: str = "" | |
| published_at: str = "" | |
| raw_metadata: dict = field(default_factory=dict) | |
| class ArticleFetchError(Exception): | |
| pass | |
| class ArticleFetcher(Protocol): | |
| platform: str | |
| def fetch(self, url: str) -> ArticleContent: | |
| ... | |
| def search(self, keyword: str, limit: int = 20) -> list[ArticleContent]: | |
| ... | |
| def fetch_publisher(self, query: str, limit: int = 20) -> list[ArticleContent]: | |
| ... | |