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

dc-gallery-crawler

v1.0.2

Published

TOML-configurable DCInside gallery crawler CLI

Readme

dc-gallery-crawler

디시인사이드 갤러리 목록에서 고정 식별코드가 있는 글을 수집해 XLSX, 고유 식별코드 TXT, 메모용 TXT로 저장하는 TypeScript CLI입니다. Python이나 전역 TypeScript 설치는 필요하지 않습니다. Node.js 22.19 이상만 준비하면 됩니다.

기본값은 웹소설 연재 마이너 갤러리이지만 일반·마이너·미니·인물 갤러리의 목록 URL과 갤러리 ID를 TOML 또는 CLI로 바꿀 수 있습니다.

npx로 실행

npm에 배포한 뒤에는 설치 없이 다음처럼 실행합니다.

npx --yes dc-gallery-crawler@latest pages 5 --gallery tgijjdd

AI 웹소설 갤러리는 다음과 같이 최소한의 인수로 실행합니다.

npx --yes dc-gallery-crawler@latest pages 1 -g aiwriter

설정에서 표기를 따로 지정하지 않았다면 aiwriter는 출력 접두어 AI웹연갤, 메모 접미사 -AI웹연갤을 자동으로 사용합니다.

run에서 메모 문구만 즉시 바꾸려면 --suffix를 추가합니다. pages, title, date에서도 같이 쓸 수 있습니다.

npx --yes dc-gallery-crawler@latest run -g aiwriter --pages 1 --suffix=-원하는문구

다른 종류의 갤러리도 지정할 수 있습니다.

npx --yes dc-gallery-crawler@latest pages 3 --gallery my_gallery --gallery-type general
npx --yes dc-gallery-crawler@latest pages 3 --gallery my_gallery --gallery-type minor
npx --yes dc-gallery-crawler@latest pages 3 --gallery my_gallery --gallery-type mini
npx --yes dc-gallery-crawler@latest pages 3 --gallery my_gallery --gallery-type person

표기를 따로 지정하지 않고 다른 갤러리 ID로 바꾸면 웹연갤 전용 제외 제목은 비우고, 출력 접두어와 메모 접미사는 해당 ID로 파생합니다. CLI에서 --gallery를 주면 이 갤러리별 표기도 TOML보다 우선합니다. 반면 갤러리를 TOML로 선택했다면 해당 TOML에 직접 쓴 exclude_titles, filename_prefix, [memo].suffix를 유지합니다. 1.0.1 이후의 init은 이 세 키를 주석 예시로 만들므로 ID만 바꾸면 자동값이 적용됩니다. 1.0.0에서 이미 만든 crawl.toml로 run할 때는 세 키를 수정하거나 삭제하세요.

전체 도움말은 네트워크 요청이나 설정 로딩 없이 표시됩니다.

npx --yes dc-gallery-crawler@latest --help

아직 npm에 배포하기 전, 이 폴더에서 직접 실행하려면 다음 명령을 사용합니다.

npm install
npm run build
npm start -- --help

전역 명령으로 연결하려면 npm link 후 dc-gallery-crawler --help 또는 dc-crawl --help를 사용합니다.

수집 명령

페이지 수 기준:

dc-gallery-crawler pages 100

특정 제목을 포함하고 그 지점에서 종료:

dc-gallery-crawler title "여기까지 수집"

특정 날짜를 포함하고 더 오래된 글 직전에 종료:

dc-gallery-crawler date 2026-05-15

pages 모드는 요청한 페이지 범위에 별도의 날짜 제한을 적용하지 않습니다. title과 date 모드는 목표를 찾지 못하면 부분 결과를 성공으로 저장하지 않고 종료 코드 1로 알립니다.

TOML 설정

현재 폴더에 기본 crawl.toml을 만들려면:

dc-gallery-crawler init

기존 파일을 다시 만들려면 --force를 붙입니다. 전체 예시는 crawl.example.toml에 있습니다.

설정 우선순위는 다음과 같습니다.

  1. 프로그램 내장 기본값
  2. 현재 폴더의 crawl.toml, 또는 --config로 명시한 파일
  3. CLI 옵션

