57 lines
1.6 KiB
Python
57 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Optimierter Mixcloud RSS Feed Generator
|
|
Erstellt Podcast-kompatible RSS-Feeds mit direkten Audio-Links.
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
from pathlib import Path
|
|
|
|
def run_pro_script(*args):
|
|
"""Führt das Pro-Script mit uv run aus."""
|
|
cmd = ["uv", "run", "python", "mixcloud_rss_pro.py"] + list(args)
|
|
|
|
try:
|
|
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
|
print(result.stdout)
|
|
return True
|
|
except subprocess.CalledProcessError as e:
|
|
print(f"❌ Fehler: {e}")
|
|
if e.stdout:
|
|
print("STDOUT:", e.stdout)
|
|
if e.stderr:
|
|
print("STDERR:", e.stderr)
|
|
return False
|
|
except FileNotFoundError:
|
|
print("❌ uv nicht gefunden. Verwende fallback...")
|
|
return False
|
|
|
|
def main():
|
|
"""Wrapper für das Pro-Script."""
|
|
if not Path("mixcloud_rss_pro.py").exists():
|
|
print("❌ mixcloud_rss_pro.py nicht gefunden!")
|
|
sys.exit(1)
|
|
|
|
# Argumente weiterleiten
|
|
args = sys.argv[1:]
|
|
|
|
print("🚀 Starte optimierten Mixcloud RSS Generator...")
|
|
print("=" * 50)
|
|
|
|
success = run_pro_script(*args)
|
|
|
|
if not success:
|
|
print("\n⚠️ Fallback: Versuche direkten Python-Aufruf...")
|
|
try:
|
|
import mixcloud_rss_pro
|
|
# Hier könntest du das Script direkt aufrufen
|
|
print("❌ Bitte verwende: uv run python mixcloud_rss_pro.py")
|
|
except ImportError as e:
|
|
print(f"❌ Import-Fehler: {e}")
|
|
print("💡 Installiere die Abhängigkeiten: uv pip install -r requirements.txt")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|