Skip to content

Commit

Permalink
MediaEmbed: updated Apple Podcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Oct 11, 2024
1 parent c126dec commit ac657d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
'abcnews'=>['attributes'=>[],'example'=>'https://abcnews.go.com/WNN/video/dog-goes-wild-when-owner-leaves-22936610','extract'=>['!abcnews\\.go\\.com/(?:video/embed\\?id=|[^/]+/video/[^/]+-)(?\'id\'\\d+)!'],'homepage'=>'https://abcnews.go.com/','host'=>['abcnews.go.com'],'iframe'=>['src'=>'//abcnews.go.com/video/embed?id={@id}'],'name'=>'ABC News','scrape'=>[],'tags'=>['news']],
'acast'=>['attributes'=>[],'example'=>['https://play.acast.com/s/the-taskmaster-podcast/ep31.leemack-s11ep.8','https://shows.acast.com/chaotic-normal/episodes/the-rising-tide'],'extract'=>['@play\\.acast\\.com/s/(?\'show_id\'[-.\\w]+)/(?\'episode_id\'[-.\\w]+)(?:\\?seek=(?\'t\'\\d+))?@','@shows\\.acast\\.com/(?\'show_id\'[-.\\w]+)/(?:episodes/)?(?\'episode_id\'[-.\\w]+)(?:\\?seek=(?\'t\'\\d+))?@'],'homepage'=>'https://play.acast.com/','host'=>['acast.com'],'iframe'=>['height'=>188,'max-width'=>900,'src'=>'https://embed.acast.com/{@show_id}/{@episode_id}?seek={@t}','width'=>'100%'],'name'=>'Acast','oembed'=>['endpoint'=>'https://oembed.acast.com/v1/embed-player','scheme'=>'https://play.acast.com/s/{@show_id}/{@episode_id}'],'scrape'=>[['extract'=>['@"showId":"(?\'show_id\'[-0-9a-f]+)@','@"id":"(?\'episode_id\'[-0-9a-f]+)@'],'match'=>['@play\\.acast\\.com/s/[-.\\w]+/.@','@shows\\.acast\\.com/[-.\\w]+/.@'],'url'=>'https://feeder.acast.com/api/v1/shows/{@show_id}/episodes/{@episode_id}']],'tags'=>['podcasts']],
'anchor'=>['attributes'=>[],'example'=>'https://anchor.fm/aconversationwith/episodes/Answering-Voicemails-A-Conversation-With-You--2-e6e7lg','extract'=>['@anchor.fm/(?:[-\\w]+/)*?episodes/(?:[-\\w]+-)(?\'id\'\\w+)(?![-\\w])@'],'homepage'=>'https://anchor.fm/','host'=>['anchor.fm'],'iframe'=>['height'=>102,'max-width'=>768,'src'=>'//anchor.fm/x/embed/episodes/x-{@id}','width'=>'100%'],'name'=>'Anchor','scrape'=>[],'tags'=>['podcasts']],
'applepodcasts'=>['attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>450,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}','width'=>'100%']],'when'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>175,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}&i={@episode_id}','width'=>'100%'],'test'=>'@episode_id']],'example'=>['https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348','https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348?i=1000514199106'],'extract'=>['@podcasts\\.apple\\.com/(?\'country\'\\w+)/podcast/[-\\w]*/id(?\'podcast_id\'\\d+)(?:\\?i=(?\'episode_id\'\\d+))?@'],'homepage'=>'https://podcasts.apple.com/','host'=>['podcasts.apple.com'],'name'=>'Apple Podcasts','scrape'=>[],'tags'=>['podcasts']],
'applepodcasts'=>['attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>450,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}','width'=>'100%']],'when'=>['iframe'=>['allow'=>'autoplay *;encrypted-media *','height'=>175,'max-width'=>900,'src'=>'https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}&i={@episode_id}','width'=>'100%'],'test'=>'@episode_id']],'example'=>['https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348','https://podcasts.apple.com/us/podcast/the-office-deep-dive-with-brian-baumgartner/id1550331348?i=1000514199106'],'extract'=>['@podcasts\\.apple\\.com/(?\'country\'\\w+)/podcast/[-\\w%]*/id(?\'podcast_id\'\\d+)(?:\\?i=(?\'episode_id\'\\d+))?@'],'homepage'=>'https://podcasts.apple.com/','host'=>['podcasts.apple.com'],'name'=>'Apple Podcasts','scrape'=>[],'tags'=>['podcasts']],
'audioboom'=>['attributes'=>[],'example'=>'https://audioboom.com/posts/2493448-robert-patrick','extract'=>['!audioboo(?:\\.f|m\\.co)m/(?:boo|post)s/(?\'id\'\\d+)!'],'homepage'=>'https://audioboom.com/','host'=>['audioboo.fm','audioboom.com'],'iframe'=>['height'=>150,'max-width'=>700,'src'=>'//audioboom.com/posts/{@id}/embed/v3','width'=>'100%'],'name'=>'Audioboom','scrape'=>[],'tags'=>['podcasts']],
'audiomack'=>['attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['height'=>252,'max-width'=>900,'src'=>'https://www.audiomack.com/embed/song/<xsl:choose><xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when><xsl:otherwise><xsl:value-of select="@artist"/>/<xsl:value-of select="@title"/></xsl:otherwise></xsl:choose>','width'=>'100%']],'when'=>['iframe'=>['height'=>400,'max-width'=>900,'src'=>'https://www.audiomack.com/embed/album/<xsl:choose><xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when><xsl:otherwise><xsl:value-of select="@artist"/>/<xsl:value-of select="@title"/></xsl:otherwise></xsl:choose>','width'=>'100%'],'test'=>'@mode=\'album\'']],'example'=>['https://www.audiomack.com/your-music-fix/song/jammin-kungs-remix-1','https://www.audiomack.com/chance-the-rapper/album/acid-rap'],'extract'=>['!audiomack\\.com/(?\'mode\'album|song)/(?\'artist\'[-\\w]+)/(?\'title\'[-\\w]+)!','!audiomack\\.com/(?\'artist\'[-\\w]+)/(?\'mode\'album|song)/(?\'title\'[-\\w]+)!'],'homepage'=>'https://www.audiomack.com/','host'=>['audiomack.com'],'name'=>'Audiomack','scrape'=>[],'tags'=>['music']],
'audius'=>['attributes'=>[],'example'=>['https://audius.co/feedbachmusic/album/lights-ii-62147','https://audius.co/audiusplaylists/playlist/culture-over-clout-56948','https://audius.co/manilakilla/chet-porter-the-longest-day-ever-manila-killa-edit'],'extract'=>[],'homepage'=>'https://audius.co/','host'=>['audius.co'],'iframe'=>['height'=>'<xsl:choose><xsl:when test="@track_id">12</xsl:when><xsl:otherwise>48</xsl:otherwise></xsl:choose>0','max-width'=>'<xsl:choose><xsl:when test="@track_id">9</xsl:when><xsl:otherwise>4</xsl:otherwise></xsl:choose>00','src'=>'https://audius.co/embed/<xsl:choose><xsl:when test="@track_id">track/<xsl:value-of select="@track_id"/>?flavor=compact</xsl:when><xsl:when test="@album_id">album/<xsl:value-of select="@album_id"/>?flavor=card</xsl:when><xsl:otherwise>playlist/<xsl:value-of select="@playlist_id"/>?flavor=card</xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'Audius','scrape'=>[['extract'=>['!"id"\\s*:\\s*"(?\'track_id\'\\w+)"!'],'match'=>['@audius\\.co/(?!v1/)(?\'user\'[-.\\w]+)/(?!album/|playlist/)(?\'slug\'[%\\-.\\w]+)@'],'url'=>'https://discoveryprovider.audius.co/v1/resolve?app_name=s9e-textformatter&url=/{@user}/{@slug}'],['extract'=>['!"id"\\s*:\\s*"(?\'album_id\'\\w+)"!'],'match'=>['@audius\\.co/(?!v1/)(?\'user\'[-.\\w]+)/album/(?\'slug\'[%\\-.\\w]+)@'],'url'=>'https://discoveryprovider.audius.co/v1/resolve?app_name=s9e-textformatter&url=/{@user}/album/{@slug}'],['extract'=>['!"id"\\s*:\\s*"(?\'playlist_id\'\\w+)"!'],'match'=>['@audius\\.co/(?!v1/)(?\'user\'[-.\\w]+)/playlist/(?\'slug\'[%\\-.\\w]+)@'],'url'=>'https://discoveryprovider.audius.co/v1/resolve?app_name=s9e-textformatter&url=/{@user}/playlist/{@slug}']],'tags'=>['music']],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<tags><tag>podcasts</tag></tags>

