Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,7 +94,7 @@ class SearchService:
|
|
| 94 |
@staticmethod
|
| 95 |
def get_stream(youtube_url: str) -> Optional[str]:
|
| 96 |
"""Retrieves the live stream URL for a given YouTube video URL using pytube.
|
| 97 |
-
|
| 98 |
:param youtube_url: The URL of the YouTube video.
|
| 99 |
:type youtube_url: str
|
| 100 |
:return: The HLS manifest URL if available, otherwise None.
|
|
@@ -102,7 +102,7 @@ class SearchService:
|
|
| 102 |
"""
|
| 103 |
try:
|
| 104 |
yt = YouTube(youtube_url)
|
| 105 |
-
|
| 106 |
is_live = yt.player_response.get('videoDetails', {}).get('isLiveContent', False)
|
| 107 |
if is_live:
|
| 108 |
streaming_data = yt.player_response.get('streamingData', {})
|
|
|
|
| 94 |
@staticmethod
|
| 95 |
def get_stream(youtube_url: str) -> Optional[str]:
|
| 96 |
"""Retrieves the live stream URL for a given YouTube video URL using pytube.
|
| 97 |
+
|
| 98 |
:param youtube_url: The URL of the YouTube video.
|
| 99 |
:type youtube_url: str
|
| 100 |
:return: The HLS manifest URL if available, otherwise None.
|
|
|
|
| 102 |
"""
|
| 103 |
try:
|
| 104 |
yt = YouTube(youtube_url)
|
| 105 |
+
_ = yt.streams
|
| 106 |
is_live = yt.player_response.get('videoDetails', {}).get('isLiveContent', False)
|
| 107 |
if is_live:
|
| 108 |
streaming_data = yt.player_response.get('streamingData', {})
|