# coflyn/scrapr architecture

> Architecture diagram of the GitHub repository coflyn/scrapr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coflyn/scrapr
- Repository: https://github.com/coflyn/scrapr

## Overview

scrapr is a Node.js media-link extraction library: callers provide a platform URL, choose a platform-specific scraper, and receive downloadable media links and metadata (or playlist/album information). The root module exposes platform APIs; sampled platform indexes expose their scraper implementations. The tree and README establish broader platform coverage, but most implementation internals and network-call details were not sampled, so those relationships are not expanded.

Main entry points: [`index.js`](https://github.com/coflyn/scrapr/blob/main/index.js) (Public API), [`lib/tiktok/index.js`](https://github.com/coflyn/scrapr/blob/main/lib/tiktok/index.js) (TikTok), [`lib/instagram/index.js`](https://github.com/coflyn/scrapr/blob/main/lib/instagram/index.js) (Instagram), [`lib/twitter/index.js`](https://github.com/coflyn/scrapr/blob/main/lib/twitter/index.js) (Twitter / X)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_social["Social Platforms"]
  node_tiktok["TikTok<br/>[index.js]"]
  node_instagram["Instagram<br/>[index.js]"]
  node_twitter["Twitter / X<br/>[index.js]"]
  node_facebook["Facebook<br/>[index.js]"]
  node_pinterest["Pinterest<br/>[index.js]"]
  node_threads["Threads<br/>[index.js]"]
  node_reddit["Reddit<br/>[index.js]"]
  node_rednote["RedNote<br/>[index.js]"]
end

subgraph group_music["Music Platforms"]
  node_spotify["Spotify<br/>[index.js]"]
  node_soundcloud["SoundCloud<br/>[index.js]"]
  node_applemusic["Apple Music<br/>[index.js]"]
  node_bandcamp["Bandcamp<br/>[index.js]"]
  node_bandcamp_album["Album Extraction<br/>[index.js]"]
end

subgraph group_video["Video Platforms"]
  node_youtube["YouTube<br/>[index.js]"]
  node_bilibili["Bilibili<br/>[index.js]"]
  node_douyin["Douyin<br/>[index.js]"]
  node_terabox["TeraBox<br/>[index.js]"]
  node_youtube_playlist["Playlist Extraction<br/>[index.js]"]
end

subgraph group_other["Other Platforms"]
  node_pixiv["Pixiv<br/>[index.js]"]
end

node_caller(("Library Caller"))
node_api["Public API<br/>[index.js]"]
node_result["Media Results"]
node_scraper_sites(("Scraper Services"))

node_caller -->|"imports"| node_api
node_api -->|"exports"| node_tiktok
node_api -->|"exports"| node_instagram
node_api -->|"exports"| node_twitter
node_api -->|"exports"| node_facebook
node_api -->|"exports"| node_pinterest
node_api -->|"exports"| node_threads
node_api -->|"exports"| node_reddit
node_api -->|"exports"| node_rednote
node_api -->|"exports"| node_youtube
node_api -->|"exports"| node_bilibili
node_api -->|"exports"| node_douyin
node_api -->|"exports"| node_terabox
node_api -->|"exports"| node_spotify
node_api -->|"exports"| node_soundcloud
node_api -->|"exports"| node_applemusic
node_api -->|"exports"| node_bandcamp
node_api -->|"exports"| node_pixiv
node_caller -->|"calls scraper"| node_tiktok
node_caller -->|"calls scraper"| node_instagram
node_caller -->|"calls scraper"| node_twitter
node_caller -->|"calls scraper"| node_facebook
node_caller -->|"calls scraper"| node_pinterest
node_caller -->|"calls scraper"| node_threads
node_caller -->|"calls scraper"| node_reddit
node_caller -->|"calls scraper"| node_rednote
node_caller -->|"calls scraper"| node_youtube
node_caller -->|"calls scraper"| node_bilibili
node_caller -->|"calls scraper"| node_douyin
node_caller -->|"calls scraper"| node_terabox
node_caller -->|"calls scraper"| node_spotify
node_caller -->|"calls scraper"| node_soundcloud
node_caller -->|"calls scraper"| node_applemusic
node_caller -->|"calls scraper"| node_bandcamp
node_caller -->|"calls scraper"| node_pixiv
node_caller -->|"calls playlist"| node_youtube_playlist
node_caller -->|"calls album"| node_bandcamp_album
node_scraper_sites -.->|"provides media"| node_tiktok
node_scraper_sites -.->|"provides media"| node_instagram
node_scraper_sites -.->|"provides media"| node_twitter
node_scraper_sites -.->|"provides media"| node_youtube
node_tiktok -->|"returns links"| node_result
node_instagram -->|"returns links"| node_result
node_twitter -->|"returns links"| node_result
node_facebook -->|"returns links"| node_result
node_pinterest -->|"returns links"| node_result
node_threads -->|"returns links"| node_result
node_reddit -->|"returns links"| node_result

click node_api "https://github.com/coflyn/scrapr/blob/main/index.js"
click node_tiktok "https://github.com/coflyn/scrapr/blob/main/lib/tiktok/index.js"
click node_instagram "https://github.com/coflyn/scrapr/blob/main/lib/instagram/index.js"
click node_twitter "https://github.com/coflyn/scrapr/blob/main/lib/twitter/index.js"
click node_facebook "https://github.com/coflyn/scrapr/blob/main/lib/facebook/index.js"
click node_pinterest "https://github.com/coflyn/scrapr/blob/main/lib/pinterest/index.js"
click node_threads "https://github.com/coflyn/scrapr/blob/main/lib/threads/index.js"
click node_reddit "https://github.com/coflyn/scrapr/blob/main/lib/reddit/index.js"
click node_rednote "https://github.com/coflyn/scrapr/blob/main/lib/rednote/index.js"
click node_youtube "https://github.com/coflyn/scrapr/blob/main/lib/youtube/index.js"
click node_bilibili "https://github.com/coflyn/scrapr/blob/main/lib/bilibili/index.js"
click node_douyin "https://github.com/coflyn/scrapr/blob/main/lib/douyin/index.js"
click node_terabox "https://github.com/coflyn/scrapr/blob/main/lib/terabox/index.js"
click node_spotify "https://github.com/coflyn/scrapr/blob/main/lib/spotify/index.js"
click node_soundcloud "https://github.com/coflyn/scrapr/blob/main/lib/soundcloud/index.js"
click node_applemusic "https://github.com/coflyn/scrapr/blob/main/lib/applemusic/index.js"
click node_bandcamp "https://github.com/coflyn/scrapr/blob/main/lib/bandcamp/index.js"
click node_pixiv "https://github.com/coflyn/scrapr/blob/main/lib/pixiv/index.js"
click node_youtube_playlist "https://github.com/coflyn/scrapr/blob/main/lib/youtube/playlist/index.js"
click node_bandcamp_album "https://github.com/coflyn/scrapr/blob/main/lib/bandcamp/bandcampdownloader/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tiktok,node_instagram,node_twitter,node_facebook,node_pinterest,node_threads,node_reddit,node_rednote toneBlue
class node_spotify,node_soundcloud,node_applemusic,node_bandcamp,node_bandcamp_album toneAmber
class node_youtube,node_bilibili,node_douyin,node_terabox,node_youtube_playlist,node_api toneMint
class node_pixiv toneRose
class node_caller,node_result,node_scraper_sites toneIndigo
```

## Components

### Social Platforms

- [TikTok](https://github.com/coflyn/scrapr/blob/main/lib/tiktok/index.js): `lib/tiktok/index.js`
- [Instagram](https://github.com/coflyn/scrapr/blob/main/lib/instagram/index.js): `lib/instagram/index.js`
- [Twitter / X](https://github.com/coflyn/scrapr/blob/main/lib/twitter/index.js): `lib/twitter/index.js`
- [Facebook](https://github.com/coflyn/scrapr/blob/main/lib/facebook/index.js): `lib/facebook/index.js`
- [Pinterest](https://github.com/coflyn/scrapr/blob/main/lib/pinterest/index.js): `lib/pinterest/index.js`
- [Threads](https://github.com/coflyn/scrapr/blob/main/lib/threads/index.js): `lib/threads/index.js`
- [Reddit](https://github.com/coflyn/scrapr/blob/main/lib/reddit/index.js): `lib/reddit/index.js`
- [RedNote](https://github.com/coflyn/scrapr/blob/main/lib/rednote/index.js): `lib/rednote/index.js`

### Music Platforms

- [Spotify](https://github.com/coflyn/scrapr/blob/main/lib/spotify/index.js): `lib/spotify/index.js`
- [SoundCloud](https://github.com/coflyn/scrapr/blob/main/lib/soundcloud/index.js): `lib/soundcloud/index.js`
- [Apple Music](https://github.com/coflyn/scrapr/blob/main/lib/applemusic/index.js): `lib/applemusic/index.js`
- [Bandcamp](https://github.com/coflyn/scrapr/blob/main/lib/bandcamp/index.js): `lib/bandcamp/index.js`
- [Album Extraction](https://github.com/coflyn/scrapr/blob/main/lib/bandcamp/bandcampdownloader/index.js): `lib/bandcamp/bandcampdownloader/index.js`

### Video Platforms

- [YouTube](https://github.com/coflyn/scrapr/blob/main/lib/youtube/index.js): `lib/youtube/index.js`
- [Bilibili](https://github.com/coflyn/scrapr/blob/main/lib/bilibili/index.js): `lib/bilibili/index.js`
- [Douyin](https://github.com/coflyn/scrapr/blob/main/lib/douyin/index.js): `lib/douyin/index.js`
- [TeraBox](https://github.com/coflyn/scrapr/blob/main/lib/terabox/index.js): `lib/terabox/index.js`
- [Playlist Extraction](https://github.com/coflyn/scrapr/blob/main/lib/youtube/playlist/index.js): `lib/youtube/playlist/index.js`

### Other Platforms

- [Pixiv](https://github.com/coflyn/scrapr/blob/main/lib/pixiv/index.js): `lib/pixiv/index.js`

### Other components

- **Library Caller**
- [Public API](https://github.com/coflyn/scrapr/blob/main/index.js): `index.js`
- **Media Results**
- **Scraper Services**

## Connections

- Library Caller → Public API: imports
- Public API → TikTok: exports
- Public API → Instagram: exports
- Public API → Twitter / X: exports
- Public API → Facebook: exports
- Public API → Pinterest: exports
- Public API → Threads: exports
- Public API → Reddit: exports
- Public API → RedNote: exports
- Public API → YouTube: exports
- Public API → Bilibili: exports
- Public API → Douyin: exports
- Public API → TeraBox: exports
- Public API → Spotify: exports
- Public API → SoundCloud: exports
- Public API → Apple Music: exports
- Public API → Bandcamp: exports
- Public API → Pixiv: exports
- Library Caller → TikTok: calls scraper
- Library Caller → Instagram: calls scraper
- Library Caller → Twitter / X: calls scraper
- Library Caller → Facebook: calls scraper
- Library Caller → Pinterest: calls scraper
- Library Caller → Threads: calls scraper
- Library Caller → Reddit: calls scraper
- Library Caller → RedNote: calls scraper
- Library Caller → YouTube: calls scraper
- Library Caller → Bilibili: calls scraper
- Library Caller → Douyin: calls scraper
- Library Caller → TeraBox: calls scraper
- Library Caller → Spotify: calls scraper
- Library Caller → SoundCloud: calls scraper
- Library Caller → Apple Music: calls scraper
- Library Caller → Bandcamp: calls scraper
- Library Caller → Pixiv: calls scraper
- Library Caller → Playlist Extraction: calls playlist
- Library Caller → Album Extraction: calls album
- Scraper Services → TikTok: provides media
- Scraper Services → Instagram: provides media
- Scraper Services → Twitter / X: provides media
- Scraper Services → YouTube: provides media
- TikTok → Media Results: returns links
- Instagram → Media Results: returns links
- Twitter / X → Media Results: returns links
- Facebook → Media Results: returns links
- Pinterest → Media Results: returns links
- Threads → Media Results: returns links
- Reddit → Media Results: returns links