TOML에 쓴 상대 입출력 경로는 TOML 파일이 있는 폴더를 기준으로 합니다. CLI의 --output-dir, --input, --output은 명령을 실행한 폴더를 기준으로 합니다. 알 수 없는 키, 잘못된 타입·범위·날짜, 지원하지 않는 목록 URL은 조용히 무시하지 않고 오류로 표시합니다.

base_url은 다음 HTTPS 목록 주소를 지원합니다.

  • https://gall.dcinside.com/board/lists/
  • https://gall.dcinside.com/mgallery/board/lists/
  • https://gall.dcinside.com/mini/board/lists/
  • https://gall.dcinside.com/person/board/lists/

생성 파일

기본적으로 한 번의 수집에서 다음 세 파일을 만듭니다.

  • <접두어>_<시각>.xlsx: 전체 수집 결과
  • <접두어>_<시각>_식별코드.txt: 중복을 제거한 고정 식별코드
  • <접두어>_<시각>_메모용.txt: 식별코드에 [memo].suffix를 붙인 목록

IP만 있는 유동 작성자는 고정 식별코드 결과에 섞지 않습니다. 다만 날짜·제목 종료 지점을 판정할 때는 해당 행도 고려합니다. 중복 게시물은 정규화된 글 링크 기준으로 제거합니다.

기존 addon.py가 하던 작업은 memo 명령으로 통합했습니다.

dc-gallery-crawler memo ㅇㅇㄱlist.txt --output "ㅇㅇㄱ 메모용.txt" --suffix=-웹연갤

입력의 BOM, CRLF, 빈 줄, 앞뒤 공백과 중복 식별코드를 정리하며, 기본적으로 기존 출력 파일을 덮어쓰지 않습니다.

안정성과 종료 코드

  • HTTP 408, 429, 5xx 및 일시적 네트워크 오류를 제한적으로 재시도합니다.
  • 요청 실패와 정상 빈 페이지를 구분합니다.
  • 접근 제한·자동입력방지 페이지와 예상하지 못한 HTML 구조를 명시적으로 오류 처리합니다.
  • 병렬 요청이 순서 없이 끝나도 페이지 순서로 합치고, 종료 지점 뒤에서 미리 받아 둔 결과는 버립니다.
  • Ctrl+C는 종료 코드 130, 사용법·TOML 오류는 2, 네트워크·출력 오류는 1을 사용합니다.

과도한 동시 요청은 사이트 제한을 유발할 수 있어 기본 동시성은 3, 허용 상한은 10입니다.

개발과 테스트

npm ci
npm test
npm run test:package
npm audit --omit=dev
npm pack --dry-run

테스트는 외부 사이트 상태에 의존하지 않는 HTML fixture와 주입한 HTTP 응답을 사용합니다. TOML, CLI, 파서, 날짜 경계, 병렬 중단, 재시도·시간초과, XLSX 재오픈, 수식 문자열 안전성, 메모 파일, 패키지 실행을 검증합니다. test:package는 실제 npm tarball을 만든 뒤 빈 임시 프로젝트에 운영 의존성만 설치하여 두 bin 명령을 npx --no-install로 실행합니다.

GitHub Actions는 Windows와 Ubuntu에서 Node.js 22.19.0(최소 지원 버전)과 24.x를 각각 검증합니다. Ubuntu 패키지 스모크에서는 설치된 POSIX bin의 실행 권한도 확인합니다.

npm 배포 전 체크

패키지명 dc-gallery-crawler는 2026-09-05 확인 당시 npm 레지스트리에서 조회되지 않았지만, 실제 배포 직전에 다시 확인해야 합니다.

현재 package.json의 라이선스는 안전하게 UNLICENSED로 두었습니다. 공개 배포 전에 저작권자의 의도에 맞는 라이선스, author, repository, homepage를 정한 뒤 버전을 올리세요. prepublishOnly가 전체 테스트를 실행하고, prepack이 배포용 dist를 다시 빌드합니다.

npm login
npm publish

디시인사이드의 이용약관과 운영 정책을 확인하고, 합리적인 페이지 수와 동시성으로 사용하세요.