hacxk-movie-scrapper
Version:
a
110 lines (73 loc) • 3.11 kB
Markdown
Welcome to the HACXK Tamil Movie Scraper! This project provides a set of functions to scrape movie details from the TamilYogi website. You can search for movies, fetch details from specific movie URLs, and list movies by category.
- **Search Movies**: Search for movies by keyword.
- **Fetch Movie Details**: Fetch movie details, including download links and quality, from a given movie URL.
- **List Movies by Category**: List movies by category, such as Tamil HD Movies, Dubbed Movies, and Web Series.
To use this project, you need to have [Node.js](https://nodejs.org/) installed. Install the required packages using npm:
```bash
npm install hacxk-movie-scrapper
```
Search for movies by a keyword.
```javascript
const { hacxkMovieSearch } = require('hacxk-movie-scrapper');
async function searchMovies(query) {
const result = await hacxkMovieSearch(query);
console.log(JSON.stringify(result, null, 2));
}
// Example usage:
searchMovies('Lift');
```
Fetch detailed information, including download links and quality, from a specific movie URL.
```javascript
const { hacxkMoviedl } = require('hacxk-movie-scrapper');
async function getMovieDetails(url) {
const result = await hacxkMoviedl(url);
console.log(JSON.stringify(result, null, 2));
}
// Example usage:
getMovieDetails('https://tamilyogi.beer/money-heist-s05-vol-2-2021-hd-720p-tamil-dubbed-series-watch-online/');
```
List movies by category. The page number is optional.
```javascript
const { hacxkTamilMovie } = require('hacxk-movie-scrapper');
async function listMovies(option, pageNo) {
const result = await hacxkTamilMovie(option, pageNo);
console.log(JSON.stringify(result, null, 2));
}
// Example usage:
// Option 1: Tamil HD Movies
// Option 2: Dubbed Movies
// Option 3: Web Series
listMovies('1', '2'); // Fetches the second page of Tamil HD Movies
listMovies('2'); // Fetches the first page of Dubbed Movies
```
The functions handle errors gracefully and return a structured JSON response with an error message if any error occurs during scraping.
```json
{
"author": "HACXK",
"github": "https://github.com/hacxk",
"status": false,
"results": "An error occurred while scraping TamilYogi."
}
```
- Ensure the target URLs are accessible. The example URLs point to the TamilYogi website.
- This scraper uses a mobile user agent to fetch the content.
- The page number parameter in `hacxkTamilMovie` is optional.
Contributions are welcome! Feel free to open issues or pull requests on [GitHub](https://github.com/hacxk).
This project is licensed under the ISC License.
- **HACXK**
- [GitHub](https://github.com/hacxk)
Feel free to contribute, raise issues, or suggest improvements. Happy scraping!