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 🙏

© 2024 – Pkg Stats / Ryan Hefner

xenforo-dl

v1.0.0

Published

XenForo Forum Downloader

Downloads

8

Readme

xenforo-dl

A XenForo forum downloader written in Node.js:

  • Scrapes content from forum pages
  • For each thread, downloads attachments and saves messages in text files
  • Supports downloading a single thread or all threads in a forum
  • Supports continuing from previous download

Since the downloader works through scraping, it is not guaranteed to work with all XenForo forums. I created the downloader for my data-hoarding needs targeting a handful of sites, so it might be limited in what it can scrape. But feel free to raise issues.

Installation

First, install Node.js.

Then, in a terminal, run the following command:

npm i -g xenforo-dl

Usage

$ xenforo-dl [OPTION]... URL

URL

Thread URLs

Pattern: <forum_site_url>/threads/<title_slug>.<thread_id>[/page-<num>]

Download all messages and attachments shown on page. If content spans multiple pages, download from subsequent pages as well.

If page-<num> is present in URL, then download will begin with the specified page.

Forum URLs

Pattern: <forum_site_url>/forums/<title_slug>.<forum_id>[/page-<num>]

Download all threads listed on page. If the forum has threads spanning multiple pages, download from subsequent pages as well.

If page-<num> is present in URL, then download will begin with the specified page.

Other URLs

For URLs not matching the above patterns, xenforo-dl will scrape for forum links and download from them. It is your responsibility to ensure the given URL is a valid XenForo link.

Options

| Option | Description | |-----------|-------------| | -h, --help | Display usage guide | | -k, --cookie | (string) Cookie to set in requests. See Cookies. | | -o, --out-dir | (string) Path of save directory. Default: current working directory. | | -d, --dir-structure | Combination of flags controlling the output directory structure of downloaded threads: s: Include directory for the forum site.pl: Include directory for each category or forum leading up to the target thread.pi: Include directory for the immediate section or forum containing the target thread.t: Include directory for the target thread itself.a: Include directory for attachments.-: No directory structure. Everything will be saved directly to --out-dir.Default: splta| | -w, --overwrite | Overwrite existing attachment files | | -l, --log-level | Log level: info, debug, warn or error; set to none`` to disable logging. Default: info| |-s, --log-file| (string) Save logs to specified path | |-r, --max-retries| (number) Maximum retry attempts when a download fails. Default: 3 | |-c, --max-concurrent| (number) Maximum number of concurrent downloads for attachments. Default: 10 | | -p, --min-time-page| (number) Minimum time, in milliseconds, to wait between page fetch requests. Default: 500 | |-i, --min-time-image| (number) Minimum time, in milliseconds, to wait between download requests for attachments. Default: 200 | |--continue| Continue from previous download | |-y, --no-prompt` | Do not prompt for confirmation to proceed |

Cookies

Cookies allow you to download content that would otherwise be inaccessible due to lack of user credentials. To obtain a cookie for passing to xenforo-dl through the --cookie option, do the following:

  1. In a browser, sign in to the target forum site.
  2. Press F12 to bring up Developer Tools.
  3. Select Network tab, followed by HTML filter.
  4. Press F5 to refresh the page. Select one of the entries that appear under the Network tab.
  5. Under Headers -> Request Headers, you should see the Cookie entry. Copy the value of that entry and pass it to xenforo-dl.

Cookies should remain valid until they expire or you sign out of the forum site.

Changelog

v1.0.0

  • Initial release

License

MIT