RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.36k stars 1.04k forks source link

[AppleMusicBridge] Further data request to receive artist information. #4271

Closed jonastaedcke closed 1 month ago

jonastaedcke commented 2 months ago

Add image and name of artist, add some more cover sizes to content, add author to item

The getIcon function works and also outputs the correct URL for <logo> and <icon>. However, this stored image is ignored by my RSS reader (FreshRSS and Reeder). FreshRSS unfortunately removes the srcset attribute from img. Nevertheless, the different image sizes may help someone.

Example of David Gilmour/638538:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
  <title type="text">David Gilmour</title>
  <link rel="alternate" type="text/html" href="https://www.apple.com"/>
  <link rel="self" type="application/atom+xml" href="http://111.111.111.111:4711/?action=display&amp;bridge=AppleMusic2Bridge&amp;artist=638538&amp;limit=25&amp;format=Atom"/>
  <icon>https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/67/bc/5b/67bc5bdc-91de-9a98-2132-5d1207eacfc3/3d5b9dbc-67d1-43a1-b602-9dc22a350b14_ami-identity-7819921bb6c05b52ca15bc3aa9f23fc1-2024-04-25T14-12-35.091Z_cropped.png/144x144-999.png</icon>
  <logo>https://is1-ssl.mzstatic.com/image/thumb/AMCArtistImages211/v4/67/bc/5b/67bc5bdc-91de-9a98-2132-5d1207eacfc3/3d5b9dbc-67d1-43a1-b602-9dc22a350b14_ami-identity-7819921bb6c05b52ca15bc3aa9f23fc1-2024-04-25T14-12-35.091Z_cropped.png/144x144-999.png</logo>
  <id>http://111.111.111.111:4711/?action=display&amp;bridge=AppleMusic2Bridge&amp;artist=638538&amp;limit=25&amp;format=Atom</id>
  <updated>2024-09-23T15:12:43+00:00</updated>
  <author>
    <name>RSS-Bridge</name>
  </author>
  <entry>
    <title type="html">Luck and Strange (Edit) - Single</title>
    <published>2024-09-05T07:00:00+00:00</published>
    <updated>2024-09-05T07:00:00+00:00</updated>
    <id>https://music.apple.com/us/album/luck-and-strange-edit-single/1765651262?uo=4</id>
    <link rel="alternate" type="text/html" href="https://music.apple.com/us/album/luck-and-strange-edit-single/1765651262?uo=4"/>
    <author>
      <name>David Gilmour</name>
    </author>
    <content type="html">&lt;figure&gt;&lt;img srcset="https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/3a/3d/42/3a3d4250-0b2e-79e6-f3ad-9bf6e5935961/196872392432.jpg/60x60bb.jpg 60w, https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/3a/3d/42/3a3d4250-0b2e-79e6-f3ad-9bf6e5935961/196872392432.jpg/100x100bb.jpg 100w,  500w, https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/3a/3d/42/3a3d4250-0b2e-79e6-f3ad-9bf6e5935961/196872392432.jpg/2000x2000bb.jpg 2000w" sizes="100%" src="https://is1-ssl.mzstatic.com/image/thumb/Music221/v4/3a/3d/42/3a3d4250-0b2e-79e6-f3ad-9bf6e5935961/196872392432.jpg/2000x2000bb.jpg" alt="Cover of Luck and Strange (Edit) - Single" style="display: block; margin: 0 auto;" /&gt;&lt;figcaption&gt;from &lt;a href="https://music.apple.com/us/artist/david-gilmour/638538?uo=4"&gt;David Gilmour&lt;/a&gt;&lt;br /&gt;℗ 2024 Sony Music Entertainment, under exclusive license from David Gilmour Music Ltd.&lt;/figcaption&gt;&lt;/figure&gt;</content>
  </entry>
</feed>

This is my first PR. I hope everything is correct :)

dvikan commented 2 months ago

looks ok. keep the collectdata method first.

dvikan commented 2 months ago

@Bockiii

Bockiii commented 2 months ago

I think you are running the getBasics command unncessearily often.

Since you are already giving $json to getArtist, you can also give it to getName and save a url request.

Otherwise the code looks great! Thanks for the addition/fix!

Bockiii commented 2 months ago

code looks code, cant verify by testing it right now and sadly the tester is broken right now :)

jonastaedcke commented 2 months ago

@Bockiii Here is the output for the artist Lady Gaga 277293880 277293880.xml.zip

github-actions[bot] commented 1 month ago

Pull request artifacts

Bridge Context Status
AppleMusic 1 untitled (current) ✔️
AppleMusic 1 untitled (pr) ✔️

last change: Friday 2024-10-18 04:14:28

Bockiii commented 1 month ago

please fix the lint test errors

jonastaedcke commented 1 month ago

After a typo fix one test failed

Bockiii commented 1 month ago

the error is not on you, not sure what the testers problem is there, specially since it worked before.

change lgtm, thanks!

jonastaedcke commented 1 month ago

Thank you for your review and quick responses!