diff --git a/website/index.php b/website/index.php
index 288133c..7d07c60 100644
--- a/website/index.php
+++ b/website/index.php
@@ -13,7 +13,8 @@ Access raw data with: .
@@ -64,7 +65,7 @@ Access raw data with: .
function search(event) {
// We don't want to refresh the webpage which is the default behavior.
event.preventDefault();
- const query = document.getElementById('search').value;
+ const query = event.submitter.id + ' ' + document.getElementById('search').value;
if (firstRun) {
firstRun = false;
conn = new WebSocket('wss://crawler.yt.lemnoslife.com/websocket');
diff --git a/website/search.py b/website/search.py
index c8f0bda..ff4038c 100755
--- a/website/search.py
+++ b/website/search.py
@@ -7,6 +7,9 @@ path = '/mnt/HDD0/YouTube_captions_search_engine/channels/'
clientId = sys.argv[1]
message = sys.argv[2]
+searchOnlyCaptions = message.startswith('search-only-captions ')
+message = message[message.find(' ') + 1:]
+
clientFilePath = f'users/{clientId}.txt'
def write(s):
@@ -31,6 +34,8 @@ for file in os.listdir(path):
if file.endswith('.zip'):
zip = zipfile.ZipFile(path + file)
for fileInZip in zip.namelist():
+ if searchOnlyCaptions and not fileInZip.endswith('.vtt'):
+ continue
f = zip.open(fileInZip)
for line in f.readlines():
if message in str(line):