')
- if not first_image:
- first_image = thumb
+ watch_url = f"https://www.youtube.com/watch?v={vid}"
+
+ # Try provider HTML via oEmbed (as Ghost does)
+ embed_html = fetch_youtube_oembed_html(watch_url, timeout=10)
+ if embed_html:
+ parts.append(embed_html)
+ else:
+ # Fallback: leave the plain URL on its own line so Ghost may still auto-embed
+ parts.append(f'\n
{watch_url}
\n')
+
+ # Minimal fallback link (non-intrusive for email/web)
+ parts.append(f'
')
else:
# --- Texte + lien
ftext = ""
@@ -267,6 +287,7 @@ class GhostTask:
if link.get("type") in ("image/jpg", "image/jpeg", "image/png", "image/webp"):
imgUrl = link.get("href")
if imgUrl:
+ imgUrl = imgUrl.replace("/250x250/", "/990x320/")
if not first_image:
first_image = imgUrl
parts.append(f'')
@@ -320,7 +341,7 @@ class GhostTask:
# (Re)charge les feeds
feeds_file = os.environ.get("FEEDS_FILE", "/data/feeds.txt")
if not os.path.isfile(feeds_file):
- feeds_file = os.environ.get("FEEDS_FILE_FALLBACK", r"c:\workspace\Substack_JV\feeds.txt")
+ feeds_file = os.environ.get("FEEDS_FILE_FALLBACK", r"f:\workspace\Substack_JV\feeds.txt")
feeds: List[RSSfeed] = []
with open(feeds_file, encoding="utf-8") as f:
lines = [line.strip() for line in f if line.strip()]
@@ -393,7 +414,7 @@ async def main():
feeds: List[RSSfeed] = []
feeds_file = os.environ.get("FEEDS_FILE", "/data/feeds.txt")
if not os.path.isfile(feeds_file):
- feeds_file = os.environ.get("FEEDS_FILE_FALLBACK", r"c:\workspace\Substack_JV\feeds.txt")
+ feeds_file = os.environ.get("FEEDS_FILE_FALLBACK", r"f:\workspace\Substack_JV\feeds.txt")
with open(feeds_file, encoding="utf-8") as f:
for line in f:
line = line.strip()