npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ritamoe/4chan-list-videos

v0.0.2

Published

Generate a list of videos posted in a 4chan thread

Downloads

176

Readme

4chan-list-videos

Generate a list of webms and mp4s posted in a thread.

Here's a little demonstration of 4chan-list-webm in action (plz star).

Installation

$ pnpm add @ritamoe/4chan-list-videos

# OR

$ npm install --save @ritamoe/4chan-list-videos

Usage

const listVideos = require('@ritamoe/4chan-list-videos')

// promise
listVideos('wsg', 2045456)
  .then(data => console.log(data))
  .catch(err => console.error('404!', err))

// async/await
async function run () {
  try {
    const data = await listVideos('http://boards.4chan.org/wsg/thread/2045456')
    console.log(data)
  } catch (err) {
    console.error('Whoa! 404! :c', err)
  }
}

run()

API

listVideos(url)

listVideos(board, threadNo, config)

Returns a promise that resolves to data about videos within a thread (see payload).

url

Type: String

The URL of the thread. The thumbnail and video links will use https if an https request is made.

board

Type: String

The short-name of the board, eg. 'wsg', 'b', etc.

threadNo

Type: Number

The thread number of the target thread. For example, 2312676 is the thread number of http://boards.4chan.org/wsg/thread/2312676

config

Type: Object

A configuration object, see details below.

config.https

Type: Boolean

Property that determines whether to use https. Setting the key to true enables https.

Payload

Below an example payload. Note that the subject key will be omitted if the thread has no subject.

{
  "subject": "MELANCHOLY",
  "videos": [
    {
      "filename": "conspiracy-alright",
      "thumbnail": "https://i.4cdn.org/wsg/1765509046233024s.jpg",
      "url": "https://i.4cdn.org/wsg/1765509046233024.webm"
    },
    {
      "filename": "Gymnopédie No. 1",
      "thumbnail": "https://i.4cdn.org/wsg/1765509110095819s.jpg",
      "url": "https://i.4cdn.org/wsg/1765509110095819.mp4"
    },
    {
      "filename": "LoLa & Hauser - Love Story",
      "thumbnail": "https://i.4cdn.org/wsg/1765509203849104s.jpg",
      "url": "https://i.4cdn.org/wsg/1765509203849104.mp4"
    }
  ]
}

Miscellaneous

CORS, and why this doesn't work in the browser

Because CORS is only supported with an origin of http(s)://boards.4chan.org, this module does not work in the browser; it only works with Node.js. The ONLY exception to this is if you're creating a Chrome plugin, with http(s)://boards.4chan.org set as the origin.

Rate limits

As stated in the 4chan API, you must ensure that you do not make more than one request per second. It is your responsiblity to ensure that the request limit is respected. I recommend using limiter or bottleneck.

Thumbnails

You will get an 403 Forbidden error if you try to load the thumbnails via inline linking (eg. changing the src attribute of an <img> via JavaScript, or hard-coding it). You can still download these images via a proxy server and serve them there.

Why?

¯\_(ツ)_/¯

Disclaimer

The creator of 4chan-list-videos is not associated with 4chan.org in any way.