Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the auto key in new branch, using pyautogui as a quick fix, wil… #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/SpotifyAdSkip.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions KeyboardSyncHotKeys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import keyboard
import os


Looping = True


while True:
if Looping:
if keyboard.is_pressed('m+n'):
os.system("open -a spotify")
elif keyboard.is_pressed('b+n'):
keyboard.press('command+m')

102 changes: 0 additions & 102 deletions SpotBot/SpotifyAdDetector.py

This file was deleted.

66 changes: 66 additions & 0 deletions SpotBot/SpotifyAdSkipper4.0.1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import json
import subprocess
import time
# import applescript
from json import JSONDecodeError
from subprocess import call
import keyboard
import os
from time import sleep
from threading import Thread
import osascript
import SpotifyAdDetector

class AdChecker():
def playpause(self):
pause = 1
minimize = 1
while True:
if keyboard.is_pressed('b+n'):
if pause == 1:
#print('pause')
subprocess.call(['osascript', '-e', 'tell application "Spotify" to pause'])
sleep(0.2)
pause = 0
elif pause == 0:
#print('play')
subprocess.call(['osascript', '-e', 'tell application "Spotify" to play'])
sleep(0.2)
pause = 1
if keyboard.is_pressed('v+b'):
if minimize == 1:
os.system("open -a Spotify")
sleep(0.2)
minimize = 0
elif minimize == 0:
keyboard.press('command+m')
sleep(0.2)
minimize = 1
def check(self):
# os.system("open -a Spotify")
Thread(target=self.playpause).start()
while True: #loop, check for error, which means either auth token broken or ad detected
SpotifyAdDetector.main()
try:
if SpotifyAdDetector.AD_PLAYING == True:
os.system("pkill Spotify")
print('killed spotify')
sleep(0.3)
os.system("open -a Spotify")
print('opened spotify')
sleep(0.5)
keyboard.press('command+m')
print('minimized spotify')
sleep(0.3)
subprocess.call(['osascript', '-e', 'tell application "Spotify" to play'])
print('spotify to play')
sleep(2)


except Exception: #this is unnecessary
print('Catch Error Please')


if __name__ == "__main__":
a = AdChecker()
a.check()
5 changes: 0 additions & 5 deletions SpotBot/SpotifyAdSkipper4.0.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import json
import subprocess
import time
# import applescript
from json import JSONDecodeError
from subprocess import call
import keyboard
import os
from time import sleep
from threading import Thread
import osascript
import SpotifyAdDetector

class AdChecker():
Loading