2.0.1 • Published 5 months ago
@speed_of/movietorrent-scraper v2.0.1
YTS Movie Scraper
Description
This project is a web scraper for extracting movie information and torrent details from YTS.mx. It uses axios
for fetching HTML content and regular expressions for parsing movie details, including torrents, resolutions, and subtitles.
Features
- Search Movies: Fetches movie details from YTS based on a query.
- Retrieve Torrents: Extracts available torrent links and specifications (resolution, language, FPS, seeds, etc.).
- Seed Extraction: Custom function to extract the number of seeds.
Installation
- Clone the repository:
git clone https://github.com/your-repo/yts-movie-scraper.git cd yts-movie-scraper
- Install dependencies:
npm install
Usage
Search for Movies
import { ytsMovieScraper } from './ytsScraper';
(async () => {
const movies = await ytsMovieScraper.search('Inception');
console.log(movies);
})();
Fetch Torrents for a Movie
(async () => {
const torrents = await ytsMovieScraper.getTorrents('inception-2010');
console.log(torrents);
})();
Methods
search(query: string): Promise<ytsMovieScraper[]>
- Searches for movies based on the given query.
- Returns an array of movie objects containing
id
,title
,year
,rating
,genre
,imageurl
, andurl
.
getTorrents(movieId: string): Promise<Torrent[]>
- Retrieves torrent links and metadata for the specified movie ID.
- Returns an array of torrent objects containing
link
,description
,size
,resolution
,language
,fps
,duration
,seeds
, andsubtitlesUrl
.
private seedextractSpecValue(block: string): string
- Extracts the number of seeds from the HTML.
- Returns the seed count as a string.
Dependencies
axios
: HTTP client for fetching web pages.
License
This project is licensed under the MIT License.