wilooper commited on
Commit
f32ea6a
·
1 Parent(s): 78e796e

Fix Apple Music RSS URL to use applemarketingtools.com

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -760,7 +760,7 @@ async def _fetch_itunes_trending(country: str, limit: int = 50) -> list:
760
  log.debug("Apple Music circuit breaker open — skipping fetch")
761
  return []
762
  c = country.lower() if country and country not in ("ZZ", "zz") else _ITUNES_COUNTRY_FALLBACK
763
- url = f"https://rss.appleitunes.apple.com/api/v1/{c}/music/most-played/{limit}/songs/json"
764
  t0 = time.monotonic()
765
  try:
766
  async with _get_semaphore():
@@ -799,7 +799,7 @@ async def _fetch_itunes_trending(country: str, limit: int = 50) -> list:
799
  async def _fetch_itunes_top_albums(country: str, limit: int = 20) -> list:
800
  """Apple Music RSS top albums."""
801
  c = country.lower() if country and country not in ("ZZ", "zz") else "us"
802
- url = f"https://rss.appleitunes.apple.com/api/v1/{c}/music/most-played/{limit}/albums/json"
803
  try:
804
  async with _get_semaphore():
805
  resp = await _get_apple_client().get(url)
 
760
  log.debug("Apple Music circuit breaker open — skipping fetch")
761
  return []
762
  c = country.lower() if country and country not in ("ZZ", "zz") else _ITUNES_COUNTRY_FALLBACK
763
+ url = f"https://rss.applemarketingtools.com/api/v2/{c}/music/most-played/{limit}/songs.json"
764
  t0 = time.monotonic()
765
  try:
766
  async with _get_semaphore():
 
799
  async def _fetch_itunes_top_albums(country: str, limit: int = 20) -> list:
800
  """Apple Music RSS top albums."""
801
  c = country.lower() if country and country not in ("ZZ", "zz") else "us"
802
+ url = f"https://rss.applemarketingtools.com/api/v2/{c}/music/most-played/{limit}/albums.json"
803
  try:
804
  async with _get_semaphore():
805
  resp = await _get_apple_client().get(url)