|
@@ -2,10 +2,30 @@ export http_proxy=http://192.168.0.11:8117/
|
|
|
export https_proxy=http://192.168.0.11:8117/
|
|
|
export no_proxy=192.168.0.11
|
|
|
|
|
|
+validate_torrent() {
|
|
|
+ local torrent_file="$1"
|
|
|
+
|
|
|
+ if aria2c -S "$torrent_file"; then
|
|
|
+ echo "Valid: $torrent_file"
|
|
|
+ else
|
|
|
+ echo "Invalid or corrupted: $torrent_file"
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+validate_all_torrents() {
|
|
|
+ local dir="$1"
|
|
|
+
|
|
|
+ # Use find to locate all .torrent files in the specified directory and subdirectories
|
|
|
+ find "$dir" -type f -name "*" | while read -r torrent_file; do
|
|
|
+ validate_torrent "$torrent_file"
|
|
|
+ done
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
mkdir -p done/music
|
|
|
mkdir -p done/books
|
|
|
-mkdir m
|
|
|
-mkdir b
|
|
|
+mkdir -p m
|
|
|
+mkdir -p b
|
|
|
|
|
|
echo "get all M"
|
|
|
mv ml_* m
|
|
@@ -14,6 +34,7 @@ for f in ml_*; do cat $f; echo; done > ml
|
|
|
rm -f ml_*
|
|
|
wget2 -c -i ml
|
|
|
rm -f ml
|
|
|
+validate_all_torrents `pwd`
|
|
|
find . -maxdepth 1 -type f -exec sh -c 'mv "$0" "../done/music/$0.torrent"' {} \;
|
|
|
|
|
|
cd ..
|
|
@@ -25,4 +46,5 @@ for f in bl_*; do cat $f; echo; done > bl
|
|
|
rm -f bl_*
|
|
|
wget2 -c -i bl
|
|
|
rm -f bl
|
|
|
+validate_all_torrents `pwd`
|
|
|
find . -maxdepth 1 -type f -exec sh -c 'mv "$0" "../done/books/$0.torrent"' {} \;
|