Skip to content

Commit

Permalink
Merge pull request #197 from openzim/fix_logs
Browse files Browse the repository at this point in the history
Missing translation is not an error, only a warning
  • Loading branch information
benoit74 authored May 14, 2024
2 parents 9604922 + c7142c9 commit 4824b80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Change log level from ERROR to WARNING for missing translations (#197)

## [3.0.0] - 2024-04-19

### Added
Expand Down
5 changes: 3 additions & 2 deletions src/ted2zim/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,9 @@ def extract_info_from_video_page(

requested_lang_code = self.get_lang_code_from_url(url)
if requested_lang_code and json_data["language"] != requested_lang_code:
logger.error(
f"Video has not yet been translated into {requested_lang_code}"
logger.warning(
f"Video at {url} has not yet been translated into "
f"{requested_lang_code}"
)
return None
# Desrialize the data at json_data["playerData"] into a dict
Expand Down

0 comments on commit 4824b80

Please sign in to comment.