# wnma3mz/wechat_articles_spider architecture

> Architecture diagram of the GitHub repository wnma3mz/wechat_articles_spider, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wnma3mz/wechat_articles_spider
- Repository: https://github.com/wnma3mz/wechat_articles_spider

## Overview

##### Data Flow and Relationships

- User Input → ArticlesAPI
- ↓
- AccountBiz ← ArticlesAPI → ArticlesUrls
- ↓
- ArticlesInfo
- ↓
- Url2Html
- ↓
- Output (HTML/JSON)

##### Key Integration Points (Use interface symbols)

- Cookie/Token Management
- Proxy Handling
- Rate Limiting
- Data Storage (JSON files)

##### Component Details

- ArticlesAPI: Main orchestrator
- ArticlesUrls: URL extraction from different sources
- ArticlesInfo: Metadata retrieval (reads, likes, comments)
- AccountBiz: Public account management
- Url2Html: Content conversion and storage

##### Data flow direction and transformation

Keep in mind:
- This is a scraping tool, so emphasize the interaction with external systems
- Clear boundaries between manual and automated processes
- Where user intervention is required
- Error handling and retry mechanisms

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        WOP[WeChat Official Platform]
        WPC[WeChat PC Client]
        WMC[WeChat Mobile Client]
        WRP[WeChat Reading Platform]
    end

    subgraph Core["Core Components"]
        API["ArticlesAPI"]:::core
        AU["ArticlesUrls"]:::core
        AI["ArticlesInfo"]:::core
        AB["AccountBiz"]:::core
        U2H["Url2Html"]:::core
    end

    subgraph Security["Security & Auth"]
        TM["Token Management"]:::security
        PH["Proxy Handler"]:::security
        RL["Rate Limiter"]:::security
    end

    subgraph Utils["Utility Layer"]
        UF["Utility Functions"]:::util
        DT["Data Types"]:::util
    end

    subgraph Storage["Data Storage"]
        DS["JSON Storage"]:::storage
    end

    %% Main Flow
    UI[User Input]:::input --> API
    API --> AB
    API --> AU
    API --> AI
    AI --> U2H
    U2H --> DS

    %% External Connections
    WOP --> API
    WPC --> API
    WMC --> API
    WRP --> API

    %% Security Integration
    TM --> API
    PH --> API
    RL --> API

    %% Utility Usage
    UF --> API
    UF --> AU
    UF --> AI
    DT --> API

    %% Click Events
    click API "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/ArticlesAPI.py"
    click AU "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/ArticlesUrls.py"
    click AI "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/ArticlesInfo.py"
    click AB "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/AccountBiz.py"
    click U2H "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/Url2Html.py"
    click PH "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/proxy.py"
    click UF "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/utils.py"
    click DT "https://github.com/wnma3mz/wechat_articles_spider/blob/master/wechatarticles/DataType.py"
    click DS "https://github.com/wnma3mz/wechat_articles_spider/tree/master/jsons/"
    click TM "https://github.com/wnma3mz/wechat_articles_spider/blob/master/docs/get_cookie_token.md"

    %% Styling
    classDef core fill:#2374ab,stroke:#000,stroke-width:2px,color:#fff
    classDef security fill:#ff6b6b,stroke:#000,stroke-width:2px,color:#fff
    classDef util fill:#ffd93d,stroke:#000,stroke-width:2px
    classDef storage fill:#4caf50,stroke:#000,stroke-width:2px,color:#fff
    classDef input fill:#95a5a6,stroke:#000,stroke-width:2px
    
    %% Legend
    subgraph Legend
        L1["Core Component"]:::core
        L2["Security Component"]:::security
        L3["Utility Component"]:::util
        L4["Storage Component"]:::storage
        L5["User Input"]:::input
    end
```
