Skip to content

Commit

Permalink
Skip subscriber_only videos
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Nov 2, 2024
1 parent 9048924 commit 283617b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tafrigh"
version = "1.7.0"
version = "1.7.1"
description = "تفريغ النصوص وإنشاء ملفات SRT و VTT باستخدام نماذج Whisper وتقنية wit.ai."
authors = ["EasyBooks <[email protected]>"]
license = "MIT"
Expand Down
8 changes: 7 additions & 1 deletion tafrigh/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def process_url(
elements = list(filter(lambda element: element, elements))

for idx, element in enumerate(tqdm(elements, desc='URL elements')):
if element['title'] == '[Private video]' or element['title'] == '[Deleted video]':
if should_skip(element):
continue

new_progress_info = progress_info.copy()
Expand Down Expand Up @@ -285,3 +285,9 @@ def write_output_sample(segments: list[SegmentType], output: Config.Output) -> N
'url': segment['url'],
'file_path': segment['file_path'],
})


def should_skip(element: dict[str, Any]) -> bool:
return (element['title'] == '[Private video]' or
element['title'] == '[Deleted video]' or
element['availability'] == 'subscriber_only')

0 comments on commit 283617b

Please sign in to comment.