<host>podcasts.apple.com</host>
<extract>@podcasts\.apple\.com/(?'country'\w+)/podcast/[-\w]*/id(?'podcast_id'\d+)(?:\?i=(?'episode_id'\d+))?@</extract>
<extract>@podcasts\.apple\.com/(?'country'\w+)/podcast/[-\w%]*/id(?'podcast_id'\d+)(?:\?i=(?'episode_id'\d+))?@</extract>
<choose>
<when test="@episode_id">
<iframe allow="autoplay *;encrypted-media *" width="100%" height="175" max-width="900" src="https://embed.podcasts.apple.com/{@country}/podcast/episode/id{@podcast_id}?theme={$MEDIAEMBED_THEME}&amp;i={@episode_id}"/>
Expand Down
5 changes: 3 additions & 2 deletions tests/Plugins/MediaEmbed/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1327,8 +1327,9 @@ function ($configurator)
}
],
[
'https://podcasts.apple.com/dk/podcast/say-his-name-george-floyd-retssagen-begynder/id1429569036?i=1000514458995',
'<r><APPLEPODCASTS country="dk" episode_id="1000514458995" podcast_id="1429569036">https://podcasts.apple.com/dk/podcast/say-his-name-george-floyd-retssagen-begynder/id1429569036?i=1000514458995</APPLEPODCASTS></r>',
// https://xenforo.com/community/threads/s9e-media-sites.139274/post-1711606
'https://podcasts.apple.com/fr/podcast/rachel-carson-une-%C3%A9crivaine-%C3%A0-la-naissance-de-l%C3%A9cologie/id1575516483?i=1000528436445',
'<r><APPLEPODCASTS country="fr" episode_id="1000528436445" podcast_id="1575516483">https://podcasts.apple.com/fr/podcast/rachel-carson-une-%C3%A9crivaine-%C3%A0-la-naissance-de-l%C3%A9cologie/id1575516483?i=1000528436445</APPLEPODCASTS></r>',
[],
function ($configurator)
{
Expand Down

0 comments on commit ac657d7

Please sign in to comment.