Instantly share code, notes, and snippets.

Embed
What would you like to do?

Pocketcasts/BeardedSpice fix 💚

So I like to listen to podcasts while at work. Nope, I don't find it distracting if it's specific podcasts. I like the background noise.

BeardedSpice is awesome for wiring up your Mac play/pause controls to things other than iTunes. Like the Pocketcasts web app. Unfortunately it broke recently, but here's the steps to fix.

Extra bonus: it now works in the Pocketcasts Beta 🎉

  1. Allow BeardedSpice to run JS in Chrome
  2. Restart BeardedSpice
  3. Grab the pocketcasts-plus.bsstrategy file in this gist
  4. Open BeardedSpice preferences and import it
  5. Enjoy your podcasts 🎧

Note: The file in the gist is adapted from this PR - thanks! I hope they merge it at some point.

BSStrategy = {
version:2,
displayName:"PocketCasts+",
accepts: {
method: "predicateOnTab",
format:"%K LIKE[c] '*play*.pocketcasts.com*'",
args: ["URL"]
},
toggle: function () {document.querySelector('.play_pause_button').click()},
next: function () {document.querySelector('.skip_forward_button').click()},
previous: function () {document.querySelector('.skip_back_button').click()},
pause: function () {
document.querySelector(
'.play_pause_button'
).classList.contains('pause_button')
? document.querySelector('.play_pause_button').click()
: []
},
isPlaying: function () {
return document.querySelector('.play_pause_button').classList.contains('pause_button')
},
trackInfo: function () {
return {
'track': document.querySelector(
'div.player_top div.player_episode'
) ? document.querySelector(
'div.player_top div.player_episode'
).innerText : document.querySelector('.controls .episode-title').innerText,
'album': document.querySelector(
'div.player_podcast_title div.player_episode'
) ? document.querySelector(
'div.player_podcast_title div.player_episode'
).innerText : document.querySelector('.controls .podcast-title').innerText,
'image': document.querySelector(
'div.player_top div.player_artwork img'
) ? document.querySelector(
'div.player_top div.player_artwork img'
).src : document.querySelector('.controls .podcast-image img').src,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment