From 4751d525604f2e5678dea9974f8971d73635729f Mon Sep 17 00:00:00 2001 From: Heretic Date: Sun, 27 Aug 2023 16:25:07 -0400 Subject: [PATCH] Updating torrents-csv-data. --- data | 2 +- search.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data b/data index 88669d9..4c30726 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 88669d92df2ae633e5708a0f4d6bba0e10147a5a +Subproject commit 4c30726ce54d9a8abb43f4679fc065c7a2482a13 diff --git a/search.sh b/search.sh index 8e1f35d..335a4c8 100755 --- a/search.sh +++ b/search.sh @@ -4,12 +4,12 @@ torrent_csv_file="`pwd`/data/torrents.csv" search_string=${1// /.*} # turn multiple string regexes into i.*am.*spartacus # Read the lines of the results -rg -i "$search_string" $torrent_csv_file | sort --field-separator=';' --key=5 -g | while read -r line; do - infohash=$(echo -e "$line" | cut -d ';' -f1) +rg -i "$search_string" $torrent_csv_file | sort --field-separator=',' --key=8 -g | while read -r line; do + infohash=$(echo -e "$line" | cut -d ',' -f1) magnet_link="magnet:?xt=urn:btih:$infohash" - name=$(echo -e "$line" | cut -d ';' -f2) - seeders=$(echo -e "$line" | cut -d ';' -f5) - size_bytes=$(echo -e "$line" | cut -d ';' -f3) + name=$(echo -e "$line" | cut -d ',' -f2) + seeders=$(echo -e "$line" | cut -d ',' -f5) + size_bytes=$(echo -e "$line" | cut -d ',' -f3) size=$(numfmt --to=iec-i --suffix=B $size_bytes) # Construct the search result result="$name\n\tseeders: $seeders\n\tsize: $size\n\tlink: $magnet_link"