Newsmangler Support in Rarnpar

Many people have asked me to add the option to upload files automatically with newsmangler. I thought that this is a great idea and decided to implement it in the next release. So, in the new(0.80) version, you’ll see two new options -U(upload) and -X(path to newsmangler executable). They should not cause any problems, if you are familiar with the script already. In case you aren’t, you could always check the detailed guide prepared by my friend.

18a19
> # 2013-10-21: Added newsmangler support; version 0.80
70c71
< 	BLOCK_SIZE=384000
---
> 	BLOCK_SIZE=768000
154a156,159
> 	# Do we need to upload all the files automatically?
> 	UPLOAD=0
> 	# In case if newsmangler isn't in the PATH - user needs to specify where to find it
> 	PATH_TO_MANGLER=
232c237
< 	echo "Rar&Par script version 0.78. Copyright (C) 2011-2013 Tadeus Dobrovolskij."
---
> 	echo "Rar&Par script version 0.80. Copyright (C) 2011-2013 Tadeus Dobrovolskij."
236c241
< 	echo "For the full functionality you will also need: coreutils(present on almost any distro), cksfv and mediainfo."
---
> 	echo "For the full functionality you will also need: coreutils(present on almost any distro), cksfv, newsmangler and mediainfo."
240c245
< 	echo -e "\t-b <size>\tPar block size. Default: \033[1m384000\033[0m"
---
> 	echo -e "\t-b <size>\tPar block size. Default: \033[1m768000\033[0m"
266a272
> 	echo -e "\t-U\t\tUpload processed files automatically."
268c274,275
< 	echo -e "\t-V\t\tBe verbose.\n"
---
> 	echo -e "\t-V\t\tBe verbose."
> 	echo -e "\t-X <path>\tFull path to newsmangler eXecutable.\n"
394a402,405
> 		-U)
> 		 UPLOAD=1
> 		 shift
> 		 ;;
402a414,417
> 		-X)
> 		 PATH_TO_MANGLER="$2"
> 		 shift 2
> 		 ;;
448a464,478
> # Check if newsmangler binary was specified
> if (( $UPLOAD==1 ))
> then
> 	if [ -z "$PATH_TO_MANGLER" ] && ! type mangler.py > /dev/null 2>&1
> 	then
> 		echo "Error: Please specify the path to newsmangler executable file."
> 		echo "Upload not possible. Quiting..."
> 		exit 1
> 	fi
> 	if [ -z "$PATH_TO_MANGLER" ] && type mangler.py > /dev/null 2>&1
> 	then
> 		PATH_TO_MANGLER="mangler.py"
> 	fi
> fi
> 
522c552
< 	# We need some other directory name, beucause otherwise we will encounter conflicts
---
> 	# We need some other directory name, because otherwise we will encounter conflicts
565a596,612
> 			# Upload files with newsmangler if needed
> 			if (( $UPLOAD==1 ))
> 			then
> 				# We want to skip nfo in cryptomode, because it shows the real file name
> 				if (( $CRYPTMODE==1 ))
> 				then
> 					mv "${OUTPUT_DIR}${FILENAME}"/"${ORIGINAL_NAME}.nfo" /tmp/
> 				fi
> 				"$PATH_TO_MANGLER" "${OUTPUT_DIR}${FILENAME}"
> 				if (( $CRYPTMODE==1 ))
> 				then
> 					mv /tmp/"${ORIGINAL_NAME}.nfo" "${OUTPUT_DIR}${FILENAME}"/
> 				fi
> 				# move nzb to the output directory
> 				NEWSMANGLER_NZB=$(echo -n "newsmangler_${FILENAME}.nzb" | sed -e 's/ /_/g' )
> 				[ -e $NEWSMANGLER_NZB ] && mv $NEWSMANGLER_NZB "${OUTPUT_DIR}${FILENAME}"/${NEWSMANGLER_NZB#newsmangler_}
> 			fi
655a703,719
> 			fi
> 			# Upload files with newsmangler if needed
> 			if (( $UPLOAD==1 ))
> 			then
> 				# We want to skip nfo in cryptomode, because it shows the real file name
> 				if (( $CRYPTMODE==1 ))
> 				then
> 					mv "${OUTPUT_DIR}${FILENAME}"/"${ORIGINAL_NAME}.nfo" /tmp/
> 				fi
> 				"$PATH_TO_MANGLER" "${OUTPUT_DIR}${FILENAME}"
> 				if (( $CRYPTMODE==1 ))
> 				then
> 					mv /tmp/"${ORIGINAL_NAME}.nfo" "${OUTPUT_DIR}${FILENAME}"/
> 				fi
> 				# move nzb to the output directory
> 				NEWSMANGLER_NZB=$(echo -n "newsmangler_${FILENAME}.nzb" | sed -e 's/ /_/g' )
> 				[ -e $NEWSMANGLER_NZB ] && mv $NEWSMANGLER_NZB "${OUTPUT_DIR}${FILENAME}"/${NEWSMANGLER_NZB#newsmangler_}

The logic of the script hasn’t changed that much. As you can see in the diff, I just added few more variables and few more checks. I haven’t seen any problems on my testing box, however it doesn’t mean that there are none. If you encounter some issue, feel free to let me know about it. Feedback is always welcome.

You should probably know, where to find the new release, but I will present all the options nonetheless:

One thought on “Newsmangler Support in Rarnpar”

  1. Is there a way to set a flag of “Upload after processing dir” It would be such a useful function , I love the upload as it goes don’t get me wrong! But also its nice for load balancing and predictability of # of connections and so on… For now I just proccess , then feed an uploader. Speaking of uploaders LOVE SANGUI its being problematic with Giganews but works wonders on Astra

Leave a Reply

Your email address will not be published. Required fields are marked *


seven − = 2

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>