Files
scripts/media/spotify-rss.py
Guillem Hernandez Sola 53dddb1f13 Added spotify
2026-04-07 19:49:56 +02:00

47 lines
1.7 KiB
Python

import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import requests
import urllib.parse
# --- Configuration ---
# Replace these with your actual Spotify Developer credentials
SPOTIPY_CLIENT_ID = '3756ae92386d45e9971aa03d2f4b1eca'
SPOTIPY_CLIENT_SECRET = '6c8ea8c409d944cc895571f3f49985df'
# The ID from your link: https://open.spotify.com/show/13Gs651PIKKI7zRF0p3PcJ
SHOW_ID = '13Gs651PIKKI7zRF0p3PcJ'
# The show name you found on Spotify
show_name = 'Diario Sport' # Replace this with the actual show name
def find_rss_feed(show_name):
# Encode the show name for the URL
encoded_name = urllib.parse.quote(show_name)
itunes_api_url = f"https://itunes.apple.com/search?term={encoded_name}&entity=podcast&limit=10"
try:
response = requests.get(itunes_api_url)
data = response.json()
if data['resultCount'] > 0:
found_feed = None
for result in data['results']:
# Check if the show name matches
if show_name.lower() in result['collectionName'].lower():
found_feed = result.get('feedUrl')
print("\n✅ SUCCESS! Found a matching public RSS feed:")
print("-" * 50)
print(found_feed)
break
if not found_feed:
print("\n❌ No exact match found in public directories.")
print("You may want to check the show name manually.")
else:
print("\n❌ Could not find this show in public directories.")
except Exception as e:
print(f"Error searching iTunes: {e}")
if __name__ == '__main__':
find_rss_feed(show_name)