echo -e "226Grabbing NFO variables..." rarfiles=$(ls -1 ${fbase}.r*) $cksfv -b $rarfiles >${fbase}.sfv || { echo -e "226Error: Failed to create sfv file!" exit 1 } b_sizes=$(sum=0; files=0; for element in $(cat ./${fbase}.sfv | grep '^;' | awk '{print $2}' | tr -cd '0-9\n'); do let sum=sum+element; let files=files+1; done; echo $sum:$files) #echo -e "226Grabbing NFO variables..." video=$(cat ./${fbase}-info.sbt | grep " V: " | cut -d ':' -f 2-) audio=$(cat ./${fbase}-info.sbt | grep "\[avi" | grep -v " V: " | sed "s/\[.*\] //g" | tr '\n' ' ' | tr -s ' ') v_fps=$(echo "$video" | cut -d ',' -f 1 | tr -cd '0-9.') v_codec=$(echo "$video" | cut -d ',' -f 2 | cut -d '=' -f 2) v_frames=$(echo "$video" | cut -d ',' -f 3 | cut -d '=' -f 2) v_width=$(echo "$video" | cut -d ',' -f 4 | cut -d '=' -f 2) v_height=$(echo "$video" | cut -d ',' -f 5 | cut -d '=' -f 2) a_hz=$(echo "$audio" | cut -d ',' -f 1 | tr -cd '0-9') a_format_raw=$(echo "$audio" | cut -d ',' -f 2 | cut -d '=' -f 2) a_bits=$(echo "$audio" | cut -d ',' -f 3 | cut -d '=' -f 2) a_channels=$(echo "$audio" | cut -d ',' -f 4 | cut -d '=' -f 2) a_bitrate_2=$(echo "$audio" | cut -d ',' -f 5 | tr -cd '0-9') a_chunks=$(echo "$audio" | cut -d ',' -f 6 | tr -cd '0-9') a_bytes=$(echo "$audio" | cut -d ',' -f 7 | tr -cd '0-9') a_vbrcbr=$(echo "$audio" | cut -d ',' -f 8 | tr -d ' ') [[ "$a_bitrate" == "0" ]] && a_bitrate="$a_bitrate_2" [[ "$a_format_raw" == "0x2000" ]] && a_format="AC3" [[ "$a_format_raw" == "0x55" ]] && a_format="MP3" [[ "$a_format_raw" == "0x1" ]] && a_format="PCM WAV" r_files=$(echo $b_sizes | cut -d ':' -f 2) r_bsize=$(echo $b_sizes | cut -d ':' -f 1) unset rname while read -d \. reltemp; do [[ -z "$rname" ]] && { rname="$reltemp" } || { [[ -z "$(echo " $remove_words " | grep -i " $reltemp ")" ]] && { rname="$rname $reltemp" } || { break } } done < <(echo "$relname") rm ./${fbase}-info.sbt echo "#!/bin/bash" >$origdir/whatever.dat echo "video=\"$video\"" >>$origdir/whatever.dat echo "audio=\"$audio\"" >>$origdir/whatever.dat echo "v_fps=\"$v_fps\"" >>$origdir/whatever.dat echo "v_codec=\"$v_codec\"" >>$origdir/whatever.dat echo "v_frames=\"$v_frames\"" >>$origdir/whatever.dat echo "v_width=\"$v_width\"" >>$origdir/whatever.dat echo "v_height=\"$v_height\"" >>$origdir/whatever.dat echo "a_hz=\"$a_hz\"" >>$origdir/whatever.dat echo "a_format=\"$a_format\"" >>$origdir/whatever.dat echo "a_bits=\"$a_bits\"" >>$origdir/whatever.dat echo "a_channels=\"$a_channels\"" >>$origdir/whatever.dat echo "a_bitrate=\"$a_bitrate\"" >>$origdir/whatever.dat echo "a_chunks=\"$a_chunks\"" >>$origdir/whatever.dat echo "a_bytes=\"$a_bytes\"" >>$origdir/whatever.dat echo "a_vbrcbr=\"$a_vbrcbr\"" >>$origdir/whatever.dat echo "r_files=\"$r_files\"" >>$origdir/whatever.dat echo "r_bsize=\"$r_bsize\"" >>$origdir/whatever.dat echo "relname=\"$relname\"" >>$origdir/whatever.dat echo "v_bitrate=\"$v_bitrate\"" >>$origdir/whatever.dat echo "f_size=\"$f_size\"" >>$origdir/whatever.dat echo "v_length=\"$v_length\"" >>$origdir/whatever.dat echo "rname=\"$rname\"" >>$origdir/whatever.dat echo "starttime=\"$starttime\"" >>$origdir/whatever.dat