This commit is contained in:
@@ -123,4 +123,8 @@
|
|||||||
- Logging
|
- Logging
|
||||||
- Add a more robust logging system
|
- Add a more robust logging system
|
||||||
- Add logging to a file
|
- Add logging to a file
|
||||||
- Add logging to the UI
|
- Add logging to the UI
|
||||||
|
- Qbittorrent
|
||||||
|
- Add support for tags(creating, deleting, listing)
|
||||||
|
- Add support for categories(creating, deleting, listing)
|
||||||
|
- Fix issues with arr sending torrents using a different content type.
|
||||||
12
README.md
12
README.md
@@ -174,7 +174,7 @@ This is the default config file. You can create a `config.json` file in the root
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"repair": {
|
"repair": {
|
||||||
"enabled": true,
|
"enabled": false,
|
||||||
"interval": "12h",
|
"interval": "12h",
|
||||||
"run_on_start": false
|
"run_on_start": false
|
||||||
},
|
},
|
||||||
@@ -233,7 +233,9 @@ This is particularly useful if you want to use the Repair tool without using Qbi
|
|||||||
|
|
||||||
### Proxy
|
### Proxy
|
||||||
|
|
||||||
The proxy is useful in filtering out un-cached Real Debrid torrents.
|
**Note**: Proxy has stopped working for Real Debrid, Debrid Link, and All Debrid. It still works for Torbox. This is due to the changes in the API of the Debrid Providers.
|
||||||
|
|
||||||
|
The proxy is useful in filtering out un-cached Debrid torrents.
|
||||||
The proxy is a simple HTTP proxy that requires basic authentication. The proxy can be enabled by setting the `proxy.enabled` to `true` in the config file.
|
The proxy is a simple HTTP proxy that requires basic authentication. The proxy can be enabled by setting the `proxy.enabled` to `true` in the config file.
|
||||||
The proxy listens on the port `8181` by default. The username and password can be set in the config file.
|
The proxy listens on the port `8181` by default. The username and password can be set in the config file.
|
||||||
|
|
||||||
@@ -252,11 +254,11 @@ The repair worker is a simple worker that checks for missing files in the Arrs(S
|
|||||||
|
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
- [ ] A proper name!!!!
|
- [x] A proper name!!!!
|
||||||
- [x] Debrid
|
- [x] Debrid
|
||||||
- [x] Add more Debrid Providers
|
- [x] Add more Debrid Providers
|
||||||
|
|
||||||
- [ ] Qbittorrent
|
- [x] Qbittorrent
|
||||||
- [ ] Add more Qbittorrent features
|
- [x] Add more Qbittorrent features
|
||||||
- [x] Persist torrents on restart/server crash
|
- [x] Persist torrents on restart/server crash
|
||||||
- [ ] Add tests
|
- [ ] Add tests
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
@@ -9,7 +8,6 @@ import (
|
|||||||
"github.com/sirrobot01/debrid-blackhole/common"
|
"github.com/sirrobot01/debrid-blackhole/common"
|
||||||
"github.com/sirrobot01/debrid-blackhole/pkg/arr"
|
"github.com/sirrobot01/debrid-blackhole/pkg/arr"
|
||||||
"github.com/sirrobot01/debrid-blackhole/pkg/qbit/shared"
|
"github.com/sirrobot01/debrid-blackhole/pkg/qbit/shared"
|
||||||
"io"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -149,10 +147,6 @@ func (q *qbitHandler) handleTorrentsInfo(w http.ResponseWriter, r *http.Request)
|
|||||||
func (q *qbitHandler) handleTorrentsAdd(w http.ResponseWriter, r *http.Request) {
|
func (q *qbitHandler) handleTorrentsAdd(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
body, _ := io.ReadAll(r.Body)
|
|
||||||
q.logger.Debug().Msgf("Raw request body: %s", string(body))
|
|
||||||
r.Body = io.NopCloser(bytes.NewBuffer(body))
|
|
||||||
|
|
||||||
// Parse form based on content type
|
// Parse form based on content type
|
||||||
contentType := r.Header.Get("Content-Type")
|
contentType := r.Header.Get("Content-Type")
|
||||||
if strings.Contains(contentType, "multipart/form-data") {
|
if strings.Contains(contentType, "multipart/form-data") {
|
||||||
@@ -172,13 +166,10 @@ func (q *qbitHandler) handleTorrentsAdd(w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
q.logger.Debug().Msgf("All form values: %+v", r.Form)
|
|
||||||
q.logger.Debug().Msgf("URLs value: %q", r.FormValue("urls"))
|
|
||||||
q.logger.Debug().Msgf("Content-Type: %s", r.Header.Get("Content-Type"))
|
|
||||||
|
|
||||||
isSymlink := strings.ToLower(r.FormValue("sequentialDownload")) != "true"
|
isSymlink := strings.ToLower(r.FormValue("sequentialDownload")) != "true"
|
||||||
category := r.FormValue("category")
|
category := r.FormValue("category")
|
||||||
atleastOne := false
|
atleastOne := false
|
||||||
|
ctx = context.WithValue(ctx, "isSymlink", isSymlink)
|
||||||
|
|
||||||
// Handle magnet URLs
|
// Handle magnet URLs
|
||||||
if urls := r.FormValue("urls"); urls != "" {
|
if urls := r.FormValue("urls"); urls != "" {
|
||||||
@@ -186,8 +177,6 @@ func (q *qbitHandler) handleTorrentsAdd(w http.ResponseWriter, r *http.Request)
|
|||||||
for _, u := range strings.Split(urls, "\n") {
|
for _, u := range strings.Split(urls, "\n") {
|
||||||
urlList = append(urlList, strings.TrimSpace(u))
|
urlList = append(urlList, strings.TrimSpace(u))
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = context.WithValue(ctx, "isSymlink", isSymlink)
|
|
||||||
for _, url := range urlList {
|
for _, url := range urlList {
|
||||||
if err := q.qbit.AddMagnet(ctx, url, category); err != nil {
|
if err := q.qbit.AddMagnet(ctx, url, category); err != nil {
|
||||||
q.logger.Info().Msgf("Error adding magnet: %v", err)
|
q.logger.Info().Msgf("Error adding magnet: %v", err)
|
||||||
|
|||||||
@@ -122,8 +122,9 @@
|
|||||||
const versionBadge = document.getElementById('version-badge');
|
const versionBadge = document.getElementById('version-badge');
|
||||||
const channelBadge = document.getElementById('channel-badge');
|
const channelBadge = document.getElementById('channel-badge');
|
||||||
|
|
||||||
versionBadge.textContent = data.version;
|
// Add url to version badge
|
||||||
channelBadge.textContent = data.channel;
|
versionBadge.innerHTML = `<a href="https://github.com/sirrobot01/debrid-blackhole/releases/tag/${data.version}" target="_blank" class="text-white">${data.version}</a>`;
|
||||||
|
channelBadge.textContent = data.channel.charAt(0).toUpperCase() + data.channel.slice(1);
|
||||||
|
|
||||||
if (data.channel === 'beta') {
|
if (data.channel === 'beta') {
|
||||||
channelBadge.classList.add('beta');
|
channelBadge.classList.add('beta');
|
||||||
|
|||||||
Reference in New Issue
Block a user