The reason I created the original script was to quickly download the latest episode. If you wish to add more complexity to it, be my guest. However, a shell script might not be the best way of doing all this logic. You might be better off with an actual programming language, or more robust scripting language (ruby, perl, python, php)