Download src/test.js from no1b4me/calc: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/spaces/no1b4me/calc/resolve/main/src/test.js
- Command line
-
hf download hf://spaces/no1b4me/calc/src/test.js
-
curl -L -o test.js https://huggingface.co/spaces/no1b4me/calc/resolve/main/src/test.js
2.09 kB
| import { fetchRSSFeeds } from '../src/rss.js'; | |
| async function testRSSFeeds() { | |
| try { | |
| // Test with a recent movie - Deadpool & Wolverine | |
| 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}`); | |
| // Group streams by source | |
| const sourceGroups = streams.reduce((acc, stream) => { | |
| acc[stream.source] = acc[stream.source] || []; | |
| acc[stream.source].push(stream); | |
| return acc; | |
| }, {}); | |
| // Print results by source | |
| Object.entries(sourceGroups).forEach(([source, sourceStreams]) => { | |
| console.log(`\n${source}:`); | |
| console.log(`Found ${sourceStreams.length} streams`); | |
| // Print first 3 streams as examples | |
| 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)}...`); | |
| }); | |
| }); | |
| // Test quality distribution | |
| 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); | |
| } | |
| } | |
| // Run the test | |
| console.log('🚀 Starting RSS Feed Test\n'); | |
| testRSSFeeds().then(() => { | |
| console.log('\n✅ Test completed'); | |
| }).catch(error => { | |
| console.error('\n❌ Test failed:', error); | |
| }); | |