Spaces:
Running
Running
Checking in new app from a local copy.
Browse files- app/.DS_Store +0 -0
- app/Dockerfile +0 -41
- app/__init__.py +0 -0
- app/__pycache__/__init__.cpython-313.pyc +0 -0
- app/app/.DS_Store +0 -0
- app/app/Youtubeextraction.py +0 -164
- app/app/__init__.py +0 -0
- app/app/__pycache__/Youtubeextraction.cpython-313.pyc +0 -0
- app/app/__pycache__/__init__.cpython-313.pyc +0 -0
- app/app/requirements.txt +0 -7
- app/utils/__init__.py +0 -0
- app/utils/__pycache__/__init__.cpython-313.pyc +0 -0
- app/utils/__pycache__/retrieve_filepath.cpython-313.pyc +0 -0
- app/utils/__pycache__/storage.cpython-313.pyc +0 -0
- app/utils/cookies.txt +0 -94
- app/utils/probeytdlp.py +0 -54
- app/utils/retrieve_filepath.py +0 -10
- app/utils/storage.py +0 -42
app/.DS_Store
DELETED
|
Binary file (6.15 kB)
|
|
|
app/Dockerfile
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
# ---------- Base ----------
|
| 2 |
-
#FROM python:3.11-slim
|
| 3 |
-
FROM cab337fa40e5acr.azurecr.io/python:3.11-slim
|
| 4 |
-
|
| 5 |
-
# ---------- System deps ----------
|
| 6 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
-
ffmpeg ca-certificates curl \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
-
|
| 10 |
-
# ---------- Workdir ----------
|
| 11 |
-
WORKDIR /workspace
|
| 12 |
-
|
| 13 |
-
# ---------- Python deps ----------
|
| 14 |
-
# requirements.txt is at AUDIOSUMMARIZER/app/requirements.txt
|
| 15 |
-
#COPY requirements.txt /tmp/requirements.txt
|
| 16 |
-
#RUN pip install --no-cache-dir --upgrade pip \
|
| 17 |
-
# && pip install --no-cache-dir -r /tmp/requirements.txt \
|
| 18 |
-
# ensure yt-dlp available even if not pinned
|
| 19 |
-
# && pip install --no-cache-dir yt-dlp
|
| 20 |
-
|
| 21 |
-
COPY app/requirements.txt .
|
| 22 |
-
RUN pip install --no-cache-dir --upgrade pip \
|
| 23 |
-
&& pip install --no-cache-dir -r requirements.txt
|
| 24 |
-
|
| 25 |
-
# ---------- App code ----------
|
| 26 |
-
# Copy EVERYTHING under AUDIOSUMMARIZER/app (includes subfolders: app/ and utils/)
|
| 27 |
-
COPY . /workspace/app
|
| 28 |
-
|
| 29 |
-
# Make /workspace importable so "app.app.Youtubeextraction" & "app.utils..." work
|
| 30 |
-
ENV PYTHONPATH=/workspace
|
| 31 |
-
|
| 32 |
-
# Runtime env (override at deploy)
|
| 33 |
-
ENV HOST=0.0.0.0
|
| 34 |
-
ENV PORT=8080
|
| 35 |
-
ENV AZURE_STORAGE_ACCOUNT=__SET_AT_DEPLOY__
|
| 36 |
-
ENV AZURE_BLOB_CONTAINER=__SET_AT_DEPLOY__
|
| 37 |
-
|
| 38 |
-
EXPOSE 8080
|
| 39 |
-
|
| 40 |
-
# Your ASGI app is defined in app/app/Youtubeextraction.py as `app = FastAPI()`
|
| 41 |
-
CMD ["uvicorn", "app.app.Youtubeextraction:app", "--host", "0.0.0.0", "--port", "8080"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/__init__.py
DELETED
|
File without changes
|
app/__pycache__/__init__.cpython-313.pyc
DELETED
|
Binary file (153 Bytes)
|
|
|
app/app/.DS_Store
DELETED
|
Binary file (6.15 kB)
|
|
|
app/app/Youtubeextraction.py
DELETED
|
@@ -1,164 +0,0 @@
|
|
| 1 |
-
import os, tempfile, subprocess, re, json, shutil, time
|
| 2 |
-
from fastapi import FastAPI, HTTPException
|
| 3 |
-
from pathlib import Path
|
| 4 |
-
from typing import Optional, Callable, Any
|
| 5 |
-
import yt_dlp
|
| 6 |
-
# from utils.storage import upload_and_sign # To remove circular import issue
|
| 7 |
-
from app.utils.storage import upload_and_sign # To remove circular import issue
|
| 8 |
-
from app.utils.retrieve_filepath import retrieve_file_path # To get the file path of cookies.txt
|
| 9 |
-
|
| 10 |
-
app = FastAPI()
|
| 11 |
-
|
| 12 |
-
def ensure_ffmpeg():
|
| 13 |
-
"""
|
| 14 |
-
Verify that ffmpeg is available in PATH.
|
| 15 |
-
Raises RuntimeError with helpful guidance if missing.
|
| 16 |
-
Prints ffmpeg version to logs if found.
|
| 17 |
-
"""
|
| 18 |
-
ffmpeg_path = shutil.which("ffmpeg")
|
| 19 |
-
if ffmpeg_path is None:
|
| 20 |
-
raise RuntimeError(
|
| 21 |
-
"FFmpeg not found in PATH.\n\n"
|
| 22 |
-
"👉 For Hugging Face Spaces:\n"
|
| 23 |
-
" • If using Gradio/Streamlit template → add a `packages.txt` file at repo root with a line: ffmpeg\n"
|
| 24 |
-
" • If using Docker template → add `apt-get install -y ffmpeg` in your Dockerfile\n\n"
|
| 25 |
-
"Without ffmpeg, yt-dlp cannot extract/convert audio."
|
| 26 |
-
)
|
| 27 |
-
|
| 28 |
-
try:
|
| 29 |
-
result = subprocess.run(
|
| 30 |
-
["ffmpeg", "-version"],
|
| 31 |
-
stdout=subprocess.PIPE,
|
| 32 |
-
stderr=subprocess.STDOUT,
|
| 33 |
-
text=True,
|
| 34 |
-
check=False,
|
| 35 |
-
)
|
| 36 |
-
print("✅ ffmpeg found at:", ffmpeg_path)
|
| 37 |
-
print(result.stdout.splitlines()[0]) # show first line of version info
|
| 38 |
-
except Exception as e:
|
| 39 |
-
raise RuntimeError(f"ffmpeg was found at {ffmpeg_path} but could not run: {e}")
|
| 40 |
-
|
| 41 |
-
class YTDLPError(RuntimeError):
|
| 42 |
-
pass
|
| 43 |
-
|
| 44 |
-
def _require(bin_name: str):
|
| 45 |
-
if shutil.which(bin_name) is None:
|
| 46 |
-
raise YTDLPError(f"Required executable '{bin_name}' not found in PATH.")
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
@app.get("/health")
|
| 50 |
-
def health():
|
| 51 |
-
return {"ok": True}
|
| 52 |
-
|
| 53 |
-
@app.post("/extract")
|
| 54 |
-
def extract(
|
| 55 |
-
youtube_url: str,
|
| 56 |
-
out_dir: Optional[str] = None,
|
| 57 |
-
target_sr: int = 16000,
|
| 58 |
-
target_channels: int = 1,
|
| 59 |
-
quiet: bool = True,
|
| 60 |
-
keep_intermediate: bool = False,
|
| 61 |
-
progress_hook: Optional[Callable[[dict[str, Any]], None]] = None,
|
| 62 |
-
) -> str:
|
| 63 |
-
"""
|
| 64 |
-
Download YouTube audio via yt_dlp's Python API, extract to WAV,
|
| 65 |
-
and post-process with ffmpeg to 16 kHz mono. Returns path to the final WAV.
|
| 66 |
-
|
| 67 |
-
Args
|
| 68 |
-
----
|
| 69 |
-
youtube_url : str
|
| 70 |
-
out_dir : Optional[str] Directory for outputs (temp dir if None).
|
| 71 |
-
target_sr : int Sample rate for final WAV (default 16000).
|
| 72 |
-
target_channels : int Channels for final WAV (default 1 = mono).
|
| 73 |
-
quiet : bool Suppress yt-dlp logs if True.
|
| 74 |
-
keep_intermediate : bool Keep the pre-downsampled WAV if True.
|
| 75 |
-
progress_hook : callable Optional yt-dlp progress hook.
|
| 76 |
-
|
| 77 |
-
Raises
|
| 78 |
-
------
|
| 79 |
-
YTDLPError on failure.
|
| 80 |
-
"""
|
| 81 |
-
if not youtube_url or not isinstance(youtube_url, str):
|
| 82 |
-
raise ValueError("youtube_url must be a non-empty string.")
|
| 83 |
-
|
| 84 |
-
_require("ffmpeg") # we call ffmpeg ourselves
|
| 85 |
-
# yt-dlp bundles ffmpeg via postprocessors, but we still run ffmpeg explicitly
|
| 86 |
-
|
| 87 |
-
work_dir = Path(out_dir or tempfile.mkdtemp(prefix="ytwav_")).resolve()
|
| 88 |
-
work_dir.mkdir(parents=True, exist_ok=True)
|
| 89 |
-
|
| 90 |
-
# First stage: let yt-dlp extract WAV (whatever SR/channels)
|
| 91 |
-
out_template = str(work_dir / "%(title).100B [%(id)s].%(ext)s")
|
| 92 |
-
hooks = [progress_hook] if progress_hook else []
|
| 93 |
-
### Use cookies.txt if available
|
| 94 |
-
cookies_path = retrieve_file_path("cookies.txt")
|
| 95 |
-
#cookies_path = "./app/utils/cookies.txt"
|
| 96 |
-
if not cookies_path:
|
| 97 |
-
cookies_path = None
|
| 98 |
-
print("Cookie file NOT found in container!")
|
| 99 |
-
return f"User authentication cookie file NOT found in container! Please try again later."
|
| 100 |
-
|
| 101 |
-
ydl_opts = {
|
| 102 |
-
"cookiefile": cookies_path,
|
| 103 |
-
"format": "bestaudio/best",
|
| 104 |
-
"outtmpl": out_template,
|
| 105 |
-
"noplaylist": True,
|
| 106 |
-
"postprocessors": [
|
| 107 |
-
{
|
| 108 |
-
"key": "FFmpegExtractAudio",
|
| 109 |
-
"preferredcodec": "wav",
|
| 110 |
-
"preferredquality": "0",
|
| 111 |
-
}
|
| 112 |
-
],
|
| 113 |
-
"quiet": quiet,
|
| 114 |
-
"verbose": not quiet,
|
| 115 |
-
"no_warnings": quiet,
|
| 116 |
-
"progress_hooks": hooks,
|
| 117 |
-
}
|
| 118 |
-
|
| 119 |
-
try:
|
| 120 |
-
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 121 |
-
ydl.extract_info(youtube_url, download=True)
|
| 122 |
-
except Exception as e:
|
| 123 |
-
#raise YTDLPError(f"yt-dlp API failed: {e}") from e
|
| 124 |
-
return f"yt-dlp API failed: {e}"
|
| 125 |
-
|
| 126 |
-
# Locate the produced WAV (pre-downsampled)
|
| 127 |
-
pre_wavs = list(work_dir.glob("*.wav"))
|
| 128 |
-
if not pre_wavs:
|
| 129 |
-
#raise YTDLPError("yt-dlp completed but no WAV was found.")
|
| 130 |
-
return "yt-dlp completed but no WAV was found."
|
| 131 |
-
pre_wav = max(pre_wavs, key=lambda p: p.stat().st_mtime)
|
| 132 |
-
|
| 133 |
-
# Second stage: force 16 kHz mono via ffmpeg
|
| 134 |
-
final_wav = pre_wav.with_name(pre_wav.stem + f".{target_sr}Hz.{target_channels}ch.wav")
|
| 135 |
-
try:
|
| 136 |
-
subprocess.run(
|
| 137 |
-
[
|
| 138 |
-
"ffmpeg", "-y",
|
| 139 |
-
"-i", str(pre_wav),
|
| 140 |
-
"-ac", str(target_channels),
|
| 141 |
-
"-ar", str(target_sr),
|
| 142 |
-
str(final_wav),
|
| 143 |
-
],
|
| 144 |
-
check=True,
|
| 145 |
-
stdout=subprocess.PIPE if quiet else None,
|
| 146 |
-
stderr=subprocess.PIPE if quiet else None,
|
| 147 |
-
text=True,
|
| 148 |
-
)
|
| 149 |
-
except subprocess.CalledProcessError as e:
|
| 150 |
-
#raise YTDLPError(f"ffmpeg failed to resample: {e.stderr or e.stdout}") from e
|
| 151 |
-
return f"ffmpeg failed to resample: {e.stderr or e.stdout}"
|
| 152 |
-
|
| 153 |
-
# 3) upload + sign (short-lived)
|
| 154 |
-
signed = upload_and_sign(final_wav, ttl_minutes=45)
|
| 155 |
-
|
| 156 |
-
# Clean up intermediates if desired
|
| 157 |
-
if not keep_intermediate:
|
| 158 |
-
try:
|
| 159 |
-
if pre_wav.exists() and pre_wav != final_wav:
|
| 160 |
-
pre_wav.unlink()
|
| 161 |
-
except Exception:
|
| 162 |
-
pass
|
| 163 |
-
|
| 164 |
-
return signed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/app/__init__.py
DELETED
|
File without changes
|
app/app/__pycache__/Youtubeextraction.cpython-313.pyc
DELETED
|
Binary file (7.02 kB)
|
|
|
app/app/__pycache__/__init__.cpython-313.pyc
DELETED
|
Binary file (157 Bytes)
|
|
|
app/app/requirements.txt
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
dotenv==0.9.9
|
| 2 |
-
requests==2.32.5
|
| 3 |
-
azure-identity==1.25.0
|
| 4 |
-
yt_dlp==2025.9.23
|
| 5 |
-
fastapi
|
| 6 |
-
uvicorn[standard]==0.30.6
|
| 7 |
-
azure-storage-blob==12.20.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/utils/__init__.py
DELETED
|
File without changes
|
app/utils/__pycache__/__init__.cpython-313.pyc
DELETED
|
Binary file (149 Bytes)
|
|
|
app/utils/__pycache__/retrieve_filepath.cpython-313.pyc
DELETED
|
Binary file (890 Bytes)
|
|
|
app/utils/__pycache__/storage.cpython-313.pyc
DELETED
|
Binary file (2.72 kB)
|
|
|
app/utils/cookies.txt
DELETED
|
@@ -1,94 +0,0 @@
|
|
| 1 |
-
# Netscape HTTP Cookie File
|
| 2 |
-
# http://curl.haxx.se/rfc/cookie_spec.html
|
| 3 |
-
# This is a generated file! Do not edit.
|
| 4 |
-
|
| 5 |
-
.google.com TRUE /verify TRUE 1774643801 SNID ABablneQpL5nd50lg171XcyVs24gvpO4-3XC33KqvJzhOyKzSjsRCTu2WNs98YrIa4rthJXC9umV_gfOPujCE8rpvEpn3J6IGBQ
|
| 6 |
-
.youtube.com TRUE / TRUE 1793401147 PREF f4=4000000&tz=America.Los_Angeles
|
| 7 |
-
accounts.google.com FALSE / TRUE 1761424715 OTZ 8275479_84_88_104280_84_446940
|
| 8 |
-
accounts.google.com FALSE / TRUE 1793392730 __Host-GAPS 1:yqAYuvXMLM6p418ku6ftwLAiw66lW5JDAUnpfgajBCLlPRefQ12FH4OpX-afmjZbWzdGaHl9_g2zQNGp0TzWzmv9LvMnGA:-kKVsK7giPvGw84Q
|
| 9 |
-
.google.com TRUE / TRUE 1774384731 AEC AaJma5tejBcPWOwI5osyzZtLbsylZCmSH2lz0zhEN1Q4WqoOtfvlBhXmMA
|
| 10 |
-
ogs.google.com FALSE / TRUE 1761424734 OTZ 8275479_84_88_104280_84_446940
|
| 11 |
-
myaccount.google.com FALSE / TRUE 1793398313 OSID g.a0001wjtWOu_WLZdXb5Jtdi-tk_TQCulwBmAfNO6NopkIFhHEeO0oDV7zmz7iijIbHt8FFlaFwACgYKAU8SARYSFQHGX2Mic1nR4MKxTRPME0LtDGY7ZhoVAUF8yKpfjouTWz97PA6bCvAoOqoA0076
|
| 12 |
-
myaccount.google.com FALSE / TRUE 1793398313 __Secure-OSID g.a0001wjtWOu_WLZdXb5Jtdi-tk_TQCulwBmAfNO6NopkIFhHEeO0iVJNUJbpqueptsN8uW4S1QACgYKAR8SARYSFQHGX2Mi9FkBlKv3anwP8McJ3zPnnhoVAUF8yKp4GG9a4Pu8vHbyDK9x6Kq80076
|
| 13 |
-
www.google.com FALSE / TRUE 1761430314 OTZ 8275572_84_88_104280_84_446940
|
| 14 |
-
myaccount.google.com FALSE / TRUE 1761430314 OTZ 8275572_84_88_104280_84_446940
|
| 15 |
-
.google.com TRUE / TRUE 1774643802 NID 525=S44Ayhu2zQxI7xIx8Iko-bNSFnGYJgvhPuH1_CEEzjuwwYLwWBO71xf4rT78-6_RtQF33VHKv54j0Ed0vlrEv5voya6AY7RDzc-9-kSPq7IoxCLj2mTBPh4fNHnYZLbAMvobmzSDFF-DUoQEEvXmHCNcT8O5IaupujfOkUlWpz4FGe02ZS1cEciaXMmRHkhfLaIeze99sV7er1ga4Pr6MFhue75GvWNPP22sHR1uKBmE-HFIA4SLIN1WdRgpydDb49rQf5GMkHuqou8tTGJCpn2uU1F_5Z90KIeOanHua0LqLseGTM1CTDmcZxmi1sLmfZKAJHjvvxvP8WdH_DoIzjOBpFnGqHwsyxni6oVI-nnfLCM1YOCcLh6YhN9KKYTfLjVbe7E5u5GF8BcyOGRM1lAN-tn_UE2Kvro9Yvo8aaZ4H6K1pCS6G6u5vFkGcaD5ZkSrl7h7fIX2aMQfpACweQDI4alqeDLrHeIBZa6NvxAfLPInCOYht8K5wbfuXzeNxjg6ZdJJOgxlUenj0LcwqGxPQuH6xD9wYnY_15ylRGO7aml6tN5DXlIliSupq4BjjWmi_G1ZmAu2SovaqK4EI5140Cn_yRTGAqxFsKjAwwvbvPN4LVsSzkntqXxTtHsyd3EEeZ8ilrJDw28LcCOXq2cpMp92nonqNMD5f1g4xCpI3g
|
| 16 |
-
.google.com TRUE / FALSE 1793398363 SID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWb3P7Glxmz-m4HcyPlQg7uAACgYKAc4SARYSFQHGX2Mi4HC3IarUc6cwi6eWrxcZYhoVAUF8yKrM9sQU7LUUTnyLnKXTVHEj0076
|
| 17 |
-
.google.com TRUE / TRUE 1793398363 __Secure-1PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWEE50ByH9BwoNp1X6j2fILwACgYKAfkSARYSFQHGX2Miu-QbHY6vZ62jdFnUoFqUQxoVAUF8yKpsK33IZZFqmIt2DM9bvLnV0076
|
| 18 |
-
.google.com TRUE / TRUE 1793398363 __Secure-3PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWmQK78enIirLrHwKsn4ltwwACgYKAb4SARYSFQHGX2Mic_AVFEuL-wu2pBWJtOMInxoVAUF8yKqRw6mMDC6qlw3QiSRZonoR0076
|
| 19 |
-
.google.com TRUE / FALSE 1793398363 HSID AbKscugyDehQ4x11d
|
| 20 |
-
.google.com TRUE / TRUE 1793398363 SSID AXofO_0tGdydzwaKk
|
| 21 |
-
.google.com TRUE / FALSE 1793398363 APISID Ss8TU_wEeCHk8Q69/A3w1fsmR2a0U4p0yS
|
| 22 |
-
.google.com TRUE / TRUE 1793398363 SAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 23 |
-
.google.com TRUE / TRUE 1793398363 __Secure-1PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 24 |
-
.google.com TRUE / TRUE 1793398363 __Secure-3PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 25 |
-
accounts.google.com FALSE / TRUE 1793398363 LSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gNYUcFrDcaekkCp4Xod3s0ewACgYKAfQSARYSFQHGX2MiEoB0CYbYwzMa9wThZ-3czBoVAUF8yKqp5ivNjD89iS_RNVn6nTRy0076
|
| 26 |
-
accounts.google.com FALSE / TRUE 1793398363 __Host-1PLSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gN5wBRb6MWVdmNHc20dOJGmwACgYKASISARYSFQHGX2Mi8JBvSyDGNWkYh7VRrDWp6BoVAUF8yKoc7TOD65jDsHs-2GMVHJtV0076
|
| 27 |
-
accounts.google.com FALSE / TRUE 1793398363 __Host-3PLSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gNbzWYfuXq66gU16zyTMGY-wACgYKAb0SARYSFQHGX2Mi7Xx3PzuWGZHCsgPe1MvOBhoVAUF8yKqyAXfrXMhbgYKIX6oY5B3a0076
|
| 28 |
-
accounts.google.com FALSE / TRUE 1793398363 ACCOUNT_CHOOSER AFx_qI6C9qGec1blJBDi9G27myTuo_xyYdzCPnaIp1pYCwAMEoQRbFZvmplbDSp_a7hFtd0UNTmU-KZ8O1K3hIa57DdnRJld85opvAexVKbcpuvR5m-3gR7llYZwhNUc7ant7modep0y13Pdqadsf8ub2vX8ilG1Yg
|
| 29 |
-
.youtube.com TRUE / FALSE 1793398363 HSID AquClUWKA6DQ2q9nI
|
| 30 |
-
.youtube.com TRUE / TRUE 1793398363 SSID AdzHxB-xBotM62eoR
|
| 31 |
-
.youtube.com TRUE / FALSE 1793398363 APISID Ss8TU_wEeCHk8Q69/A3w1fsmR2a0U4p0yS
|
| 32 |
-
.youtube.com TRUE / TRUE 1793398363 SAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 33 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-1PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 34 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-3PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 35 |
-
.youtube.com TRUE / FALSE 1793398363 SID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWb3P7Glxmz-m4HcyPlQg7uAACgYKAc4SARYSFQHGX2Mi4HC3IarUc6cwi6eWrxcZYhoVAUF8yKrM9sQU7LUUTnyLnKXTVHEj0076
|
| 36 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-1PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWEE50ByH9BwoNp1X6j2fILwACgYKAfkSARYSFQHGX2Miu-QbHY6vZ62jdFnUoFqUQxoVAUF8yKpsK33IZZFqmIt2DM9bvLnV0076
|
| 37 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-3PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWmQK78enIirLrHwKsn4ltwwACgYKAb4SARYSFQHGX2Mic_AVFEuL-wu2pBWJtOMInxoVAUF8yKqRw6mMDC6qlw3QiSRZonoR0076
|
| 38 |
-
.youtube.com TRUE / TRUE 1793398363 LOGIN_INFO AFmmF2swRQIhAIJ9AQkfSjHPGWpVzLeGS33F4-IO_03RnyyH3AhLIfhxAiBFtcbnDR1yS22_Rd-wXXmKcDOx3NCIsPYLL4k3LLh7SA:QUQ3MjNmenZQR0ZuU3JzYzNvemgtdW5PSXNfR2tXVTh3Q0g4YXgwa3VTTDhybFdjZ3VtYmlBcDl6OTc2dGt0aXY1U0FQUzBkd2luSTFDbm9uUTJiajFUT01iRjFodkVCbzljU19Ob3J3ZUdMMlJKQnhMM1h5eXJqQkp6WlJCTl9ydzhCajN6VVhRZktYR05FSlVrRlFFbHJ6TFhUeTZ1Z09n
|
| 39 |
-
.google.com TRUE / FALSE 1790374363 SIDCC AKEyXzUQWE0Y_vlBaw7mJh87E6IJW3NNF2PpfpCzYebpHHLUPrF8naRss-JeQW7DASQyTyBN
|
| 40 |
-
.google.com TRUE / TRUE 1790374363 __Secure-1PSIDCC AKEyXzV5pET6uT7uGGsuJfpWrLN2tL5IPtx7b_Cx79cu20Ib1blJ0EO-jJUeXEdJHDe2CyVE
|
| 41 |
-
.google.com TRUE / TRUE 1790374363 __Secure-3PSIDCC AKEyXzVjGYTRexD0RTMOClv_gqr7Bro-lr1EhJ7FNw-qrc25c6yitFkbE13_82MYmdHTsEQRWg
|
| 42 |
-
.youtube.com TRUE / TRUE 1790377038 __Secure-1PSIDTS sidts-CjUBmkD5SyS-MfSkahIWfSNvDvTGnoxuWCeS8o4zenzi66DdwImXj5z-xUqpm47EXP0nG8Yi8xAA
|
| 43 |
-
.youtube.com TRUE / TRUE 1790377038 __Secure-3PSIDTS sidts-CjUBmkD5SyS-MfSkahIWfSNvDvTGnoxuWCeS8o4zenzi66DdwImXj5z-xUqpm47EXP0nG8Yi8xAA
|
| 44 |
-
.youtube.com TRUE / FALSE 1790377149 SIDCC AKEyXzXtFWnkps9JKzvwxfeD91OCgQQhgDebKZP2upU1yvCDAgiiWKsdngyN_wkDwdvcjTIk
|
| 45 |
-
.youtube.com TRUE / TRUE 1790377149 __Secure-1PSIDCC AKEyXzWBPhbK5a9Rid1bTcAheQ6UmP2Ws6CJgXk3o2YPAEOcS08U0vAvzuTBLd5iJyxU_qQQ
|
| 46 |
-
.youtube.com TRUE / TRUE 1790377149 __Secure-3PSIDCC AKEyXzVKudOFZ9axpnesaDjWCayyAUId6aWpBj0qfOrOay_0O12iVgYcSF1Z6cZ1AQc5y-d5YA
|
| 47 |
-
.google.com TRUE /verify TRUE 1774643801 SNID ABablneQpL5nd50lg171XcyVs24gvpO4-3XC33KqvJzhOyKzSjsRCTu2WNs98YrIa4rthJXC9umV_gfOPujCE8rpvEpn3J6IGBQ
|
| 48 |
-
.youtube.com TRUE / TRUE 0 YSC QlLyIMoyoro
|
| 49 |
-
.youtube.com TRUE / TRUE 1774393149 VISITOR_INFO1_LIVE 0Io5PoZoNhQ
|
| 50 |
-
.youtube.com TRUE / TRUE 1774393149 VISITOR_PRIVACY_METADATA CgJVUxIEGgAgXw%3D%3D
|
| 51 |
-
.youtube.com TRUE / TRUE 1793401147 PREF f4=4000000&tz=America.Los_Angeles
|
| 52 |
-
.youtube.com TRUE / TRUE 1774384705 __Secure-ROLLOUT_TOKEN CJvi5d304cLkxQEQ952ItOL0jwMYxOPstOL0jwM%3D
|
| 53 |
-
accounts.google.com FALSE / TRUE 1761424715 OTZ 8275479_84_88_104280_84_446940
|
| 54 |
-
accounts.google.com FALSE / TRUE 1793392730 __Host-GAPS 1:yqAYuvXMLM6p418ku6ftwLAiw66lW5JDAUnpfgajBCLlPRefQ12FH4OpX-afmjZbWzdGaHl9_g2zQNGp0TzWzmv9LvMnGA:-kKVsK7giPvGw84Q
|
| 55 |
-
.google.com TRUE / TRUE 1774384731 AEC AaJma5tejBcPWOwI5osyzZtLbsylZCmSH2lz0zhEN1Q4WqoOtfvlBhXmMA
|
| 56 |
-
ogs.google.com FALSE / TRUE 1761424734 OTZ 8275479_84_88_104280_84_446940
|
| 57 |
-
myaccount.google.com FALSE / TRUE 1793398313 OSID g.a0001wjtWOu_WLZdXb5Jtdi-tk_TQCulwBmAfNO6NopkIFhHEeO0oDV7zmz7iijIbHt8FFlaFwACgYKAU8SARYSFQHGX2Mic1nR4MKxTRPME0LtDGY7ZhoVAUF8yKpfjouTWz97PA6bCvAoOqoA0076
|
| 58 |
-
myaccount.google.com FALSE / TRUE 1793398313 __Secure-OSID g.a0001wjtWOu_WLZdXb5Jtdi-tk_TQCulwBmAfNO6NopkIFhHEeO0iVJNUJbpqueptsN8uW4S1QACgYKAR8SARYSFQHGX2Mi9FkBlKv3anwP8McJ3zPnnhoVAUF8yKp4GG9a4Pu8vHbyDK9x6Kq80076
|
| 59 |
-
www.google.com FALSE / TRUE 1761430314 OTZ 8275572_84_88_104280_84_446940
|
| 60 |
-
myaccount.google.com FALSE / TRUE 1761430314 OTZ 8275572_84_88_104280_84_446940
|
| 61 |
-
.google.com TRUE / TRUE 1774643802 NID 525=S44Ayhu2zQxI7xIx8Iko-bNSFnGYJgvhPuH1_CEEzjuwwYLwWBO71xf4rT78-6_RtQF33VHKv54j0Ed0vlrEv5voya6AY7RDzc-9-kSPq7IoxCLj2mTBPh4fNHnYZLbAMvobmzSDFF-DUoQEEvXmHCNcT8O5IaupujfOkUlWpz4FGe02ZS1cEciaXMmRHkhfLaIeze99sV7er1ga4Pr6MFhue75GvWNPP22sHR1uKBmE-HFIA4SLIN1WdRgpydDb49rQf5GMkHuqou8tTGJCpn2uU1F_5Z90KIeOanHua0LqLseGTM1CTDmcZxmi1sLmfZKAJHjvvxvP8WdH_DoIzjOBpFnGqHwsyxni6oVI-nnfLCM1YOCcLh6YhN9KKYTfLjVbe7E5u5GF8BcyOGRM1lAN-tn_UE2Kvro9Yvo8aaZ4H6K1pCS6G6u5vFkGcaD5ZkSrl7h7fIX2aMQfpACweQDI4alqeDLrHeIBZa6NvxAfLPInCOYht8K5wbfuXzeNxjg6ZdJJOgxlUenj0LcwqGxPQuH6xD9wYnY_15ylRGO7aml6tN5DXlIliSupq4BjjWmi_G1ZmAu2SovaqK4EI5140Cn_yRTGAqxFsKjAwwvbvPN4LVsSzkntqXxTtHsyd3EEeZ8ilrJDw28LcCOXq2cpMp92nonqNMD5f1g4xCpI3g
|
| 62 |
-
.google.com TRUE / FALSE 1793398363 SID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWb3P7Glxmz-m4HcyPlQg7uAACgYKAc4SARYSFQHGX2Mi4HC3IarUc6cwi6eWrxcZYhoVAUF8yKrM9sQU7LUUTnyLnKXTVHEj0076
|
| 63 |
-
.google.com TRUE / TRUE 1793398363 __Secure-1PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWEE50ByH9BwoNp1X6j2fILwACgYKAfkSARYSFQHGX2Miu-QbHY6vZ62jdFnUoFqUQxoVAUF8yKpsK33IZZFqmIt2DM9bvLnV0076
|
| 64 |
-
.google.com TRUE / TRUE 1793398363 __Secure-3PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWmQK78enIirLrHwKsn4ltwwACgYKAb4SARYSFQHGX2Mic_AVFEuL-wu2pBWJtOMInxoVAUF8yKqRw6mMDC6qlw3QiSRZonoR0076
|
| 65 |
-
.google.com TRUE / FALSE 1793398363 HSID AbKscugyDehQ4x11d
|
| 66 |
-
.google.com TRUE / TRUE 1793398363 SSID AXofO_0tGdydzwaKk
|
| 67 |
-
.google.com TRUE / FALSE 1793398363 APISID Ss8TU_wEeCHk8Q69/A3w1fsmR2a0U4p0yS
|
| 68 |
-
.google.com TRUE / TRUE 1793398363 SAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 69 |
-
.google.com TRUE / TRUE 1793398363 __Secure-1PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 70 |
-
.google.com TRUE / TRUE 1793398363 __Secure-3PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 71 |
-
accounts.google.com FALSE / TRUE 1793398363 LSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gNYUcFrDcaekkCp4Xod3s0ewACgYKAfQSARYSFQHGX2MiEoB0CYbYwzMa9wThZ-3czBoVAUF8yKqp5ivNjD89iS_RNVn6nTRy0076
|
| 72 |
-
accounts.google.com FALSE / TRUE 1793398363 __Host-1PLSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gN5wBRb6MWVdmNHc20dOJGmwACgYKASISARYSFQHGX2Mi8JBvSyDGNWkYh7VRrDWp6BoVAUF8yKoc7TOD65jDsHs-2GMVHJtV0076
|
| 73 |
-
accounts.google.com FALSE / TRUE 1793398363 __Host-3PLSID s.youtube:g.a0001wjtWM78kwRPC2yEW8rCBcq56UpDGi2XCCoLWFwcdVdBG0gNbzWYfuXq66gU16zyTMGY-wACgYKAb0SARYSFQHGX2Mi7Xx3PzuWGZHCsgPe1MvOBhoVAUF8yKqyAXfrXMhbgYKIX6oY5B3a0076
|
| 74 |
-
accounts.google.com FALSE / TRUE 1793398363 ACCOUNT_CHOOSER AFx_qI6C9qGec1blJBDi9G27myTuo_xyYdzCPnaIp1pYCwAMEoQRbFZvmplbDSp_a7hFtd0UNTmU-KZ8O1K3hIa57DdnRJld85opvAexVKbcpuvR5m-3gR7llYZwhNUc7ant7modep0y13Pdqadsf8ub2vX8ilG1Yg
|
| 75 |
-
.youtube.com TRUE / FALSE 1793398363 HSID AquClUWKA6DQ2q9nI
|
| 76 |
-
.youtube.com TRUE / TRUE 1793398363 SSID AdzHxB-xBotM62eoR
|
| 77 |
-
.youtube.com TRUE / FALSE 1793398363 APISID Ss8TU_wEeCHk8Q69/A3w1fsmR2a0U4p0yS
|
| 78 |
-
.youtube.com TRUE / TRUE 1793398363 SAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 79 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-1PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 80 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-3PAPISID iyx0eDNDPNnUDXAQ/AswQaGvadwnOE1Hy7
|
| 81 |
-
.youtube.com TRUE / FALSE 1793398363 SID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWb3P7Glxmz-m4HcyPlQg7uAACgYKAc4SARYSFQHGX2Mi4HC3IarUc6cwi6eWrxcZYhoVAUF8yKrM9sQU7LUUTnyLnKXTVHEj0076
|
| 82 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-1PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWEE50ByH9BwoNp1X6j2fILwACgYKAfkSARYSFQHGX2Miu-QbHY6vZ62jdFnUoFqUQxoVAUF8yKpsK33IZZFqmIt2DM9bvLnV0076
|
| 83 |
-
.youtube.com TRUE / TRUE 1793398363 __Secure-3PSID g.a0001wjtWNYaPz-NmdpyuhJACpGXWFTO6a7bHODPmv0-k9I2GnWWmQK78enIirLrHwKsn4ltwwACgYKAb4SARYSFQHGX2Mic_AVFEuL-wu2pBWJtOMInxoVAUF8yKqRw6mMDC6qlw3QiSRZonoR0076
|
| 84 |
-
.youtube.com TRUE / TRUE 1793398363 LOGIN_INFO AFmmF2swRQIhAIJ9AQkfSjHPGWpVzLeGS33F4-IO_03RnyyH3AhLIfhxAiBFtcbnDR1yS22_Rd-wXXmKcDOx3NCIsPYLL4k3LLh7SA:QUQ3MjNmenZQR0ZuU3JzYzNvemgtdW5PSXNfR2tXVTh3Q0g4YXgwa3VTTDhybFdjZ3VtYmlBcDl6OTc2dGt0aXY1U0FQUzBkd2luSTFDbm9uUTJiajFUT01iRjFodkVCbzljU19Ob3J3ZUdMMlJKQnhMM1h5eXJqQkp6WlJCTl9ydzhCajN6VVhRZktYR05FSlVrRlFFbHJ6TFhUeTZ1Z09n
|
| 85 |
-
.google.com TRUE / FALSE 1790374363 SIDCC AKEyXzUQWE0Y_vlBaw7mJh87E6IJW3NNF2PpfpCzYebpHHLUPrF8naRss-JeQW7DASQyTyBN
|
| 86 |
-
.google.com TRUE / TRUE 1790374363 __Secure-1PSIDCC AKEyXzV5pET6uT7uGGsuJfpWrLN2tL5IPtx7b_Cx79cu20Ib1blJ0EO-jJUeXEdJHDe2CyVE
|
| 87 |
-
.google.com TRUE / TRUE 1790374363 __Secure-3PSIDCC AKEyXzVjGYTRexD0RTMOClv_gqr7Bro-lr1EhJ7FNw-qrc25c6yitFkbE13_82MYmdHTsEQRWg
|
| 88 |
-
.doubleclick.net TRUE / TRUE 1774390365 APC AfxxVi4PoPaa_4bcRFWe3s7UAqKd77-pb40Xtnkg9fz_z_K9Jaqxwg
|
| 89 |
-
.doubleclick.net TRUE / TRUE 1774390365 receive-cookie-deprecation 1
|
| 90 |
-
.youtube.com TRUE / TRUE 1790377038 __Secure-1PSIDTS sidts-CjUBmkD5SyS-MfSkahIWfSNvDvTGnoxuWCeS8o4zenzi66DdwImXj5z-xUqpm47EXP0nG8Yi8xAA
|
| 91 |
-
.youtube.com TRUE / TRUE 1790377038 __Secure-3PSIDTS sidts-CjUBmkD5SyS-MfSkahIWfSNvDvTGnoxuWCeS8o4zenzi66DdwImXj5z-xUqpm47EXP0nG8Yi8xAA
|
| 92 |
-
.youtube.com TRUE / FALSE 1790377149 SIDCC AKEyXzXtFWnkps9JKzvwxfeD91OCgQQhgDebKZP2upU1yvCDAgiiWKsdngyN_wkDwdvcjTIk
|
| 93 |
-
.youtube.com TRUE / TRUE 1790377149 __Secure-1PSIDCC AKEyXzWBPhbK5a9Rid1bTcAheQ6UmP2Ws6CJgXk3o2YPAEOcS08U0vAvzuTBLd5iJyxU_qQQ
|
| 94 |
-
.youtube.com TRUE / TRUE 1790377149 __Secure-3PSIDCC AKEyXzVKudOFZ9axpnesaDjWCayyAUId6aWpBj0qfOrOay_0O12iVgYcSF1Z6cZ1AQc5y-d5YA
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/utils/probeytdlp.py
DELETED
|
@@ -1,54 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env python3
|
| 2 |
-
import yt_dlp, traceback, sys, os
|
| 3 |
-
from http.cookiejar import MozillaCookieJar
|
| 4 |
-
|
| 5 |
-
class YDLLogger:
|
| 6 |
-
def debug(self, msg): print("[DEBUG]", msg)
|
| 7 |
-
def warning(self, msg): print("[WARN]", msg)
|
| 8 |
-
def error(self, msg): print("[ERROR]", msg)
|
| 9 |
-
|
| 10 |
-
def probe(url, cookies=None):
|
| 11 |
-
ydl_opts = {
|
| 12 |
-
"format": "bestaudio/best",
|
| 13 |
-
"cachedir": False,
|
| 14 |
-
"logger": YDLLogger(),
|
| 15 |
-
"no_warnings": False,
|
| 16 |
-
"quiet": False,
|
| 17 |
-
# don't try postprocessing during probe
|
| 18 |
-
"postprocessors": [],
|
| 19 |
-
# helpful to mimic a browser if site is picky:
|
| 20 |
-
"http_headers": {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120 Safari/537.36"},
|
| 21 |
-
}
|
| 22 |
-
if cookies:
|
| 23 |
-
ydl_opts["cookiefile"] = cookies
|
| 24 |
-
|
| 25 |
-
try:
|
| 26 |
-
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 27 |
-
print("Probing (no download)...")
|
| 28 |
-
info = ydl.extract_info(url, download=False)
|
| 29 |
-
print("Top-level keys in info:", list(info.keys()))
|
| 30 |
-
formats = info.get("formats")
|
| 31 |
-
if formats:
|
| 32 |
-
print("Found formats (count):", len(formats))
|
| 33 |
-
for f in formats[:10]:
|
| 34 |
-
print(f" - id={f.get('format_id')}, ext={f.get('ext')}, abr={f.get('abr')}, vbr={f.get('vbr')}, note={f.get('format_note')}")
|
| 35 |
-
else:
|
| 36 |
-
print("No formats found. Inspecting other info fields:")
|
| 37 |
-
for k in ("webpage_url", "extractor", "requested_formats", "is_live", "entries"):
|
| 38 |
-
print(f" {k}: {info.get(k)}")
|
| 39 |
-
return info
|
| 40 |
-
except Exception as e:
|
| 41 |
-
print("EXCEPTION during probe:")
|
| 42 |
-
traceback.print_exc()
|
| 43 |
-
# also dump any HTML/diagnostic text if available in exception text
|
| 44 |
-
print("Exception message:", str(e))
|
| 45 |
-
|
| 46 |
-
if __name__ == "__main__":
|
| 47 |
-
cookies = None
|
| 48 |
-
if len(sys.argv) > 1:
|
| 49 |
-
cookies = sys.argv[1]
|
| 50 |
-
if not os.path.isfile(cookies):
|
| 51 |
-
print(f"Cookie file '{cookies}' not found.")
|
| 52 |
-
sys.exit(1)
|
| 53 |
-
url = "https://www.youtube.com/watch?v=wDchsz8nmbo"
|
| 54 |
-
probe(url, cookies)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/utils/retrieve_filepath.py
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
def retrieve_file_path(file_name):
|
| 3 |
-
path = os.path.dirname(os.path.abspath(__file__))
|
| 4 |
-
file_path = os.path.join(path, file_name)
|
| 5 |
-
if os.path.isfile(file_path):
|
| 6 |
-
return file_path
|
| 7 |
-
elif not os.path.exists(file_path):
|
| 8 |
-
print(f"'{file_path}' does not exist.")
|
| 9 |
-
return None
|
| 10 |
-
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/utils/storage.py
DELETED
|
@@ -1,42 +0,0 @@
|
|
| 1 |
-
from dotenv import load_dotenv
|
| 2 |
-
import os, uuid
|
| 3 |
-
from datetime import datetime, timedelta, timezone
|
| 4 |
-
from azure.identity import ManagedIdentityCredential, DefaultAzureCredential
|
| 5 |
-
from azure.storage.blob import (
|
| 6 |
-
BlobServiceClient, generate_blob_sas, BlobSasPermissions
|
| 7 |
-
)
|
| 8 |
-
|
| 9 |
-
load_dotenv()
|
| 10 |
-
ACCOUNT_NAME = os.getenv("AZURE_STORAGE_ACCOUNT")
|
| 11 |
-
CONTAINER = os.getenv("AZURE_BLOB_CONTAINER")
|
| 12 |
-
|
| 13 |
-
# Use Managed Identity in Azure; locally DefaultAzureCredential also works
|
| 14 |
-
def _credential():
|
| 15 |
-
# Tries MI in Azure; falls back to developer creds locally
|
| 16 |
-
return DefaultAzureCredential(exclude_interactive_browser_credential=False)
|
| 17 |
-
|
| 18 |
-
def _svc_client():
|
| 19 |
-
url = f"https://{ACCOUNT_NAME}.blob.core.windows.net"
|
| 20 |
-
return BlobServiceClient(account_url=url, credential=_credential())
|
| 21 |
-
|
| 22 |
-
def upload_and_sign(local_path: str, ttl_minutes: int = 45) -> str:
|
| 23 |
-
svc = _svc_client()
|
| 24 |
-
name = f"{uuid.uuid4()}/{os.path.basename(local_path)}"
|
| 25 |
-
blob = svc.get_blob_client(container=CONTAINER, blob=name)
|
| 26 |
-
with open(local_path, "rb") as f:
|
| 27 |
-
blob.upload_blob(f, overwrite=True, content_type="audio/wav")
|
| 28 |
-
|
| 29 |
-
# Get User Delegation Key (no account key needed)
|
| 30 |
-
udk = svc.get_user_delegation_key(
|
| 31 |
-
key_start_time=datetime.now(timezone.utc) - timedelta(minutes=5),
|
| 32 |
-
key_expiry_time=datetime.now(timezone.utc) + timedelta(hours=2),
|
| 33 |
-
)
|
| 34 |
-
sas = generate_blob_sas(
|
| 35 |
-
account_name=ACCOUNT_NAME,
|
| 36 |
-
container_name=CONTAINER,
|
| 37 |
-
blob_name=name,
|
| 38 |
-
user_delegation_key=udk,
|
| 39 |
-
permission=BlobSasPermissions(read=True),
|
| 40 |
-
expiry=datetime.now(timezone.utc) + timedelta(minutes=ttl_minutes),
|
| 41 |
-
)
|
| 42 |
-
return f"{blob.url}?{sas}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|