diff --git a/hdrezkas.js b/hdrezkas.js new file mode 100644 index 00000000..77749ae0 --- /dev/null +++ b/hdrezkas.js @@ -0,0 +1,516 @@ +// Simplified standalone script to test hdrezka scraper flow +import fetch from 'node-fetch'; +import readline from 'readline'; + +// Constants +const rezkaBase = 'https://hdrezka.ag/'; +const baseHeaders = { + 'X-Hdrezka-Android-App': '1', + 'X-Hdrezka-Android-App-Version': '2.2.0', +}; + +// Parse command line arguments +const args = process.argv.slice(2); +const argOptions = { + title: null, + type: null, + year: null, + season: null, + episode: null +}; + +// Process command line arguments +for (let i = 0; i < args.length; i++) { + if (args[i] === '--title' || args[i] === '-t') { + argOptions.title = args[i + 1]; + i++; + } else if (args[i] === '--type' || args[i] === '-m') { + argOptions.type = args[i + 1].toLowerCase(); + i++; + } else if (args[i] === '--year' || args[i] === '-y') { + argOptions.year = parseInt(args[i + 1]); + i++; + } else if (args[i] === '--season' || args[i] === '-s') { + argOptions.season = parseInt(args[i + 1]); + i++; + } else if (args[i] === '--episode' || args[i] === '-e') { + argOptions.episode = parseInt(args[i + 1]); + i++; + } else if (args[i] === '--help' || args[i] === '-h') { + console.log(` +HDRezka Scraper Test Script + +Usage: + node hdrezka-test.js [options] + +Options: + --title, -t