A standalone script that automates the process of fetching torrent files from OneJav.com. The script crawls the website's daily listings, extracts torrent links, and downloads them locally.
- Fetches torrent links from specified dates (defaults to yesterday)
- Smart pagination handling - automatically detects and fetches all available pages
- Automatic torrent file downloading
- Built-in rate limiting to prevent server overload
- User-agent spoofing for reliable access
- Error handling and logging
- Deno runtime environment
- Internet access
- Write permissions for local directory
Run the script with the necessary permissions:
deno run --allow-net --allow-write fetchOnejav.js
The script accepts several configuration parameters:
dateStr
: (Optional) Specific date to fetch torrents from (format: YYYY-MM-DD)- Defaults to yesterday's date if not specified
- Automatically detects the presence of additional pages
- Continues fetching until no more pages are available
- Uses the site's pagination system to ensure complete coverage
- Includes built-in delay between page requests to respect server resources
- All downloaded torrent files are saved to
./torrents/
directory - Directory is automatically created if it doesn't exist
- Files are saved with their original filenames
- 1-second delay between torrent downloads
- Additional 1-second delay between page requests
- Respects server resources and prevents rate limiting