mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-18 23:11:12 +02:00
refactor(instagram): drop login-walled comment fields and note search_type aliasing
This commit is contained in:
parent
cb4adab852
commit
452fe30aa4
1 changed files with 9 additions and 3 deletions
|
|
@ -20,6 +20,9 @@ from typing import Any, Literal
|
||||||
from pydantic import BaseModel, ConfigDict, Field
|
from pydantic import BaseModel, ConfigDict, Field
|
||||||
|
|
||||||
InstagramResultsType = Literal["posts", "details", "reels"]
|
InstagramResultsType = Literal["posts", "details", "reels"]
|
||||||
|
# Kept as distinct values for actor-spec parity, but under anonymous Google-backed
|
||||||
|
# discovery ``user`` and ``profile`` are aliases: both resolve to profile targets
|
||||||
|
# (IG's own hashtag/place/keyword search is login-walled).
|
||||||
InstagramSearchType = Literal["profile", "user"]
|
InstagramSearchType = Literal["profile", "user"]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -64,7 +67,12 @@ class _ItemBase(BaseModel):
|
||||||
|
|
||||||
|
|
||||||
class InstagramMediaItem(_ItemBase):
|
class InstagramMediaItem(_ItemBase):
|
||||||
"""A post / reel / mention. One flat schema per the actor FAQ."""
|
"""A post or reel. One flat schema per the actor FAQ.
|
||||||
|
|
||||||
|
``firstComment``/``latestComments`` are intentionally absent: comment
|
||||||
|
*content* is login-walled (only the anonymous comment *count* is exposed, as
|
||||||
|
``commentsCount``), so this scraper can never source them.
|
||||||
|
"""
|
||||||
|
|
||||||
id: str | None = None
|
id: str | None = None
|
||||||
type: Literal["Image", "Video", "Sidecar"] | None = None
|
type: Literal["Image", "Video", "Sidecar"] | None = None
|
||||||
|
|
@ -74,8 +82,6 @@ class InstagramMediaItem(_ItemBase):
|
||||||
mentions: list[str] = Field(default_factory=list)
|
mentions: list[str] = Field(default_factory=list)
|
||||||
url: str | None = None
|
url: str | None = None
|
||||||
commentsCount: int | None = None
|
commentsCount: int | None = None
|
||||||
firstComment: str | None = None
|
|
||||||
latestComments: list[dict[str, Any]] = Field(default_factory=list)
|
|
||||||
dimensionsHeight: int | None = None
|
dimensionsHeight: int | None = None
|
||||||
dimensionsWidth: int | None = None
|
dimensionsWidth: int | None = None
|
||||||
displayUrl: str | None = None
|
displayUrl: str | None = None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue