- 1. Description
- 2. Requirements
- 3. How to use it?
- 4. Download
- 5. Source Code
- 6. Licenses
1. Description
This program automatically closes the Saver2 application for 10 minutes every 4 hours to avoid your account to be blocked by the Pandora's website for several days. This temporary blacklisting could happen after too many hours of continuous listening. It happend to me and was very frustrating, that's why I've started this project.Said shortly, Saver2 AutoRestart is a kind of Pandora anti-blacklist add-on for the Saver2 audio streaming client.
Saver2 AutoRestart is composed of 2 executable files that both keep running in the background, consuming a very little amount of your RAM memory:
- Saver2ARL.exe is the launcher that checks if all the required conditions are fulfilled, starts Saver2AR.exe then keeps running in background to provide a systray icon with left-click menu
- Saver2AR.exe stops Saver2 for 10 minutes every 4 hours then restarts the player, it also informs user through systray tooltips when events occur (see more details in my note to the devs at the end of chapter 6)
2. Requirements
The Saver2 AutoRestart application has to be installed in the same folder as Saver2 to work.Thus it also implies that the Saver2 software has already been installed. Else if it isn't yet, download the Saver2 Bundle, install it, test it then send a Paypal donation to support the author.
Note to the non-US residents
3. How to use it?
STEP 1 › Saver2 configuration
After installing the Saver2 Bundle, double-click the newly created desktop icon named 'Pandora (Saver2)'.
Click the Menu button at the bottom of the player, go to Configuration then check the following options in the Pandora > Common menu:- Login automatically
- Launch automatically when SProxy is started
- Close SProxy when the client is closed
- Don't remember my login password (Required)
- Show tray balloon when a song is played (Recommended)
Now click OK then close the player.
STEP 2 › Saver2 AutoRestart
Point the 'Saver2AutoRestart_setup.exe' target to the Saver2 installation directory then double-click the new 'Saver2 AutoRestart' desktop icon that will automatically launch Saver2.
From now on you'll have to start the player with the 'Saver2 AutoRestart' desktop icon rather than 'Pandora (Saver2)'. And you should now also close Saver2 through the Saver2 AutoRestart system tray's icon.4. Download
5. Source Code
This little personal project has been developed and compiled with AutoIt and SciTE4AutoIt. You can use one of the following solutions to easily edit the source *.AU3 files:- SciTE4AutoIt a.k.a AutoIt Script Editor. Note that SciTE is the official Scintilla editor
- Notepad++
- Notepad2
- more text editors that I don't know yet with a syntax highlighting feature may also be able to recognize the AutoIt language and scripts...
You could also simply review the source code below. I've tried my best to reproduce the SciTE syntax highlighting as close to the original as possible.
Note to the developers
Saver2 AutoRestart Launcher - Saver2ARL.exe
#NoTrayIcon
; In the Saver2 Pandora Client, please enable the following options in Menu > Configuration > Pandora > Common:
; - 'Login automatically'
; - 'Launch automatically when SProxy is started'
; - 'Close SProxy when the client is closed'
;
; But keep disabled:
; - 'Don't remember my login password' (Required)
; - 'Show tray balloon when a song is played' for it to don't interfere with current script's tray tips (Recommended)
; Both Saver2AR.exe and Saver2ARL.exe executables have to be placed in the 'Saver2' installation directory or it will not work.
Sleep(2000) ;Wait
for 2 seconds to make sure that a previous instance of Saver2
AutoRestart Launcher currently closing doesn't overlap with this
starting process.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;The following part of
the code checks if all the required conditions are fulfilled then
starts the Saver2 AutoRestart executable
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If FileExists(@ScriptDir & "\Saver2AR.exe") Then ;If Saver2AR.exe can be found in the same folder as Saver2ARL.exe as it should be
If ProcessExists("Saver2AR.exe") Then ;If Saver2AR.exe is already running...
ProcessClose("Saver2AR.exe") ;then close it.
ProcessWaitClose("Saver2AR.exe",2) ;Wait for Saver2AR.exe to be killed, timeout after 2 seconds...
Run(@ScriptDir & "\Saver2AR.exe",@ScriptDir) ;then restart Saver2AR.exe
Else
Run(@ScriptDir & "\Saver2AR.exe",@ScriptDir) ;Or just start Saver2AR if it's not already running
EndIf
Else ;If Saver2AR.exe can't be found in the same folder as Saver2ARL.exe, show an error message...
MsgBox(266256,"ERROR","Saver2AR.exe not found!" & @CRLF & "Please verify that Saver2ARL.exe and Saver2AR.exe are both located in the 'Saver2' application directory as expected.")
If ProcessExists("Saver2AR.exe") Then ;then close the other Saver2 related executables...
ProcessClose("Saver2AR.exe")
EndIf
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe")
EndIf
Exit ;...including current script.
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;The following part of the code creates and manages the tray icon and its menu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Opt("TrayMenuMode",1) ;Default tray menu items (Script Paused/Exit) will not be shown.
Opt("TrayAutoPause",0) ;Script will not be paused when clicking the tray icon.
;Define the tray icon menu
Local $restartnow = TrayCreateItem("Restart now")
TrayCreateItem("")
Local $restart5min = TrayCreateItem("Close now, restart in 5mn")
TrayCreateItem("")
Local $restart10min = TrayCreateItem("Close now, restart in 10mn")
TrayCreateItem("")
Local $exititem = TrayCreateItem("Close now")
;Display the tray icon and its mouse-over tooltip
TraySetState()
TraySetToolTip("Saver2 Auto-Restart")
;Now create the tray icon loop
While 1
Local $msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $restartnow
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe")
EndIf
If ProcessExists("Saver2AR.exe") Then
ProcessClose("Saver2AR.exe")
EndIf
Run(@ScriptFullPath,@ScriptDir)
ExitLoop
Case $msg = $restart5min ;Pause for 5 minutes then restart
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe")
EndIf
If ProcessExists("Saver2AR.exe") Then
ProcessClose("Saver2AR.exe")
EndIf
TrayTip("Saver2 AutoRestart", "Saver2 will keep out of Pandora servers during 5 minutes then will restart automatically, please wait...", 30, 1)
Sleep(300000) ;Wait for 5 minutes to stay out of Pandora servers for a while
Run(@ScriptFullPath,@ScriptDir)
ExitLoop
Case $msg = $restart10min ;Pause for 10 minutes then restart
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe")
EndIf
If ProcessExists("Saver2AR.exe") Then
ProcessClose("Saver2AR.exe")
EndIf
TrayTip("Saver2 AutoRestart", "Saver2 will keep out of Pandora servers during 10 minutes then will restart automatically, please wait...", 30, 1)
Sleep(600000) ;Wait for 10 minutes to stay out of Pandora servers for a while
Run(@ScriptFullPath,@ScriptDir)
ExitLoop
Case $msg = $exititem
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe")
EndIf
If ProcessExists("Saver2AR.exe") Then
ProcessClose("Saver2AR.exe")
EndIf
ExitLoop
EndSelect
WEnd
Exit
; This noob script has been written by FenyX ;
; http://s2ar.sourceforge.net/ ;
; but credits & thanks should go to ZigZagJoe, ;
; the developer of Saver2 ;
; http://ridetheclown.com/wp/saver2/ ;
;
;
;Please donate at this URL to show your support;
; http://ridetheclown.com/donate.html ;
; SAVER2 AUTORESTART
; Copyright (C) 2013 FenyX
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>
Saver2 AutoRestart - Saver2AR.exe
#NoTrayIcon
; In the Saver2 Pandora Client, please enable the following options in Menu > Configuration > Pandora > Common:
; - 'Login automatically'
; - 'Launch automatically when SProxy is started'
; - 'Close SProxy when the client is closed'
;
; But keep disabled:
; - 'Don't remember my login password' (Required)
; - 'Show tray balloon when a song is played' for it to don't interfere with current script's tray tips (Recommended)
; Both Saver2AR.exe and Saver2ARL.exe executables have to be placed in the 'Saver2' installation directory or it will not work.
While 1
If FileExists(@ScriptDir & "\SProxy.exe") Then ;Detect if SProxy.exe is located in the same directory as the current script as it should be.
If ProcessExists("SProxy.exe") Then ;Detect if SProxy.exe is already started...
ProcessClose("SProxy.exe") ;and kill the process if so.
ProcessWaitClose("SProxy.exe",2) ;Wait
for SProxy.exe to be killed (timeout after 2 seconds in case it would
be closed so fast that it wouldn't be detected by ProcessWaitClose)
Sleep(600000) ;Wait for 10 minutes to stay out of Pandora servers for a while
EndIf
Run(@ScriptDir & "\SProxy.exe -quiet -launch-client", @ScriptDir) ;Start
Sleep(14400000) ;Wait
for 4 hours so the script waits in background while you play Pandora
radios. It uses more or less 2MB of your precious RAM memory ;)
Else ;If SProxy.exe isn't located in the same directory as the current script, show an error message before exit
MsgBox(266256,"ERROR","SProxy.exe not found!" & @CRLF & "Please verify that Saver2ARL.exe and Saver2AR.exe are both located in the 'Saver2' application directory as expected.")
If ProcessExists("SProxy.exe") Then ;Kill SProxy.exe
ProcessClose("SProxy.exe")
EndIf
If ProcessExists("Saver2ARL.exe") Then ;Kill Saver2ARL.exe
ProcessClose("Saver2ARL.exe")
EndIf
Exit ;Kill
the current Saver2AR.exe executable (I don't remember why I've replaced
the ExitLoop with Exit during my tests but there's surely a reason =)
EndIf
If Not ProcessExists("Saver2ARL.exe") Then ;Detect if Saver2ARL.exe has been stopped
If ProcessExists("SProxy.exe") Then
ProcessClose("SProxy.exe") ;If Saver2ARL.exe has been closed then SProxy.exe has no reason to continue playing
EndIf
ExitLoop ;If Saver2ARL.exe isn't running in the background this script has no reason to continue the loop
EndIf
If Not ProcessExists("SProxy.exe") Then ;Detect if SProxy.exe has been stopped
If ProcessExists("Saver2ARL.exe") Then
ProcessClose("Saver2ARL.exe") ;If SProxy.exe has been closed then Saver2ARL.exe has no reason to continue running the tray icon
EndIf
ExitLoop ;If SProxy.exe isn't playing this script has no reason to continue the loop
EndIf
WEnd
Exit
; This noob script has been written by FenyX ;
; http://s2ar.sourceforge.net/ ;
; but credits & thanks should go to ZigZagJoe, ;
; the developer of Saver2 ;
; http://ridetheclown.com/wp/saver2/ ;
;
;
;Please donate at this URL to show your support;
; http://ridetheclown.com/donate.html ;
; SAVER2 AUTORESTART
; Copyright (C) 2013 FenyX
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>
6. Licenses
Saver2
According to its author Saver2 is nice and simple: you play music, and it gets recorded locally. It supports Pandora and comes with a very nice custom Pandora client he wrote, but also supports Grooveshark, Slacker, and a few other services.As explained by ZigZagJoe on his website, "Saver2 is for educational use only. Do not use the software in a way that would contravene any music copyright laws. Any information provided by this software is for educational purposes only. No function is implied or in any way guaranteed".
Saver2 AutoRestart
Saver2 AutoRestart is an add-on by FenyX for the Saver2 application made by ZigZagJoe. This software is distributed under the GNU General Public Licence version 3.Saver2 AutoRestart isn't affiliated in any way nor with the Saver2 application, nor with ZigZagJoe, nor with the RideTheClown.com website. The members of the official Saver2 project do not officially endorse or recommend the installation of any add-on, and cannot be held responsible for any problems or damages that arise from installing 3rd-party applications.
Saver2 AutoRestart has only been tested with the 11/23/2012 version of Saver2.
NSIS Icon
NSIS icon by MoNKi is used in the installer skin.As a part of the NSIS project, the corresponding zlib/libpng licence is also applied to this icon.
Unofficial Saver2 Icon
The hi-res Saver2 icon that I've used during months as dock icon is available at DeviantArt.com and is composed by the 3 nice artworks below:Using it has been kindly allowed by the author in the icon's DeviantArt page comments
The Creative Commons and LGPL licenses of the Oxygen icons theme can be read on their licence page.