Spaces:
Sleeping
Sleeping
Nikita Makarov commited on
Commit ·
131e39a
1
Parent(s): 0e191ed
Add debug logging for podcast iframe creation
Browse files- src/app.py +4 -0
src/app.py
CHANGED
|
@@ -679,8 +679,10 @@ def play_next_segment():
|
|
| 679 |
|
| 680 |
# Create YouTube player for podcast if available
|
| 681 |
# Modal proxy returns "youtube_api" as source, so check both
|
|
|
|
| 682 |
if podcast.get("source") in ["youtube", "youtube_api"] and podcast.get("youtube_id"):
|
| 683 |
youtube_id = podcast.get("youtube_id", "")
|
|
|
|
| 684 |
|
| 685 |
# # COMMENTED OUT: Delayed loading mechanism
|
| 686 |
# # Get host audio duration to calculate delay
|
|
@@ -728,7 +730,9 @@ def play_next_segment():
|
|
| 728 |
podcast.get('url', '#')
|
| 729 |
)
|
| 730 |
print(f"✅ Podcast YouTube player created immediately: {podcast.get('title', 'Unknown')} (ID: {youtube_id})")
|
|
|
|
| 731 |
elif podcast.get("url") and "youtube" in podcast.get("url", ""):
|
|
|
|
| 732 |
# Fallback: extract YouTube ID from URL and create simple embed
|
| 733 |
url = podcast.get("url", "")
|
| 734 |
youtube_id = ""
|
|
|
|
| 679 |
|
| 680 |
# Create YouTube player for podcast if available
|
| 681 |
# Modal proxy returns "youtube_api" as source, so check both
|
| 682 |
+
print(f"🔍 Podcast debug: source={podcast.get('source')}, youtube_id={podcast.get('youtube_id')}, url={podcast.get('url', '')[:50]}")
|
| 683 |
if podcast.get("source") in ["youtube", "youtube_api"] and podcast.get("youtube_id"):
|
| 684 |
youtube_id = podcast.get("youtube_id", "")
|
| 685 |
+
print(f"✅ Creating podcast iframe with youtube_id: {youtube_id}")
|
| 686 |
|
| 687 |
# # COMMENTED OUT: Delayed loading mechanism
|
| 688 |
# # Get host audio duration to calculate delay
|
|
|
|
| 730 |
podcast.get('url', '#')
|
| 731 |
)
|
| 732 |
print(f"✅ Podcast YouTube player created immediately: {podcast.get('title', 'Unknown')} (ID: {youtube_id})")
|
| 733 |
+
print(f"📦 Podcast iframe HTML length: {len(music_player_html)} chars, contains iframe: {'<iframe' in music_player_html}")
|
| 734 |
elif podcast.get("url") and "youtube" in podcast.get("url", ""):
|
| 735 |
+
print(f"⚠️ Podcast: using fallback URL extraction")
|
| 736 |
# Fallback: extract YouTube ID from URL and create simple embed
|
| 737 |
url = podcast.get("url", "")
|
| 738 |
youtube_id = ""
|