Skip to content

Commit

Permalink
change message on missing language data for video
Browse files Browse the repository at this point in the history
  • Loading branch information
elfkuzco committed Sep 23, 2024
1 parent f976226 commit b802aaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Change log level of "Video at {url} has not yet been translated into {requested_lang_code}" messages from warning to debug (way too verbose)
- Disable preloading of subtitles in video.js
- Change warning message when language data is missing from video (#216)

### Fixed

Expand Down
7 changes: 5 additions & 2 deletions src/ted2zim/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,11 @@ def get_lang_code_and_name(self, json_data):
for lang in player_data["languages"]
if lang["languageCode"] == lang_code
][-1]
except Exception as exc:
logger.warning(f"player data has no entry for {lang_code}: {exc}")
except Exception:
logger.warning(

Check warning on line 711 in src/ted2zim/scraper.py

View check run for this annotation

Codecov / codecov/patch

src/ted2zim/scraper.py#L710-L711

Added lines #L710 - L711 were not covered by tests
f"Video at {json_data.get('canonicalUrl')} "
f"has no subtitle/language data in {lang_code}"
)
lang_name = lang_code

return lang_code, lang_name
Expand Down

0 comments on commit b802aaf

Please sign in to comment.