diff --git a/brozzler/ydl.py b/brozzler/ydl.py index 65f1902..9329b8d 100644 --- a/brozzler/ydl.py +++ b/brozzler/ydl.py @@ -17,7 +17,7 @@ limitations under the License. ''' import logging -import yt_dlp as youtube_dl +import yt_dlp from yt_dlp.utils import match_filter_func import brozzler import urllib.request @@ -93,7 +93,7 @@ def final_bounces(fetches, url): def _build_youtube_dl(worker, destdir, site, page): ''' - Builds a yt-dlp `youtube_dl.YoutubeDL` for brozzling `site` with `worker`. + Builds a yt-dlp `yt_dlp.YoutubeDL` for brozzling `site` with `worker`. The `YoutubeDL` instance does a few special brozzler-specific things: @@ -108,20 +108,12 @@ def _build_youtube_dl(worker, destdir, site, page): site (brozzler.Site): the site we are brozzling Returns: - a yt-dlp `youtube_dl.YoutubeDL` instance + a yt-dlp `yt_dlp.YoutubeDL` instance ''' - class _YoutubeDL(youtube_dl.YoutubeDL): + class _YoutubeDL(yt_dlp.YoutubeDL): logger = logging.getLogger(__module__ + "." + __qualname__) - def urlopen(self, req): - try: - url = req.full_url - except AttributeError: - url = req - self.logger.debug('fetching %r', url) - return super().urlopen(req) - def add_default_extra_info(self, ie_result, ie, url): # hook in some logging super().add_default_extra_info(ie_result, ie, url) @@ -260,8 +252,8 @@ def _build_youtube_dl(worker, destdir, site, page): # this looked like a problem with nsf-mounted homedir, shouldn't be a problem for brozzler on focal? "cache_dir": "/home/archiveit", - "logger": logging.getLogger("youtube_dl"), - "verbose": True, + "logger": logging.getLogger("yt_dlp"), + "verbose": False, "quiet": False, }