Verbessere die Podcast-Feed-Erstellung durch Hinzufügen von Metadaten für bessere Kompatibilität mit Podcast-Apps und korrekte Formatierung von Veröffentlichungsdaten.
This commit is contained in:
@ -174,7 +174,7 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er
|
||||
# Channel Element
|
||||
channel = ET.SubElement(rss, "channel")
|
||||
|
||||
# Channel Metadaten
|
||||
# Channel Metadaten mit besserer Podcast-Kompatibilität
|
||||
title = ET.SubElement(channel, "title")
|
||||
title.text = podcast_title
|
||||
|
||||
@ -187,20 +187,41 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er
|
||||
language = ET.SubElement(channel, "language")
|
||||
language.text = "de-DE"
|
||||
|
||||
# iTunes-spezifische Tags
|
||||
# Wichtig: lastBuildDate für bessere Erkennung von Updates
|
||||
last_build = ET.SubElement(channel, "lastBuildDate")
|
||||
last_build.text = datetime.now().strftime('%a, %d %b %Y %H:%M:%S +0000')
|
||||
|
||||
# pubDate für den Channel
|
||||
channel_pub_date = ET.SubElement(channel, "pubDate")
|
||||
channel_pub_date.text = datetime.now().strftime('%a, %d %b %Y %H:%M:%S +0000')
|
||||
|
||||
# Generator Info
|
||||
generator = ET.SubElement(channel, "generator")
|
||||
generator.text = "SERMAN Local Podcast Generator"
|
||||
|
||||
# iTunes-spezifische Tags für bessere Podcast-App-Kompatibilität
|
||||
itunes_author = ET.SubElement(channel, "itunes:author")
|
||||
itunes_author.text = podcast_author
|
||||
|
||||
itunes_summary = ET.SubElement(channel, "itunes:summary")
|
||||
itunes_summary.text = podcast_description
|
||||
|
||||
# iTunes Kategorie
|
||||
itunes_category = ET.SubElement(channel, "itunes:category")
|
||||
itunes_category.set("text", "Music")
|
||||
|
||||
# Sub-Kategorie für bessere Einordnung
|
||||
itunes_sub_category = ET.SubElement(itunes_category, "itunes:category")
|
||||
itunes_sub_category.set("text", "Music Commentary")
|
||||
|
||||
# Explicit Content
|
||||
itunes_explicit = ET.SubElement(channel, "itunes:explicit")
|
||||
itunes_explicit.text = "false"
|
||||
|
||||
# iTunes Type (für episodische Podcasts)
|
||||
itunes_type = ET.SubElement(channel, "itunes:type")
|
||||
itunes_type.text = "episodic"
|
||||
|
||||
# Standard-Bild (kann später angepasst werden)
|
||||
image_url = f"{self.base_url}/_img/podcast-cover.png"
|
||||
image = ET.SubElement(channel, "image")
|
||||
@ -247,9 +268,11 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er
|
||||
item_guid.text = audio_url
|
||||
item_guid.set("isPermaLink", "true")
|
||||
|
||||
# Veröffentlichungsdatum
|
||||
# Veröffentlichungsdatum (korrekt formatiert für RSS)
|
||||
item_pubdate = ET.SubElement(item, "pubDate")
|
||||
item_pubdate.text = metadata['pub_date'].strftime('%a, %d %b %Y %H:%M:%S %z')
|
||||
# RFC 2822 Format für RSS (mit Timezone)
|
||||
pub_date_formatted = metadata['pub_date'].strftime('%a, %d %b %Y %H:%M:%S +0000')
|
||||
item_pubdate.text = pub_date_formatted
|
||||
|
||||
# Audio-Enclosure
|
||||
enclosure = ET.SubElement(item, "enclosure")
|
||||
@ -262,7 +285,7 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er
|
||||
item_duration = ET.SubElement(item, "itunes:duration")
|
||||
item_duration.text = self.format_duration(metadata['duration'])
|
||||
|
||||
# iTunes-spezifische Tags
|
||||
# iTunes-spezifische Tags für bessere Episode-Erkennung
|
||||
itunes_title = ET.SubElement(item, "itunes:title")
|
||||
itunes_title.text = metadata['title']
|
||||
|
||||
@ -272,8 +295,22 @@ Ich spezialisiere mich auf House Music, die mehr als nur Beats bietet – sie er
|
||||
itunes_explicit_item = ET.SubElement(item, "itunes:explicit")
|
||||
itunes_explicit_item.text = "false"
|
||||
|
||||
# Episode-Cover hinzufügen (falls vorhanden)
|
||||
# iTunes Episode Typ
|
||||
itunes_episode_type = ET.SubElement(item, "itunes:episodeType")
|
||||
itunes_episode_type.text = "full"
|
||||
|
||||
# Episode-Cover hinzufügen (falls vorhanden) - beide Formate für bessere Kompatibilität
|
||||
if episode_cover_url:
|
||||
# Standard RSS image tag
|
||||
item_image = ET.SubElement(item, "image")
|
||||
item_image_url = ET.SubElement(item_image, "url")
|
||||
item_image_url.text = episode_cover_url
|
||||
item_image_title = ET.SubElement(item_image, "title")
|
||||
item_image_title.text = metadata['title']
|
||||
item_image_link = ET.SubElement(item_image, "link")
|
||||
item_image_link.text = audio_url
|
||||
|
||||
# iTunes image tag
|
||||
itunes_image_item = ET.SubElement(item, "itunes:image")
|
||||
itunes_image_item.set("href", episode_cover_url)
|
||||
|
||||
|
Reference in New Issue
Block a user