 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Lillpont Guest
|
Posted: Sun Jun 14, 2009 8:55 pm Post subject: Spotify without ads |
|
|
I think Spotify is a great way to get lots of music and the people at Spotify obviously need their money, however, there are times when you just don't wanna hear their ads.
What this script does is simple, it mutes the volume when there is an an on, and unmutes it when the ad is finished.
NOTE: For this to function on Vista Autohotkey.exe needs to be run in XP-compability mode. It also only works when Spotify is the active window
Comments and suggestions are more than welcome.
| Code: | #Persistent
SetTimer, AdOrNot, 1000
return
AdOrNot:
{
IfWinActive, ahk_class SpotifyMainWindow
{
WinGetPos,,,Width ,Height , A
X := Width-221
X2 := Width-251
Y := Height-19
PixelGetColor, color, %X%, %Y% ;Checks a pixel where the progress bar is visible when music is playin
PixelGetColor, color2, %X2%, %Y% ;Same thing 30 pixels left, to avoid hitting the slider that shows the position in the song
If (color=0x3F3F3F OR color=0x2E2E2E OR color2=0x3F3F3F OR color2=0x2E2E2E) ;Checks if the pixels matches the progress bar
{
SoundGet, master_mute, , mute
If master_mute = On
SoundSet, +1, , mute
}
Else
{
SoundGet, master_mute, , mute
If master_mute = Off
{
SoundSet, +1, , mute
Sleep, 300
Send, {Media_Play_Pause} ;Spotify pauses ads on Mute, therefore we need to get it playing again
}
}
}
}
return |
Any ideas on how this could be done when Spotify is inactive/minimized? |
|
| Back to top |
|
 |
twinkletoes
Joined: 27 Jun 2009 Posts: 6
|
Posted: Sat Jun 27, 2009 1:42 am Post subject: |
|
|
| lovely script - works as advertised. Many thanks |
|
| Back to top |
|
 |
Robert G. Guest
|
|
| Back to top |
|
 |
kyf Guest
|
Posted: Fri Jul 10, 2009 4:39 pm Post subject: |
|
|
Hi Lillpont,
I like you script. I had written something similar, with two differences
1 - my code works when spotify is minimised
2 - my code cannot automatically detect when an advert has started, you need to press a hotkey (win+x)
If someone has time maybe they can combine these two scripts to solve the problem completely
| Code: |
#x::
Send {Volume_Mute}
sleep, 100
DetectHiddenWindows, On
ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow
sleep 100
WinGetTitle, text, ahk_class SpotifyMainWindow
StringTrimLeft, text2, text, 10
loop{
sleep, 200
WinGetTitle, newtext, ahk_class SpotifyMainWindow
StringTrimLeft, newtext2, newtext, 10
IfNotInString, newtext2, %text2%
break
}
DetectHiddenWindows, Off
Send {Volume_Mute}
return
|
|
|
| Back to top |
|
 |
Tyr708 Guest
|
Posted: Sun Jul 12, 2009 3:05 pm Post subject: |
|
|
Really hope someone gets the time to mix these two together. I like would really love to use a mixed version.
But thx for both the versions. I use the first one right now sonce I am kind of lazy  |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Jul 13, 2009 6:56 pm Post subject: |
|
|
| You're not allowed to post april fools scripts but a script to purposely screw a website out of money is ok? |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 15, 2009 2:05 pm Post subject: |
|
|
What are you talking about?
The company still gets paid. And it's not like I'm ever going to buy the shit that they usually have commercials for. |
|
| Back to top |
|
 |
Lillpont Guest
|
Posted: Thu Jul 16, 2009 3:25 pm Post subject: |
|
|
It's a fair objection though. The commercials are obviously there for a reason, and if everyone used a script like this all the time Spotify would loose that income. And too say 'I wouldn't ever buy anything...' doesn't really hold water, IMO. Whether you go buy something isn't all that matters with ads, just you hearing the product name or similar is a value to the advertiser. And of course, when you add the word 'usually', you imply it might just happen, and that in it self throws your argument.
And also, I know I shouldn't be arguing this way.
About mixing the two scripts together, I don't think that's possible since they are based on totally different principles. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 22, 2009 7:19 am Post subject: |
|
|
Sorry for my noobiness.... How and where the heck do I put this script??
Thanks! |
|
| Back to top |
|
 |
lilljimpa
Joined: 18 Apr 2007 Posts: 127
|
Posted: Sat Aug 22, 2009 11:44 am Post subject: |
|
|
i know a better way to avoid it!
why i havent done it yet is becouse i don't know how to fix it. maybe you can help me help you
i first figure out how you could add every title in your playlist to put it into a white-list. And if the title title playing isn't in the playlist it mute's.
This will work when spotify is minimized to tray and not having shuffle on in spotify... (i know how i can fix this)
but i figure this out when i was ling on my bed and were about to sleep. and i thougt to myself what if you constanly change playlist? then you will have a looong playlist in a txt/ini file that is white-listed... so next day i looked on the spotify menu when ads was runing and saw that the menu on [playlist] - [next] is grayed out. this you can search for whit help of dll cals (unfortenly i sucks on dll cals and english as well) using GetMenuState to see if it is grayed out or not.
so if it is grayed then ads is runing so then mute
so i searched the forum and found http://www.autohotkey.com/forum/viewtopic.php?t=21451... This might help with GetMenuState _________________ you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)... |
|
| Back to top |
|
 |
Rober Guest
|
|
| Back to top |
|
 |
Guest
|
Posted: Tue Aug 25, 2009 7:15 am Post subject: |
|
|
| if you change the track playing when there is something like a second remaining the ad doesn't play at all. |
|
| Back to top |
|
 |
Vitae111 Guest
|
Posted: Thu Aug 27, 2009 3:05 pm Post subject: |
|
|
Or you could actually pay them to get Spotify Premium.
Companies like these deserve to get paid. We get music without having to break any laws. |
|
| Back to top |
|
 |
daorc
Joined: 18 Oct 2006 Posts: 169
|
Posted: Mon Sep 28, 2009 4:20 pm Post subject: |
|
|
| I completely agree with Vitae111. While it is tempting to bypass the adverts, if everyone does it Spotify will lose their income. They've done a fantastic thing allowing a lot of people to legally listen to music for free that they would have otherwise illegally downloaded. Isn't it fair enough to pay them by listening to their ads (or even by paying them £10). Muting the spotify ads is morally equivalent to illegally downloading the music in the first place, so why bother getting Spotify if you're going to do that?! |
|
| Back to top |
|
 |
Mister T Guest
|
Posted: Tue Oct 13, 2009 5:24 pm Post subject: |
|
|
@daorc, @Vitae111 etc.
Spotify premium doesn't currently offer value for money. £10 per month is way too much for the service. It's not like having a download of the music because you have to be connected to listen, so taking it out and about isn't always practical (I don't have or want an iPhone). Also their catalog is subject to license agreements with artists, so often I can't actually find what I want to listen to. The sound quality is often not that great either. For the current service I would be prepared to pay £20 a year max. I always turn the sound off on my pc when the ads come on (without exception) so they're not going to get me to buy anything anyway. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|