mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-08 22:22:17 +02:00
refactor(proprietary): move scrapers/ -> platforms/ (one subpackage per platform)
This commit is contained in:
parent
9fe9c5b71d
commit
3312a442f3
25 changed files with 30 additions and 33 deletions
|
|
@ -6,7 +6,7 @@ import pytest
|
|||
|
||||
from app.capabilities.youtube.comments.executor import build_comments_executor
|
||||
from app.capabilities.youtube.comments.schemas import CommentsInput, CommentsOutput
|
||||
from app.proprietary.scrapers.youtube import YouTubeCommentsInput
|
||||
from app.proprietary.platforms.youtube import YouTubeCommentsInput
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import pytest
|
|||
|
||||
from app.capabilities.youtube.scrape.executor import build_scrape_executor
|
||||
from app.capabilities.youtube.scrape.schemas import ScrapeInput, ScrapeOutput
|
||||
from app.proprietary.scrapers.youtube import YouTubeScrapeInput
|
||||
from app.proprietary.platforms.youtube import YouTubeScrapeInput
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
|
|
|
|||
1
surfsense_backend/tests/unit/platforms/__init__.py
Normal file
1
surfsense_backend/tests/unit/platforms/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""Platform-native scraper packages live here (one subpackage per platform)."""
|
||||
|
|
@ -9,10 +9,8 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
import pytest
|
||||
|
||||
from app.proprietary.scrapers.youtube import innertube, scraper
|
||||
from app.proprietary.scrapers.youtube.innertube import (
|
||||
from app.proprietary.platforms.youtube import innertube, scraper
|
||||
from app.proprietary.platforms.youtube.innertube import (
|
||||
INNERTUBE_SEARCH_URL,
|
||||
_current_session,
|
||||
fetch_html,
|
||||
|
|
@ -40,7 +38,7 @@ class _FakeSession:
|
|||
self.exc = exc
|
||||
self.calls = 0
|
||||
|
||||
async def post(self, url, json=None): # noqa: A002 - mirror scrapling API
|
||||
async def post(self, url, json=None):
|
||||
self.calls += 1
|
||||
if self.exc:
|
||||
raise ConnectionError("boom")
|
||||
|
|
@ -12,7 +12,7 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from app.proprietary.scrapers.youtube.parsers import (
|
||||
from app.proprietary.platforms.youtube.parsers import (
|
||||
channel_about_tokens,
|
||||
comment_next_token,
|
||||
comment_reply_tokens,
|
||||
|
|
@ -21,23 +21,23 @@ from app.proprietary.scrapers.youtube.parsers import (
|
|||
dig,
|
||||
find_all,
|
||||
parse_channel_about,
|
||||
parse_collaborators,
|
||||
parse_comment_entities,
|
||||
parse_description_links,
|
||||
parse_location,
|
||||
parse_translation,
|
||||
parse_channel_metadata,
|
||||
parse_channel_shorts,
|
||||
parse_playlist_video_ids,
|
||||
parse_collaborators,
|
||||
parse_comment_entities,
|
||||
parse_count,
|
||||
parse_date,
|
||||
parse_description_links,
|
||||
parse_location,
|
||||
parse_playlist_video_ids,
|
||||
parse_search_response,
|
||||
parse_translation,
|
||||
parse_video_page,
|
||||
seconds_to_duration,
|
||||
)
|
||||
from app.proprietary.scrapers.youtube.schemas import YouTubeScrapeInput
|
||||
from app.proprietary.scrapers.youtube.search_filters import build_search_params
|
||||
from app.proprietary.scrapers.youtube.url_resolver import resolve_url
|
||||
from app.proprietary.platforms.youtube.schemas import YouTubeScrapeInput
|
||||
from app.proprietary.platforms.youtube.search_filters import build_search_params
|
||||
from app.proprietary.platforms.youtube.url_resolver import resolve_url
|
||||
|
||||
pytestmark = pytest.mark.unit
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue