From f5446d90936f6f6efc2b5b663057a83efcc4986a Mon Sep 17 00:00:00 2001 From: "Jon Michael Aanes (aider)" Date: Sat, 15 Mar 2025 22:34:31 +0100 Subject: [PATCH] feat: Add YouTube authentication to secrets and update scraper usage --- personal_data/fetchers/youtube.py | 2 ++ personal_data/secrets.py | 1 + 2 files changed, 3 insertions(+) diff --git a/personal_data/fetchers/youtube.py b/personal_data/fetchers/youtube.py index 2c0dc50..ee1071e 100644 --- a/personal_data/fetchers/youtube.py +++ b/personal_data/fetchers/youtube.py @@ -5,6 +5,7 @@ import subprocess from dataclasses import dataclass from personal_data.data import DeduplicateMode, Scraper +from personal_data.secrets import YOUTUBE_AUTH from ..util import safe_del @@ -20,6 +21,7 @@ def scrape(watch_history: bool) -> list[dict[str, str]]: ytdlp_args = [ 'yt-dlp', '--dump-json', + '--cookies', YOUTUBE_AUTH, url, ] else: diff --git a/personal_data/secrets.py b/personal_data/secrets.py index d099911..a9ff6c3 100644 --- a/personal_data/secrets.py +++ b/personal_data/secrets.py @@ -71,3 +71,4 @@ JELLYFIN_PASSWORD = secrets.load('JELLYFIN_PASSWORD') WITHINGS_CLIENTID = secrets.load('WITHINGS_CLIENTID') WITHINGS_SECRET = secrets.load('WITHINGS_SECRET') WITHINGS_CALLBACK_URI = secrets.load('WITHINGS_CALLBACK_URI') +YOUTUBE_AUTH = secrets.load('YOUTUBE_AUTH')