-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dump Karaoke Version.py
88 lines (75 loc) · 2.54 KB
/
Dump Karaoke Version.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
CustomKaraokeURL = "https://www.karaoke-version.com/custombackingtrack/fantasy/wenn-du-mir-in-die-augen-schaust.html"
username = "username
password = "password"
################################################
# AST.PL
# Automatic Single Track Playback Loader
# (c) 2022 Christian Gehring
# mailto:[email protected]
# https://sites.google.com/it-secrets.de/browser-fernsteuerung
################################################
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
############################
#Init
############################
############################
#Download Track
############################
def dl_track(tracknumber):
driver.get(CustomKaraokeURL)
time.sleep(1)
# Solo Click track to unmask all channels
solo = driver.find_element_by_xpath('//*[@id="html-mixer"]/div[1]/div[2]/div[1]/button[2]')
solo.click()
time.sleep(1)
# Solo Click track for download
solo = driver.find_element_by_xpath('//*[@id="html-mixer"]/div[1]/div[2]/div['+tracknumber+']/button[2]')
solo.click()
time.sleep(1)
# Start download
download = driver.find_element_by_xpath('/html/body/div[2]/div/div[2]/div[1]/div[6]/div[2]/div[2]/a/span[2]')
time.sleep(1)
download.click()
time.sleep(30)
############################
#Main
############################
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get("https://www.karaoke-version.com/my/login.html")
time.sleep(3)
############################
#Login
############################
id_box = driver.find_element_by_name('frm_login')
id_box.send_keys(username)
id_box = driver.find_element_by_name('frm_password')
id_box.send_keys(password)
login_button = driver.find_element_by_name('sbm')
login_button.click()
time.sleep(1)
################################################
#Jump to Song URL & Reset alle Tracks to Default
################################################
driver.get(CustomKaraokeURL)
time.sleep(1)
reset = driver.find_element_by_xpath('//*[@id="html-mixer"]/div[1]/div[1]/div[2]/button[2]')
reset.click()
time.sleep(1)
############################
#Get Tracks
############################
tracks = driver.find_elements_by_class_name('track__caption')
CountTracks = len(tracks)
tracknames = []
for track in tracks:
print(track.text)
tracknames.append(track.text)
CountTracks = len(tracks)
for i in range(2,CountTracks+1):
dl_track(str(i))
print(str(i))
driver.quit()
exit()