Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change message on missing language data for video #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading