Spaces:
Sleeping
Sleeping
fix: handle YouTube share URLs with si= parameter
Browse files- Added ? to regex exclusion set [^&#?]
- Fixes parsing of youtu.be/VIDEO?si=... format
- All URL formats now properly extract video ID
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
app/routes/commend/youtube_service.py
CHANGED
|
@@ -95,10 +95,10 @@ def _get_oauth_service():
|
|
| 95 |
def extract_video_id(video_url: str) -> Optional[str]:
|
| 96 |
"""YouTube URL'sinden video ID'sini çıkarır."""
|
| 97 |
patterns = [
|
| 98 |
-
r"(?<=v=)[^&#]+",
|
| 99 |
-
r"(?<=be/)[^&#]+",
|
| 100 |
-
r"(?<=embed/)[^&#]+",
|
| 101 |
-
r"(?<=shorts/)[^&#]+"
|
| 102 |
]
|
| 103 |
|
| 104 |
for pattern in patterns:
|
|
|
|
| 95 |
def extract_video_id(video_url: str) -> Optional[str]:
|
| 96 |
"""YouTube URL'sinden video ID'sini çıkarır."""
|
| 97 |
patterns = [
|
| 98 |
+
r"(?<=v=)[^&#?]+",
|
| 99 |
+
r"(?<=be/)[^&#?]+",
|
| 100 |
+
r"(?<=embed/)[^&#?]+",
|
| 101 |
+
r"(?<=shorts/)[^&#?]+"
|
| 102 |
]
|
| 103 |
|
| 104 |
for pattern in patterns:
|