Fix: Hard override PIP_INDEX_URL env var to ignore local pip config

This commit is contained in:
Your Name 2026-01-01 14:02:19 +07:00
parent 9e96869f8d
commit 66bccae7e2

View file

@ -23,11 +23,17 @@ async def update_ytdlp(background_tasks: BackgroundTasks):
try:
# Run pip install to upgrade yt-dlp to master
logger.info("Starting yt-dlp update...")
# Force PyPI index via environment variable to override global config
env = os.environ.copy()
env["PIP_INDEX_URL"] = "https://pypi.org/simple"
process = subprocess.run(
[sys.executable, "-m", "pip", "install", "--upgrade", "--force-reinstall", "--index-url", "https://pypi.org/simple", "git+https://github.com/yt-dlp/yt-dlp.git@master"],
[sys.executable, "-m", "pip", "install", "--upgrade", "--force-reinstall", "git+https://github.com/yt-dlp/yt-dlp.git@master"],
capture_output=True,
text=True,
check=True
check=True,
env=env
)
logger.info(f"Update Output: {process.stdout}")
@ -46,11 +52,17 @@ async def update_ytdlp(background_tasks: BackgroundTasks):
async def update_spotdl(background_tasks: BackgroundTasks):
try:
logger.info("Starting spotdl update...")
# Force PyPI index via environment variable
env = os.environ.copy()
env["PIP_INDEX_URL"] = "https://pypi.org/simple"
process = subprocess.run(
[sys.executable, "-m", "pip", "install", "--upgrade", "--index-url", "https://pypi.org/simple", "spotdl"],
[sys.executable, "-m", "pip", "install", "--upgrade", "spotdl"],
capture_output=True,
text=True,
check=True
check=True,
env=env
)
logger.info(f"Update Output: {process.stdout}")