diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 5a3e552..71a655e 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -5318,7 +5318,7 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vega" -version = "0.10.1" +version = "0.11.0" dependencies = [ "futures-util", "hex", diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 7e10cdc..5d9cf32 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -14,7 +14,8 @@ { "url": "https://nostr.build/**" }, { "url": "https://void.cat/**" }, { "url": "https://nostrimg.com/**" }, - { "url": "https://relay.vertexlab.io/**" } + { "url": "https://relay.vertexlab.io/**" }, + { "url": "https://fountain.fm/**" } ] }, "dialog:default", diff --git a/src/lib/podcast/fountainFm.ts b/src/lib/podcast/fountainFm.ts index a262176..8d8e63b 100644 --- a/src/lib/podcast/fountainFm.ts +++ b/src/lib/podcast/fountainFm.ts @@ -1,3 +1,4 @@ +import { fetch } from "@tauri-apps/plugin-http"; import type { PodcastEpisode } from "../../types/podcast"; export const FOUNTAIN_REGEX = /fountain\.fm\/(episode|show)\/([a-zA-Z0-9-]+)/; @@ -39,22 +40,30 @@ export async function resolveFountainEpisode(url: string): Promise]+content=["'](https?:\/\/[^"']+\.(mp3|m4a|ogg|opus)[^"']*?)["']/i) + // Prefer og:audio meta tag (Fountain.fm provides this), then fall back to any audio URL + const ogAudioMatch = html.match(/]+property=["']og:audio["'][^>]+content=["']([^"']+)["']/i) + || html.match(/]+content=["']([^"']+)["'][^>]+property=["']og:audio["']/i); + const audioMatch = ogAudioMatch + || html.match(/]+content=["'](https?:\/\/[^"']+\.(mp3|m4a|ogg|opus)[^"']*?)["']/i) || html.match(/["'](https?:\/\/[^"'\s]+\.(mp3|m4a|ogg|opus)[^"'\s]*?)["']/i); const enclosureUrl = audioMatch?.[1] ?? ""; if (!title) return null; + // OG title format: "Show • Episode • Listen on Fountain" — extract parts + const titleParts = title.split(" • ").filter((p) => p !== "Listen on Fountain"); + const showTitle = titleParts.length > 1 ? titleParts[0] : ""; + const episodeTitle = titleParts.length > 1 ? titleParts.slice(1).join(" • ") : title; + const episode: PodcastEpisode = { guid: `fountain:${url}`, - title, + title: episodeTitle, enclosureUrl, pubDate: 0, duration: 0, description, artworkUrl: artwork || undefined, - showTitle: "", + showTitle, showArtworkUrl: artwork, };