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

Configs for user/topic filters and folder/file format #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions config_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
# R"############",
]

# If True, topics that partially match your topic filters are downloaded. If False, only meetings with exact topic matches are downloaded.
PARTIAL_MATCH_TOPICS = False

# Put here the file types you wish to download. If empty, no file type filtering will happen.
RECORDING_FILE_TYPES = [
# R"MP4", # Video file of the recording.
Expand Down
14 changes: 12 additions & 2 deletions zoom_batch_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def main():

print_filter_warnings()

if CONFIG.PARTIAL_MATCH_TOPICS:
CONFIG.TOPICS = [topic.lower() for topic in CONFIG.TOPICS]

from_date = datetime.datetime(CONFIG.START_YEAR, CONFIG.START_MONTH, CONFIG.START_DAY or 1)
to_date = datetime.datetime(
CONFIG.END_YEAR, CONFIG.END_MONTH, CONFIG.END_DAY or monthrange(CONFIG.END_YEAR, CONFIG.END_MONTH)[1],
Expand Down Expand Up @@ -211,8 +214,15 @@ def download_recordings_from_meetings(meetings, host_folder):
file_count, total_size, skipped_count = 0, 0, 0

for meeting in meetings:
if CONFIG.TOPICS and meeting['topic'] not in CONFIG.TOPICS and utils.slugify(meeting['topic']) not in CONFIG.TOPICS:
continue
if CONFIG.TOPICS and meeting['topic']:
if CONFIG.PARTIAL_MATCH_TOPICS:
topic_lower = str.lower(meeting['topic'])
topic_lower_slug = utils.slugify(meeting['topic'])
Comment on lines +217 to +218
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put outside the if statement

if not any(topic in topic_lower for topic in CONFIG.TOPICS) and not any(topic in topic_lower_slug for topic in CONFIG.TOPICS):
continue
else:
if meeting['topic'] not in CONFIG.TOPICS and utils.slugify(meeting['topic']) not in CONFIG.TOPICS:
continue

recording_files = meeting.get('recording_files') or []
participant_audio_files = meeting.get('participant_audio_files') or [] if CONFIG.INCLUDE_PARTICIPANT_AUDIO else []
Expand Down