diff --git a/tubearchivist/api/src/search_processor.py b/tubearchivist/api/src/search_processor.py index 7b594f6a..e9b4d241 100644 --- a/tubearchivist/api/src/search_processor.py +++ b/tubearchivist/api/src/search_processor.py @@ -64,7 +64,7 @@ class SearchProcess: "channel_last_refresh": date_str, "channel_banner_url": f"{art_base}_banner.jpg", "channel_thumb_url": f"{art_base}_thumb.jpg", - "channel_tvart_url": False, + "channel_tvart_url": f"{art_base}_tvart.jpg", } ) diff --git a/tubearchivist/home/src/download/thumbnails.py b/tubearchivist/home/src/download/thumbnails.py index ab4743e8..d7a61e22 100644 --- a/tubearchivist/home/src/download/thumbnails.py +++ b/tubearchivist/home/src/download/thumbnails.py @@ -81,6 +81,9 @@ class ThumbManagerBase: "banner": os.path.join( app_root, "static/img/default-channel-banner.jpg" ), + "art": os.path.join( + app_root, "static/img/default-channel-art.jpg" + ), } img_raw = Image.open(default_map[self.item_type]) @@ -149,9 +152,10 @@ class ThumbManager(ThumbManagerBase): def download_channel_art(self, urls, skip_existing=False): """pass tuple of channel thumbnails""" - channel_thumb, channel_banner = urls + channel_thumb, channel_banner, channel_tv = urls self._download_channel_thumb(channel_thumb, skip_existing) self._download_channel_banner(channel_banner, skip_existing) + self._download_channel_tv(channel_tv, skip_existing) def _download_channel_thumb(self, channel_thumb, skip_existing): """download channel thumbnail""" @@ -180,6 +184,16 @@ class ThumbManager(ThumbManagerBase): img_raw = self.download_raw(channel_banner) img_raw.convert("RGB").save(banner_path) + def _download_channel_tv(self, channel_tv, skip_existing): + """download channel tv art""" + art_path = os.path.join(self.CHANNEL_DIR, self.item_id + "_tvart.jpg") + self.item_type = "tvart" + if skip_existing and os.path.exists(art_path): + return + + img_raw = self.download_raw(channel_tv) + img_raw.convert("RGB").save(art_path) + def download_playlist_thumb(self, url, skip_existing=False): """pass thumbnail url""" thumb_path = os.path.join(self.PLAYLIST_DIR, f"{self.item_id}.jpg") diff --git a/tubearchivist/home/src/index/channel.py b/tubearchivist/home/src/index/channel.py index 5c90fa68..84b1add2 100644 --- a/tubearchivist/home/src/index/channel.py +++ b/tubearchivist/home/src/index/channel.py @@ -240,6 +240,7 @@ class YoutubeChannel(YouTubeItem): urls = ( self.json_data["channel_thumb_url"], self.json_data["channel_banner_url"], + self.json_data["channel_tvart_url"], ) ThumbManager(self.youtube_id, item_type="channel").download(urls) diff --git a/tubearchivist/requirements.txt b/tubearchivist/requirements.txt index 01c75c3a..5d25327f 100644 --- a/tubearchivist/requirements.txt +++ b/tubearchivist/requirements.txt @@ -1,11 +1,11 @@ beautifulsoup4==4.12.0 celery==5.2.7 -Django==4.1.7 -django-auth-ldap==4.1.0 +Django==4.2 +django-auth-ldap==4.2.0 django-cors-headers==3.14.0 djangorestframework==3.14.0 -Pillow==9.4.0 -redis==4.5.3 +Pillow==9.5.0 +redis==4.5.4 requests==2.28.2 ryd-client==0.0.6 uWSGI==2.0.21 diff --git a/tubearchivist/static/img/default-channel-art.jpg b/tubearchivist/static/img/default-channel-art.jpg new file mode 100644 index 00000000..45a4b000 Binary files /dev/null and b/tubearchivist/static/img/default-channel-art.jpg differ