|
import { fetchRSSFeeds } from '../src/rss.js'; |
|
|
|
async function testRSSFeeds() { |
|
try { |
|
|
|
const imdbId = "tt6263850"; |
|
console.log('\n๐งช Testing RSS Feeds with IMDB ID:', imdbId); |
|
|
|
console.log('Fetching RSS feeds...'); |
|
const streams = await fetchRSSFeeds(imdbId); |
|
|
|
console.log('\n๐ Results:'); |
|
console.log(`Total streams found: ${streams.length}`); |
|
|
|
|
|
const sourceGroups = streams.reduce((acc, stream) => { |
|
acc[stream.source] = acc[stream.source] || []; |
|
acc[stream.source].push(stream); |
|
return acc; |
|
}, {}); |
|
|
|
|
|
Object.entries(sourceGroups).forEach(([source, sourceStreams]) => { |
|
console.log(`\n${source}:`); |
|
console.log(`Found ${sourceStreams.length} streams`); |
|
|
|
|
|
sourceStreams.slice(0, 3).forEach((stream, index) => { |
|
console.log(`\n${index + 1}. Stream Details:`); |
|
console.log(`Title: ${stream.filename}`); |
|
console.log(`Quality: ${stream.quality}`); |
|
console.log(`Size: ${stream.size}`); |
|
console.log(`Magnet: ${stream.magnetLink.substring(0, 60)}...`); |
|
}); |
|
}); |
|
|
|
|
|
const qualityDistribution = streams.reduce((acc, stream) => { |
|
acc[stream.quality] = (acc[stream.quality] || 0) + 1; |
|
return acc; |
|
}, {}); |
|
|
|
console.log('\n๐ Quality Distribution:'); |
|
Object.entries(qualityDistribution).forEach(([quality, count]) => { |
|
console.log(`${quality}: ${count} streams`); |
|
}); |
|
|
|
} catch (error) { |
|
console.error('โ Test failed:', error); |
|
} |
|
} |
|
|
|
|
|
console.log('๐ Starting RSS Feed Test\n'); |
|
testRSSFeeds().then(() => { |
|
console.log('\nโ
Test completed'); |
|
}).catch(error => { |
|
console.error('\nโ Test failed:', error); |
|
}); |
|
|