https://github.com/alexanderkasten/myjdownloader
Typescript Node.js API Client for myjdownloader
https://github.com/alexanderkasten/myjdownloader
jdownloader myjdownloader myjdownloader-api
Last synced: 6 months ago
JSON representation
Typescript Node.js API Client for myjdownloader
- Host: GitHub
- URL: https://github.com/alexanderkasten/myjdownloader
- Owner: alexanderkasten
- License: mit
- Created: 2025-02-08T17:32:01.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-27T22:36:47.000Z (7 months ago)
- Last Synced: 2025-03-27T23:17:22.360Z (7 months ago)
- Topics: jdownloader, myjdownloader, myjdownloader-api
- Language: TypeScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MyJDownloader API Client
A Node.js client for interacting with the MyJDownloader API. This library provides a simple and typed interface to manage your JDownloader instance remotely.
## Features
- Full TypeScript support
- Implements all major namespaces of the MyJDownloader API
- Easy-to-use methods for common operations
- Configurable options for fine-grained control## Installation
To install the MyJDownloader API client, run the following command in your project directory:
```bash
npm install myjdownloader
```## Usage
Here's a basic example of how to use the JDownloader client:
```typescript
import JDownloader from 'myjdownloader';async function main() {
// Initialize the client with your MyJDownloader credentials
const client = new JDownloader('your-email@example.com', 'your-password');try {
// Connect to the API
await client.connect();// List all available devices
const devices = await client.listDevices();
console.log('Available devices:', devices);
const deviceId = devices[0];
// Get downloads list
const downloads = await client.downloadsV2.queryLinks(deviceId);
console.log('Current downloads:', downloads);// Add new download
await client.linkgrabberV2.addLinks(deviceId, {
links: 'http://example.com/file.zip',
autostart: true
});// Disconnect when done
await client.disconnect();
} catch (error) {
console.error('Error:', error);
}
}main();
```## Direct Connection
If the deprecated direct connection API is enabled, you could connect without myJD to your JDownloader.
```typescript
import JDownloader from 'myjdownloader';async function main() {
// Initialize the client with your MyJDownloader credentials
const client = new JDownloader(null, null, 'http://localhost:3128');try {
// Connect to the API
await client.connect();// List all available devices
const devices = await client.listDevices();
console.log('Available devices:', devices);
const deviceId = devices[0];
// Get downloads list
const downloads = await client.downloadsV2.queryLinks(deviceId);
console.log('Current downloads:', downloads);// Add new download
await client.linkgrabberV2.addLinks(deviceId, {
links: 'http://example.com/file.zip',
autostart: true
});// Disconnect when done
await client.disconnect();
} catch (error) {
console.error('Error:', error);
}
}main();
```