<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[montaro - Tech Blog]]></title><description><![CDATA[Personal technical blog about software engineering and that!]]></description><link>https://refaey.me</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 15:24:57 GMT</lastBuildDate><atom:link href="https://refaey.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[SpotifySpy]]></title><description><![CDATA[I love Spotify and share some playlists with family and friends where everyone can add new tracks to the playlists (same genre indeed ;D) and listen to the others’ picks.
So far this is lovely, except that no one ever gets notified when a new track i...]]></description><link>https://refaey.me/spotifyspy</link><guid isPermaLink="true">https://refaey.me/spotifyspy</guid><category><![CDATA[automation]]></category><category><![CDATA[Spotify]]></category><category><![CDATA[python projects]]></category><category><![CDATA[telegram]]></category><dc:creator><![CDATA[Ahmed Refaey]]></dc:creator><pubDate>Mon, 17 Mar 2025 23:23:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/0rmby-3OTeI/upload/7dd83eb688002ed3d6940e3652f1b988.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I love Spotify and share some playlists with family and friends where everyone can add new tracks to the playlists (same genre indeed ;D) and listen to the others’ picks.</p>
<p>So far this is lovely, except that no one ever gets notified when a new track is added to a shared playlist! I used to send my brother a link to the track again on Telegram -my favourite IM ;)- or text him to check my newly amazing-as-usual added tracks which was annoying!</p>
<h3 id="heading-i-love-automationwho-doesnt">I love Automation…who doesn’t?!</h3>
<p>There was no Spotify built-in setting (AFAIK) that could solve this issue either in the iOS or the MacOS version and I decided to automate that!</p>
<h3 id="heading-anatomy">Anatomy</h3>
<ul>
<li><p>Telegram Bot</p>
</li>
<li><p>Spotify API</p>
</li>
<li><p>Python Service (Dockerized)</p>
</li>
<li><p>Raspberry Pi</p>
</li>
<li><p>AWS S3 Bucket (Optional)</p>
</li>
</ul>
<h3 id="heading-how-it-works">How it works</h3>
<p>The SpotifySpy service running on my Raspberry Pi monitors a configured Spotify playlist via Spotify’s API on my behalf and sends a rich text message to the configured Telegram channel using the Telegram Bot which is added as a member to the Telegram group chat.  </p>
<p>The idea is very basic, when it starts, it downloads the Spotify playlist JSON metadata and as it runs forever, it will periodically (for example, every 60 seconds) download the playlist metadata and compare it to the saved one, send a chat Telegram message per newly added track and replace the old version of the playlist JSON file.</p>
<p><strong><em>Bonus</em></strong><br />The storage backend (where the Spotify playlist JSON metadata file is stored) is configurable and it supports Local filesystem storage and AWS S3.<br />All the moving parts are configurable through Environment Variables and/or a <code>.env</code> file.</p>
<h3 id="heading-cool-result">Cool Result!</h3>
<p>A new notification is sent to the music lovers sharing this Spotify playlist in a cool formatted Telegram message with info about the track and links!</p>
<p>In this screenshot, one of my Telegram group chats with 2 friends and the Bot is the 4th member sending messages from SpotifySpy.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742252672569/38ce450a-678f-4ccb-a0b9-1543de33ebc7.png" alt="Screenshot of a Telegram channel with friends and SpotifySpy new playlist tracks updates messages" class="image--center mx-auto" /></p>
<p>I shared the code with &lt;3 on GitHub (<a target="_blank" href="https://github.com/montaro/SpotifySpy">link</a>)</p>
<p>Happy music sharing!!</p>
]]></content:encoded></item></channel></rss>