Renaming to torrents.csv

This commit is contained in:
Dessalines 2018-10-04 16:33:33 -07:00
parent 01c3d23b42
commit 98388dc3fa
5 changed files with 17 additions and 18 deletions

View File

@ -1,22 +1,22 @@
# Torrent.csv
# Torrents.csv
`Torrent.csv` is a vetted database of torrents, consisting of a single, searchable `torrent.csv` file.
`Torrents.csv` is a vetted database of torrents, consisting of a single, searchable `torrents.csv` file.
An *upload*, consists of making a pull request after running the `add_torrents.sh` script that adds your new unique torrents to the file, after checking that they aren't already there, and that they have seeders.
To find torrents run `./find.sh "SEARCH"`
To contribute:
- [Click here](https://gitlab.com/dessalines/torrent.csv/forks/new) to fork this repo.
- [Click here](https://gitlab.com/dessalines/torrents.csv/forks/new) to fork this repo.
```sh
git clone https://gitlab.com/[MY_USER]/torrent.csv
cd torrent.csv
git clone https://gitlab.com/[MY_USER]/torrents.csv
cd torrents.csv
./add_torrents.sh MY_TORRENTS_DIR # `MY_TORRENTS_DIR` is `~/.local/share/data/qBittorrent/BT_backup/` for qBittorrent on linux, but you can search for where your torrents are stored for your client.
git commit -am "Adding my torrents"
git push
```
Then [click here](https://gitlab.com/dessalines/torrent.csv/merge_requests/new) to do a pull/merge request to my branch.
Then [click here](https://gitlab.com/dessalines/torrents.csv/merge_requests/new) to do a pull/merge request to my branch.
## How the file looks
```sh
@ -24,5 +24,5 @@ infohash;name;size_bytes;created_unix;seeders;leechers;completed;scraped_date
# torrents here...
```
`Torrent.csv` will be periodically purged of non-seeded torrents, and potentially sorted.
`Torrents.csv` will be periodically purged of non-seeded torrents, and potentially sorted.

View File

@ -1,8 +1,8 @@
# Checking arguments
# Help line
torrent_csv_file="`pwd`/torrent.csv"
torrents_csv_file="`pwd`/torrents.csv"
help="Run ./add_torrents.sh [TORRENTS_DIR] \nor goto https://gitlab.com/dessalines/torrent.csv for more help"
help="Run ./add_torrents.sh [TORRENTS_DIR] \nor goto https://gitlab.com/dessalines/torrents.csv for more help"
if [ "$1" == "-h" ] || [ -z "$1" ]; then
echo -e $help
exit 1
@ -71,15 +71,15 @@ for torrent_file in *.torrent; do
add_line="$infohash;$name;$size_bytes;$created_date;$seeders;$leechers;$completed;$scraped_date"
# Only add the line if there are seeds, and the infohash doesn't already exist
if (( $seeders > 0 )) && ! grep -q $infohash $torrent_csv_file; then
if (( $seeders > 0 )) && ! grep -q $infohash $torrents_csv_file; then
# TODO edit this logic to do a line replace where its already there
# TODO edit this logic to do a line replace where its already there, to pick up new seeder counts
# Append the add lines to the torrent.csv file
echo -e "\n$add_line" >> $torrent_csv_file
truncate -s -1 $torrent_csv_file # Removing last newline
echo -e "Added $name to $torrent_csv_file"
# head -n1 $torrent_csv_file && sort <(tail -n+2 $torrent_csv_file) > $torrent_csv_file # Sort it
# Append the add lines to the torrents.csv file
echo -e "\n$add_line" >> $torrents_csv_file
truncate -s -1 $torrents_csv_file # Removing last newline
echo -e "Added $name to $torrents_csv_file"
# head -n1 $torrents_csv_file && sort <(tail -n+2 $torrents_csv_file) > $torrents_csv_file # Sort it
else
echo -e "$name had no seeders, or was already added."
fi

View File

@ -1,4 +1,4 @@
torrent_csv_file="`pwd`/torrent.csv"
torrent_csv_file="`pwd`/torrents.csv"
search=$(grep -i "$1" $torrent_csv_file)

View File

@ -1 +0,0 @@
infohash;name;size_bytes;created_unix;seeders;leechers;completed;scraped_date
1 infohash name size_bytes created_unix seeders leechers completed scraped_date