<commit_before>#/bin/bash

torrentzurl=$1 
limetorrentstub=www.limetorrents.com
torrentwatchloc=/home/chris/torrent/watch 

torrentzcontent=$(curl -L $torrentzurl)
[[ $torrentzcontent =~ (http:\/\/$limetorrentstub\/[^\"]*)\" ]] && torrenturl=${BASH_REMATCH[1]}
echo "found limetorrent torrent page at $torrenturl"

torrentcontent=$(curl -L $torrenturl)
[[ $torrentcontent =~ (http:\/\/www.limetorrents.com\/download\/[^\"]*)\" ]] && torrentfileurl=${BASH_REMATCH[1]}
echo "found torrent file at $torrentfileurl"

desttorrentfile=$torrentwatchloc/$(date +%s).torrent
torrentfilecontent=$(curl -L --globoff -o $desttorrentfile $torrentfileurl)
echo "torrent file downloaded successfully, located at $desttorrentfile"<commit_msg>Add trackers to torrent file as part of autodownload<commit_after>#/bin/bash

torrentzurl=$1
torrentzbaseurl=http://torrentz-proxy.com
limetorrentstub=www.limetorrents.com
torrentwatchloc=/home/chris/torrent/watch
temploc=/home/chris/torrent/.scripts/temp
uniquecode=$(date +%s)
torrentutility=/home/chris/torrent/.scripts/addtrackers.pl

temptorrentfiledest=$temploc/$uniquecode.torrent
temptrackerfiledest=$temploc/$uniquecode.tracker
torrentfiledest=$torrentwatchloc/$uniquecode.torrent

torrentzcontent=$(curl -L $torrentzurl)
[[ $torrentzcontent =~ (http:\/\/$limetorrentstub\/[^\"]*)\" ]] && torrenturl=${BASH_REMATCH[1]}
echo "found limetorrent torrent page at $torrenturl"

[[ $torrentzcontent =~ (/announcelist_[^\"]*)\" ]] && trackerurl=$torrentzbaseurl${BASH_REMATCH[1]}
echo "found limetorrent tracker page at $trackerurl"

trackercontent=$(curl -L --globoff -o $temptrackerfiledest $trackerurl)
echo "tracker file downloaded successfully, located at $temptrackerfiledest"

torrentcontent=$(curl -L $torrenturl)
[[ $torrentcontent =~ (http:\/\/www.limetorrents.com\/download\/[^\"]*)\" ]] && torrentfileurl=${BASH_REMATCH[1]}
echo "found torrent file at $torrentfileurl"

desttorrentfile=$torrentwatchloc/$(date +%s).torrent
torrentfilecontent=$(curl -L --globoff -o $temptorrentfiledest $torrentfileurl)
echo "torrent file downloaded successfully, located at $temptorrentfiledest"

$torrentutility -a -noconfirm "$temptrackerfiledest" "$temptorrentfiledest"

cp $temptorrentfiledest $torrentfiledest
echo "PROCESS-COMPLETE: torrent file placed into watch directory"
{'fraction_non_alphanumeric': 0.15321180555555555, 'fraction_numerical': 0.0030381944444444445, 'mean_word_length': 7.087719298245614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '455585', 'n_tokens_mistral': 857, 'n_tokens_neox': 823, 'n_words': 145}