From 4a61b6796943bb9fe8d969001260b6ed3fe7ddb4 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Mon, 9 Oct 2023 08:55:35 +0000 Subject: [PATCH] Fixed #178: convert local file medias to Path before use --- CHANGELOG | 6 ++++++ youtube2zim/scraper.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 6adaa64e..d3b5ee4f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,12 @@ All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (as of version 2.1.15). +## [Unreleased] + +### Changed + +- Fixed local path media (profile, banner) not working (#178) + ## [2.1.18] - 2022-11-09 ### Changed diff --git a/youtube2zim/scraper.py b/youtube2zim/scraper.py index 46af7ea3..c82c4dbd 100644 --- a/youtube2zim/scraper.py +++ b/youtube2zim/scraper.py @@ -422,6 +422,7 @@ def check_branding_values(self): if self.profile_image.startswith("http"): stream_file(self.profile_image, self.profile_path) else: + self.profile_image = Path(self.profile_image) if not self.profile_image.exists(): raise IOError( f"--profile image could not be found: {self.profile_image}" @@ -432,6 +433,7 @@ def check_branding_values(self): if self.banner_image.startswith("http"): stream_file(self.banner_image, self.banner_path) else: + self.banner_image = Path(self.banner_image) if not self.banner_image.exists(): raise IOError( f"--banner image could not be found: {self.banner_image}"