Skip to content

Commit

Permalink
Use compute_descriptions function from zimscraperlib to set descripti…
Browse files Browse the repository at this point in the history
…on and long_description
  • Loading branch information
dan-niles committed May 18, 2024
1 parent 57516d5 commit c7aebdd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/youtube2zim/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from zimscraperlib.image.presets import WebpHigh
from zimscraperlib.image.probing import get_colors, is_hex_color
from zimscraperlib.image.transformation import resize_image
from zimscraperlib.inputs import compute_descriptions
from zimscraperlib.video.presets import VideoMp4Low, VideoWebmLow
from zimscraperlib.zim import make_zim_file
from zimscraperlib.zim.metadata import (
Expand Down Expand Up @@ -820,9 +821,13 @@ def update_metadata(self):
clean_text(self.playlists[0].description)
if self.is_playlist and len(self.playlists) == 1
else clean_text(main_channel_json["snippet"]["description"])
)
) or "-"
self.title = self.title or auto_title or "-"
self.description = self.description or auto_description or "-"
self.description, self.long_description = compute_descriptions(
default_description=auto_description,
user_description=self.description,
user_long_description=self.long_description,
)

if self.creator is None:
if self.is_single_channel:
Expand Down

0 comments on commit c7aebdd

Please sign in to comment.