Update dependencies and restructure project files
- Added mutagen, requests, and yt-dlp as dependencies in pyproject.toml and requirements.txt. - Removed run_generator.py, start_server.py, and test_generator.py as they are no longer needed. - Introduced setup.sh for initial setup instructions and directory creation. - Updated uv.lock with new package versions and dependencies.
This commit is contained in:
68
main.py
68
main.py
@ -1,6 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
SERMAN RSS Feed Generator - Lokale Version
|
||||
Generiert RSS-Feeds aus lokalen MP3-Dateien für Podcast-Apps.
|
||||
"""
|
||||
|
||||
from local_podcast_generator import LocalPodcastGenerator
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
print("Hello from rss-feeder!")
|
||||
parser = argparse.ArgumentParser(description="SERMAN RSS Feed Generator - Lokale Version")
|
||||
parser.add_argument("-a", "--audio-dir", default="_audio",
|
||||
help="Verzeichnis mit MP3-Dateien (Standard: _audio)")
|
||||
parser.add_argument("-o", "--output", default="serman_podcast.xml",
|
||||
help="Ausgabedatei für den RSS-Feed (Standard: serman_podcast.xml)")
|
||||
parser.add_argument("-u", "--base-url", default="http://localhost:8087",
|
||||
help="Basis-URL für Audio-Dateien (Standard: http://localhost:8087)")
|
||||
parser.add_argument("--serve", action="store_true",
|
||||
help="Startet automatisch einen HTTP-Server nach der Generierung")
|
||||
parser.add_argument("--port", type=int, default=8087,
|
||||
help="Port für den HTTP-Server (Standard: 8087)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
print("🎵 SERMAN RSS Feed Generator - Lokale Version")
|
||||
print("=" * 50)
|
||||
|
||||
# Prüfe ob Audio-Verzeichnis existiert
|
||||
if not os.path.exists(args.audio_dir):
|
||||
print(f"❌ Audio-Verzeichnis '{args.audio_dir}' existiert nicht!")
|
||||
print(f"💡 Erstelle das Verzeichnis und lege deine MP3-Dateien dort ab.")
|
||||
return 1
|
||||
|
||||
# Erstelle den Generator
|
||||
generator = LocalPodcastGenerator(
|
||||
audio_dir=args.audio_dir,
|
||||
output_file=args.output,
|
||||
base_url=args.base_url
|
||||
)
|
||||
|
||||
# Generiere den RSS-Feed
|
||||
print(f"📂 Scanne '{args.audio_dir}/' nach MP3-Dateien...")
|
||||
success = generator.create_rss_feed(
|
||||
podcast_title="SERMAN - Organic House Podcast",
|
||||
podcast_author="SERMAN"
|
||||
)
|
||||
|
||||
if not success:
|
||||
print("❌ Fehler beim Erstellen des RSS-Feeds!")
|
||||
return 1
|
||||
|
||||
print("\n🎉 RSS-Feed erfolgreich erstellt!")
|
||||
print(f"📄 Datei: {args.output}")
|
||||
print(f"🌐 URL: {args.base_url}/{args.output}")
|
||||
|
||||
if args.serve:
|
||||
print("\n🚀 Starte HTTP-Server...")
|
||||
generator.serve_feed(args.port)
|
||||
else:
|
||||
print(f"\n💡 Zum Starten des Servers: python main.py --serve")
|
||||
print(f"💡 Oder direkt: python local_podcast_generator.py --serve")
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
sys.exit(main())
|
||||
|
Reference in New Issue
Block a user