MediaServerScripts/qBitTorrentDumpBasicTorrentInfo.php

15 lines
471 B
PHP

<?php
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/lib/qBitTorrent.php';
use Decicus\qBitTorrent\Client as QBitClient;
$qBitClient = new QBitClient();
$torrents = $qBitClient->getBasicTorrentsInfo();
$json = json_encode($torrents, JSON_PRETTY_PRINT);
$filename = sprintf('%s/output/%s_torrents_dump.json', __DIR__, time());
fileWrite($filename, $json);
echo sprintf("Torrent output written to: %s\n", $filename);