podlove / podlove-subscribe-button

Universal button to subscribe to buttons in the desired podcast client or player website
MIT License
62 stars 23 forks source link

[Request] Add Google Podcasts to PSB #154

Open Inrumpo opened 6 years ago

Inrumpo commented 6 years ago

Hello

I‘d like to see the Podlove Subscribe Button offer subscriptions in the new Google Podcasts webapp. Either via the user adding the link in the backend (similar to how the iTunes ID is implemented now) or by generating the link automatically.

https://gametalk.fm/feed/m4a/ becomes https://www.google.com/podcasts?feed=aHR0cHM6Ly9nYW1ldGFsay5mbS9mZWVkL200YS8%3D.

So it‘s https://www.google.com/podcasts?feed= plus Base64 encoded podcast RSS feed URL. I don‘t know where the %3D comes from.

jamescridland commented 6 years ago

It is base64 encoded. The %3D is the padding character, '=', encoded for a URL. To recreate the link, you need

$google_podcasts_link='https://www.google.com/podcasts?feed='.urlencode(base64_encode($_REQUEST['rss']));

The wider issue for PSB to incorporate this is that there is no method of checking whether the RSS feed has been catalogued inside Google Podcasts, since there's no API to check.

cfoellmann commented 6 years ago

@jamescridland shouldn't the podcaster be able to check if his/her own podcast is already in the catalogue?

jamescridland commented 6 years ago

Yes. The proper way is to visit the Google Podcasts Direct Link Generator and enter your RSS feed.

However, things have changed slightly. A programmatic way that now works okay is to attempt to scrape a typical Google Podcasts URL. This now returns a page with a graphic of the podcast if the URL is valid; and a link to a placeholder blank graphic if not. Test for the presence of the placeholder graphic.

cfoellmann commented 6 years ago

I think you misunderstood me. I presume that a podcaster has the time (few seconds) to verify the setting before publishing the settings.

jamescridland commented 6 years ago

My recent tests (with a database from February) appears to show that 97% of a sample of iTunes podcasts I tested were already in Google Podcasts. This should be a default, automatic piece of work by any podcast host.

You're correct that a podcaster could check; but given there's now an automated way to check, the most user-friendly thing to do would be to add it automatically in my view.

(I'm not a Podlove user).