UNPKG

gphotos-scraper

Version:

A tool to extract public url and metadata from shared album

34 lines (28 loc) 1.75 kB
# Changelog All notable changes to this project will be documented in this file. ## [3.0.0] - 2026-02-08 ### Added - **Performance**: Implemented "Extreme Performance" refactoring. - Added `axiosClient` with `keepAlive` (reusing TCP connections) and Gzip compression. - Implemented `p-limit` for parallel processing in `extractAlbum` (defaults to 5 concurrent requests). - **Testing**: Added **Vitest** testing framework. - Created unit tests for `getPhotos`, `getAlbum`, and `extractAlbum`. - Added `npm test` and `npm run test:watch` scripts. - **Linting & Formatting**: Migrated to **Biome**. - Replaced `eslint` and `prettier` with `@biomejs/biome` for faster and unified linting/formatting. - Added `npm run lint`, `npm run lint:fix`, and `npm run format` scripts. ### Changed - **Core Logic**: - **`getAlbum.ts`**: Replaced `cheerio` with **Regex** for metadata extraction (Canonical URL and Key), significantly reducing memory usage and parsing time. - **`getPhotos.ts`**: Optimized RPC response parsing with defensive error handling and `URLSearchParams` for efficient body construction. - **`extractAlbum.ts`**: Now uses a `Map` for O(1) ID lookups and sorts output by `createdAt` descending. - **Dependencies**: - Updated `axios`, `commander`, `mime-types`. - Removed `cheerio` (bloat removal). - Removed `eslint`, `globals`, `@eslint/js`, `typescript-eslint`. - **Configuration**: - Updated `tsconfig.json` to strict mode. - Added `biome.json` and `vitest.config.ts`. ### Fixed - Fixed an issue where `getPhotos` might return duplicate items or fail on malformed RPC responses. - Fixed `getAlbum` to reliably extract the album key even when not present in the URL query parameters.