mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added Spotify module to scrobbler
This commit is contained in:
parent
604f897571
commit
69c25411b9
@ -19,10 +19,15 @@ pages = {
|
||||
},
|
||||
"YouTube Music":{
|
||||
"patterns":[
|
||||
"https://music.youtube.com",
|
||||
"http://music.youtube.com"
|
||||
"https://music.youtube.com"
|
||||
],
|
||||
"script":"ytmusic.js"
|
||||
},
|
||||
"Spotify Web":{
|
||||
"patterns":[
|
||||
"https://open.spotify.com"
|
||||
],
|
||||
"script":"spotify.js"
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Maloja Scrobbler",
|
||||
"version": "1.2",
|
||||
"version": "1.3",
|
||||
"description": "Scrobbles tracks from various sites to your Maloja server",
|
||||
"manifest_version": 2,
|
||||
"permissions": ["activeTab",
|
||||
|
11
scrobblers/chromium-generic/sites/spotify.js
Normal file
11
scrobblers/chromium-generic/sites/spotify.js
Normal file
@ -0,0 +1,11 @@
|
||||
maloja_scrobbler_selector_playbar = "//div[@class='now-playing-bar']"
|
||||
|
||||
|
||||
maloja_scrobbler_selector_metadata = ".//div[@class='now-playing-bar__left']"
|
||||
|
||||
maloja_scrobbler_selector_title = ".//div[contains(@class,'track-info__name')]//a/text()"
|
||||
maloja_scrobbler_selector_artist = ".//div[contains(@class,'track-info__artists')]//a/text()"
|
||||
maloja_scrobbler_selector_duration = ".//div[@class='playback-bar__progress-time'][2]/text()"
|
||||
|
||||
|
||||
maloja_scrobbler_selector_control = ".//div[contains(@class,'player-controls__buttons')]/button[3]/@title"
|
@ -71,7 +71,7 @@ else {
|
||||
//stopPlayback()
|
||||
}
|
||||
else if (control == "Pause") {
|
||||
console.log("Playing " + artist + " - " + title);
|
||||
console.log("Playing " + artist + " - " + title + " (" + durationSeconds + " sec)");
|
||||
chrome.runtime.sendMessage({type:"startPlayback",time:Math.floor(Date.now()),artist:artist,title:title,duration:durationSeconds});
|
||||
//startPlayback(artist,title,durationSeconds)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user