Skip to content

Commit fcd2c8a

Browse files
committed
MediaEmbed: added Omny
1 parent 5eabf32 commit fcd2c8a

8 files changed

Lines changed: 93 additions & 67 deletions

File tree

docs/Plugins/MediaEmbed/Sites.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@
313313
<td><code>odysee</code></td>
314314
<td>https://odysee.com/@veritasium:f/the-secret-of-synchronization:2</td>
315315
</tr>
316+
<tr title="Omny Studio" id="omny">
317+
<td><code>omny</code></td>
318+
<td>https://omny.fm/shows/the-vortx-podcast/tech-n9ne</td>
319+
</tr>
316320
<tr title="On3 DB" id="on3">
317321
<td><code>on3</code></td>
318322
<td>https://www.on3.com/db/christian-jones-150372/industry-comparison/</td>

docs/Plugins/MediaEmbed/Using_default_sites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ echo count($configurator->MediaEmbed->defaultSites), " sites remaining.\n";
7777
```
7878
Does YouTube exist? yes
7979
What about now? no
80-
134 sites remaining.
80+
135 sites remaining.
8181
0 sites remaining.
8282
```
8383

docs/testdox.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7307,6 +7307,7 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
73077307
[x] Parsing tests with data set #344
73087308
[x] Parsing tests with data set #345
73097309
[x] Parsing tests with data set #346
7310+
[x] Parsing tests with data set #347
73107311
[x] Parsing tests (JavaScript) with data set #0
73117312
[x] Parsing tests (JavaScript) with data set #1
73127313
[x] Parsing tests (JavaScript) with data set #2
@@ -7654,6 +7655,7 @@ Parser (s9e\TextFormatter\Tests\Plugins\MediaEmbed\Parser)
76547655
[x] Parsing tests (JavaScript) with data set #344
76557656
[x] Parsing tests (JavaScript) with data set #345
76567657
[x] Parsing tests (JavaScript) with data set #346
7658+
[x] Parsing tests (JavaScript) with data set #347
76577659
[x] Parsing+rendering tests with data set #0
76587660
[x] Parsing+rendering tests with data set #1
76597661
[x] Parsing+rendering tests with data set #2

src/Bundles/MediaPack.php

Lines changed: 64 additions & 63 deletions
Large diffs are not rendered by default.

src/Bundles/MediaPack/Renderer.php

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

