Files
metascraper/README.md
2025-11-23 14:25:09 +03:00

103 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# metascraper
Netflix URL'lerinden film ve dizi meta verilerini (başlık, yıl, sezon bilgisi) çıkaran modern Node.js kütüphanesi.
## 🚀 Kurulum
```bash
npm install metascraper
```
## 💻 Kullanım
### Film Meta Verisi
```javascript
import { scraperNetflix } from 'metascraper';
const movie = await scraperNetflix('https://www.netflix.com/tr/title/82123114');
console.log(movie);
// {
// "url": "https://www.netflix.com/title/82123114",
// "id": "82123114",
// "name": "ONE SHOT with Ed Sheeran",
// "year": "2025",
// "seasons": null
// }
```
### Dizi Meta Verisi
```javascript
import { scraperNetflix } from 'metascraper';
const series = await scraperNetflix('https://www.netflix.com/tr/title/80189685');
console.log(series);
// {
// "url": "https://www.netflix.com/title/80189685",
// "id": "80189685",
// "name": "The Witcher",
// "year": "2025",
// "seasons": "4 Sezon"
// }
```
### URL Normalizasyonu
URL normalizasyonu artık `scraperNetflix` fonksiyonu içinde otomatik olarak yapılır.
## ✨ Özellikler
-**Film ve Dizi Destekli** - Her tür Netflix içeriği için meta veri
-**Türkçe Arayüz Temizleme** - "izlemenizi bekliyor" gibi metinleri temizler
-**JSON-LD Tabanlı** - Netflix'in yapısal verilerini kullanır
-**Hızlı ve Güvenilir** - Statik HTML scraping + Playwright fallback
-**Node.js 18+ Uyumlu** - Modern JavaScript özellikleri
-**Türkiye Odaklı** - Netflix Türkiye URL'leri optimize edilmiş
## 🔧 API
### `scraperNetflix(url, options)`
Netflix URL'sinden meta veri çeker. URL normalizasyonu otomatik olarak yapılır.
**Parametreler:**
- `url` (string): Netflix URL'i
- `options` (object, isteğe bağlı):
- `headless` (boolean): Headless mode (default: false)
- `timeoutMs` (number): Timeout süresi (default: 15000)
- `userAgent` (string): Özel User-Agent
**Dönen Veri:**
```typescript
{
url: string, // Temizlenmiş URL
id: string, // Netflix ID
name: string, // İçerik adı
year: string | number, // Yılı
seasons: string | null // Sezon bilgisi (diziler için)
}
```
## 🧪 Testler
```bash
npm test
```
## 🎮 Demo
```bash
npm run demo
```
## 📦 Gereksinimler
- Node.js 18+
- cheerio (otomatik)
- playwright (isteğe bağlı, headless mode için)
## 📄 Lisans
MIT