Closed brunob closed 3 years ago
Bon voilà, c'est pas super clean mais ça fonctionne :)
diff --git a/autoembed.php b/autoembed.php
index a3440a5..eb89f0c 100644
--- a/autoembed.php
+++ b/autoembed.php
@@ -65,6 +65,18 @@ function embed_url($url) {
}
}
}
+ else if (preg_match(",^https?\://(www\.)?franceculture\.fr/emissions/,i", $url)) {
+ if ($page = file_get_contents($url)) {
+ if (preg_match('/"contentUrl": "([^"]+)",/s', $page, $i)) {
+ $mp3 = $i[1];
+ if (preg_match(',<meta property="og:image" content="(.*)",Uims', $page, $i1)) {
+ $img = $i1[1];
+ }
+ $html = "<div class='audio'><audio controls><source src='$mp3' rel='enclosure'></audio></div>";
+ if ($html) $code_ae = "<img src='$img' alt='' style='max-width: none; width: 99%; height: auto'/><div class='oembed-container'>$html</div>";
+ }
+ }
+ }
else if (preg_match("/^http\:\/\/(www\.)?pastebin\.com\/(.*)/i", $url, $regs)) {
$val = $regs[2];
Et ça donne ça :
ref https://seenthis.net/messages/899380#message899589