src/Plugins/MediaEmbed/Configurator/Collections/CachedDefinitionCollection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
8888
'npr'=>['attributes'=>[],'example'=>['https://www.npr.org/blogs/goatsandsoda/2015/02/11/385396431/the-50-most-effective-ways-to-transform-the-developing-world','https://n.pr/1Qky1m5'],'extract'=>[],'homepage'=>'https://www.npr.org/','host'=>['npr.org','n.pr'],'iframe'=>['height'=>228,'max-width'=>800,'src'=>'//www.npr.org/player/embed/{@i}/{@m}','width'=>'100%'],'name'=>'NPR','scrape'=>[['extract'=>['!player/embed/(?\'i\'\\d+)/(?\'m\'\\d+)!'],'header'=>'Cookie: trackingChoice=false; choiceVersion=1','match'=>['!npr\\.org/[/\\w]+/\\d+!','!n\\.pr/\\w!']]],'tags'=>['podcasts']],
8989
'nytimes'=>['attributes'=>[],'example'=>['https://www.nytimes.com/video/magazine/100000003166834/small-plates.html','https://www.nytimes.com/video/technology/personaltech/100000002907606/soylent-taste-test.html','https://www.nytimes.com/video/2012/12/17/business/100000001950744/how-wal-mart-conquered-teotihuacan.html','https://movies.nytimes.com/movie/131154/Crooklyn/trailers'],'extract'=>['!nytimes\\.com/video/[a-z]+/(?:[a-z]+/)?(?\'id\'\\d+)!','!nytimes\\.com/video/\\d+/\\d+/\\d+/[a-z]+/(?\'id\'\\d+)!'],'homepage'=>'https://www.nytimes.com/video/','host'=>['nytimes.com'],'iframe'=>['height'=>400,'src'=>'//graphics8.nytimes.com/video/players/offsite/index.html?videoId={@id}','width'=>585],'name'=>'The New York Times Video','scrape'=>[['extract'=>['!/video/movies/(?\'id\'\\d+)!'],'match'=>['!nytimes\\.com/movie(?:s/movie)?/(?\'playlist\'\\d+)/[-\\w]+/trailers!'],'url'=>'http://www.nytimes.com/svc/video/api/playlist/{@playlist}?externalId=true']],'tags'=>['movies','news']],
9090
'odysee'=>['attributes'=>['name'=>['filterChain'=>['#url'],'required'=>false],'path'=>['filterChain'=>['#url'],'required'=>false]],'example'=>'https://odysee.com/@veritasium:f/the-secret-of-synchronization:2','extract'=>['#odysee\\.com/(?:\\$/\\w+/)?(?\'name\'[^:/]+)[:/](?\'id\'\\w{40})#','#odysee\\.com/(?\'path\'@[^:/]+:\\w/[^:/]+:\\w)#'],'homepage'=>'https://odysee.com/','host'=>['odysee.com'],'iframe'=>['src'=>'https://odysee.com/$/embed/<xsl:choose><xsl:when test="@id"><xsl:choose><xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when><xsl:otherwise>-</xsl:otherwise></xsl:choose>/<xsl:value-of select="@id"/></xsl:when><xsl:otherwise><xsl:value-of select="@path"/></xsl:otherwise></xsl:choose>'],'name'=>'Odysee','scrape'=>[['extract'=>['#"contentUrl".*api/\\w+/streams/\\w+/(?\'name\'[^/]+)/(?\'id\'\\w{40})#'],'match'=>['#odysee\\.com/@[^/:]+:\\w+/.#']]],'tags'=>['videos']],
91+
'omny'=>['attributes'=>[],'example'=>'https://omny.fm/shows/the-vortx-podcast/tech-n9ne','extract'=>['!omny\\.fm/shows/(?\'program_slug\'[-\\w]+)/(?\'clip_slug\'[-\\w]+)!'],'homepage'=>'https://omny.fm/','host'=>['omny.fm'],'iframe'=>['height'=>180,'max-width'=>900,'src'=>'https://omny.fm/shows/{@program_slug}/{@clip_slug}/embed','width'=>'100%'],'name'=>'Omny Studio','scrape'=>[],'tags'=>['podcasts']],
9192
'on3'=>['attributes'=>[],'example'=>'https://www.on3.com/db/christian-jones-150372/industry-comparison/','extract'=>['!/db/(?:[-\\w]*-)?(?\'id\'[0-9]+)/industry-comparison/!'],'homepage'=>'https://www.on3.com/db/','host'=>['on3.com'],'iframe'=>['data-s9e-livepreview-ignore-attrs'=>'style','height'=>476,'onload'=>'let b=this.contentWindow;window.addEventListener(\'message\',a=>{{a.source===b&&a.data.height&&(this.style.height=+a.data.height+20+\'px\')}});b.postMessage(\'\',\'*\')','src'=>'https://embed.on3.com/db/{@id}/industry-comparison/','width'=>600],'name'=>'On3 DB','scrape'=>[],'tags'=>['sports']],
9293
'orfium'=>['attributes'=>[],'example'=>['https://www.orfium.com/album/24371/everybody-loves-kanye-totom/','https://www.orfium.com/live-set/614763/foof-no-lights-5-foof/','https://www.orfium.com/playlist/511651/electronic-live-sessions-creamtronic/','https://www.orfium.com/track/625367/the-ambience-of-the-goss-vistas/'],'extract'=>['@album/(?\'album_id\'\\d+)@','@playlist/(?\'playlist_id\'\\d+)@','@live-set/(?\'set_id\'\\d+)@','@track/(?\'track_id\'\\d+)@'],'homepage'=>'https://www.orfium.com/','host'=>['orfium.com'],'iframe'=>['height'=>'<xsl:choose><xsl:when test="@album_id">550</xsl:when><xsl:otherwise>275</xsl:otherwise></xsl:choose>','max-width'=>900,'src'=>'https://www.orfium.com/embedded/<xsl:choose><xsl:when test="@album_id">album/<xsl:value-of select="@album_id"/></xsl:when><xsl:when test="@playlist_id">playlist/<xsl:value-of select="@playlist_id"/></xsl:when><xsl:when test="@set_id">live-set/<xsl:value-of select="@set_id"/></xsl:when><xsl:otherwise>track/<xsl:value-of select="@track_id"/></xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'Orfium','scrape'=>[],'tags'=>['music']],
9394
'pastebin'=>['attributes'=>[],'example'=>'https://pastebin.com/9jEf44nc','extract'=>['@pastebin\\.com/(?!u/)(?:\\w+(?:\\.php\\?i=|/))?(?\'id\'\\w+)@'],'homepage'=>'https://pastebin.com/','host'=>['pastebin.com'],'iframe'=>['height'=>300,'scrolling'=>'','src'=>'//pastebin.com/embed_iframe.php?i={@id}','style'=>['resize'=>'vertical'],'width'=>'100%'],'name'=>'Pastebin','scrape'=>[]],
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<site name="Omny Studio" homepage="https://omny.fm/">
2+
<example>https://omny.fm/shows/the-vortx-podcast/tech-n9ne</example>
3+
4+
<tags><tag>podcasts</tag></tags>
5+
6+
<host>omny.fm</host>
7+
<extract>!omny\.fm/shows/(?'program_slug'[-\w]+)/(?'clip_slug'[-\w]+)!</extract>
8+
<iframe width="100%" height="180" max-width="900" src="https://omny.fm/shows/{@program_slug}/{@clip_slug}/embed"/>
9+
</site>

tests/Plugins/MediaEmbed/ParserTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3014,6 +3014,15 @@ function ($configurator)
30143014
$configurator->MediaEmbed->add('odysee');
30153015
}
30163016
],
3017+
[
3018+
'https://omny.fm/shows/the-vortx-podcast/tech-n9ne',
3019+
'<r><OMNY clip_slug="tech-n9ne" program_slug="the-vortx-podcast">https://omny.fm/shows/the-vortx-podcast/tech-n9ne</OMNY></r>',
3020+
[],
3021+
function ($configurator)
3022+
{
3023+
$configurator->MediaEmbed->add('omny');
3024+
}
3025+
],
30173026
[
30183027
'https://www.on3.com/db/naeem-offord-156248/industry-comparison/',
30193028
'<r><ON3 id="156248">https://www.on3.com/db/naeem-offord-156248/industry-comparison/</ON3></r>',

0 commit comments

Comments
 (0)