mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 10:48:53 +00:00
29 lines
619 B
PHP
29 lines
619 B
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
use Blacklight\NZBGet;
|
|
use Blacklight\SABnzbd;
|
|
|
|
if (! User::isLoggedIn()) {
|
|
$page->show403();
|
|
}
|
|
|
|
if (empty($page->request->input('id'))) {
|
|
$page->show404();
|
|
}
|
|
|
|
$user = User::find(User::currentUserId());
|
|
if ((int) $user['queuetype'] !== 2) {
|
|
$sab = new SABnzbd($page);
|
|
if (empty($sab->url)) {
|
|
$page->show404();
|
|
}
|
|
if (empty($sab->apikey)) {
|
|
$page->show404();
|
|
}
|
|
$sab->sendToSab($page->request->input('id'));
|
|
} elseif ((int) $user['queuetype'] === 2) {
|
|
$nzbget = new NZBGet($page);
|
|
$nzbget->sendURLToNZBGet($page->request->input('id'));
|
|
}
|