clearcaption 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clearcaption
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: YouTube transcripts that work from cloud servers (AWS, GCP, Colab): drop-in fallback for youtube-transcript-api, with timestamped translation.
5
5
  Author-email: ClearCaption <21karrat@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clearcaption
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: YouTube transcripts that work from cloud servers (AWS, GCP, Colab): drop-in fallback for youtube-transcript-api, with timestamped translation.
5
5
  Author-email: ClearCaption <21karrat@gmail.com>
6
6
  License-Expression: MIT
@@ -44,7 +44,10 @@ def fetch_many(videos, translate_to=None, token=None, timeout=300):
44
44
  out[vid] = TranscriptError(item.get("status"))
45
45
  continue
46
46
  tr = item.get("translation") or {}
47
- out[vid] = _segments(tr.get("segments") if translate_to and tr.get("segments") else item.get("segments"))
47
+ if translate_to and not tr.get("segments"):
48
+ out[vid] = TranscriptError(f"translation to {translate_to!r} is unavailable")
49
+ continue
50
+ out[vid] = _segments(tr.get("segments") if translate_to else item.get("segments"))
48
51
  return out
49
52
 
50
53
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "clearcaption"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "YouTube transcripts that work from cloud servers (AWS, GCP, Colab): drop-in fallback for youtube-transcript-api, with timestamped translation."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes