diff --git a/__pycache__/torrent_vahti.cpython-311.pyc b/__pycache__/torrent_vahti.cpython-311.pyc index b12c6ce..969a3c5 100644 Binary files a/__pycache__/torrent_vahti.cpython-311.pyc and b/__pycache__/torrent_vahti.cpython-311.pyc differ diff --git a/app.py b/app.py index 9cfaca0..a59bcff 100644 --- a/app.py +++ b/app.py @@ -85,7 +85,9 @@ def lisaa_kohde(): kaikki_data = torrent_vahti.lataa_kaikki_data() kaikki_data["hakukohteet"].append({ "jackett_haku": data['jackett_haku'], - "kohdekansio": data['kohdekansio'] + "regex_suodatin": data.get('regex_suodatin', '.*'), + "kohdekansio": data['kohdekansio'], + "paivat": data.get('paivat', [0, 1, 2, 3, 4, 5, 6]) }) torrent_vahti.tallenna_kaikki_data(kaikki_data) return jsonify({'status': 'ok'}) diff --git a/hakulista.json b/hakulista.json index 1cc125a..5e99ac8 100644 --- a/hakulista.json +++ b/hakulista.json @@ -5,7 +5,8 @@ "therarbg", "thepiratebay", "torrentdownload", - "limetorrents" + "limetorrents", + "filemood" ], "hakukohteet": [ { @@ -27,10 +28,6 @@ "jackett_haku": "Formula 1 2026 SkyF1HD 1080p", "regex_suodatin": "(?i)Formula.?1.*2026.*SkyF1HD.*1080p", "kohdekansio": "Formula1" - }, - { - "jackett_haku": "Rio hamasaki", - "kohdekansio": "All" } ], "asetukset": { diff --git a/templates/index.html b/templates/index.html index 3b17eb7..a7bd386 100644 --- a/templates/index.html +++ b/templates/index.html @@ -46,6 +46,18 @@
+
+
+
+ + + + + + + +
+
@@ -156,14 +168,16 @@ function poistaKohde(i) { fetch(`/poista_kohde/${i}`, {method:'DELETE'}).then(() => paivitaNakyma()); } document.getElementById('lisaa-form').addEventListener('submit', (e) => { - e.preventDefault(); + e.preventDefault(); + const paivat = [0,1,2,3,4,5,6].filter(i => document.getElementById('pv-'+i).checked); fetch('/lisaa_kohde', { method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({ jackett_haku: document.getElementById('haku-sana').value, regex_suodatin: document.getElementById('haku-regex').value, - kohdekansio: document.getElementById('haku-kansio').value + kohdekansio: document.getElementById('haku-kansio').value, + paivat: paivat }) }).then(() => { e.target.reset(); paivitaNakyma(); }); }); diff --git a/torrent_vahti.py b/torrent_vahti.py index 43d3559..e8cf191 100644 --- a/torrent_vahti.py +++ b/torrent_vahti.py @@ -3,6 +3,7 @@ import re import time import requests import json +import datetime from bs4 import BeautifulSoup SKRIPTIN_KANSIO = os.path.dirname(os.path.abspath(__file__)) @@ -102,6 +103,7 @@ def tarkista_ja_lataa(): print(f"--- ALOITETAAN ERITELTY JACKETT & QBITTORRENT API-HAKU ({time.strftime('%Y-%m-%d %H:%M:%S')}) ---") data = lataa_kaikki_data() ladatut = lataa_jo_ladatut() + tanaan = datetime.datetime.now().weekday() jackett_url = data["asetukset"].get("jackett_url", "") api_key = data["asetukset"].get("jackett_api_key", "") @@ -116,6 +118,10 @@ def tarkista_ja_lataa(): return for kohde in hakulista: + sallitut_paivat = kohde.get("paivat", [0, 1, 2, 3, 4, 5, 6]) + if tanaan not in sallitut_paivat: + continue + haku = kohde["jackett_haku"] hakusanat = haku.lower().split() kategoria = kohde["kohdekansio"].strip()