@spacepumpkin/torrent-galaxy-api
v1.240302.1
Published
`npm i @spacepumpkin/torrent-galaxy-api`
Downloads
2
Readme
Install
npm i @spacepumpkin/torrent-galaxy-api
Example
import { search, setAntiCaptchaApiKey } from '@spacepumpkin/galaxy-torrent-api'
// Set anti-captcha.com api key to bypass galaxyfence
setAntiCaptchaApiKey('your api key')
// Get results for black mirror that are not older than 1st Jan 2023
const results: Array<Listing> = search('black mirror', new Date("2023-01-01"))
type Listing = Partial<{
/** link to the full galaxy torrent page for this torrent */
href: string
/** Name of the torrent */
title: string
/** IMDb Id related to this listing (if any) */
imdbId: string
/** Magnet link for torrent */
magnet: string
/** The uploader of this torrent */
uploader: string
/** Upload date */
uploadDate: Date
/** Size of the torrent (in bytes) */
size: number
/** Seeder count at time of fetch */
seeders: number
/** Leacher count at time of fetch */
leachers: number
/** Whether or not the torrent is from a verified uploader */
verified: boolean
/** Language associated with torrent (if any) */
language: string
}>
GalaxyFence
Occasionally a search will be interrupted by GalaxyFence, the flow is as follows
- Makes a call to a search endpoint
- Get redirected to /galaxyfence.php
- Extract the image url on the page and save PHPSESSID cookie
- Send a base64 encoded image to anti-captcha.com
- Make a post request to /galaxyfence with the solved captcha
- Receive a galaxyfence cookie that gives temporary immunity
This flow is automatic. If a redirect is detected it'll be taken care of before returning search results. To use this feature you will need to provide an anti-captcha api key by calling setAntiCaptchaApiKey(key)