Skip to content

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

Open
PancakeTornado wants to merge 4 commits intolanec:masterfrom
PancakeTornado:pancakes/main
Open

Configs for user/topic filters and folder/file format#25
PancakeTornado wants to merge 4 commits intolanec:masterfrom
PancakeTornado:pancakes/main

Conversation

@PancakeTornado
Copy link
Copy Markdown

Added new configs to:

  • Allow excluding users from search
  • Allow partial matches of topic filters
  • Allow to group recordings by year-month folders
  • Control group folder hierarchy pattern
  • Control recording file name pattern

Copy link
Copy Markdown
Collaborator

@AnessZurba AnessZurba left a comment

Choose a reason for hiding this comment

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

Looking Great! Thanks for your contribution!

Some changes that I think are worth doing before merging

Comment thread config_template.py
Comment on lines 14 to 23
# Put here emails of the users you want to check for recordings. If empty, all users under the account will be checked.
USERS = [
USERS_INCLUDE = [
# R"####@####.####",
# R"####@####.####",
]

# Put here emails of the users you want to exclude from checking for recordings. Optional.
USERS_EXCLUDE = [
# R"####@####.####",
# R"####@####.####",
]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The logic here isn't clear to me from the docs, What gets precedence?

Comment thread config_template.py
# Date range (inclusive) for downloads, None value for Days gets replaced by first/last day of the month.
START_DAY, START_MONTH, START_YEAR = None, 5, 2020
END_DAY, END_MONTH, END_YEAR = None , 3, 2022
END_DAY, END_MONTH, END_YEAR = None, 3, 2022
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pls revert the added spaces

Comment thread zoom_batch_downloader.py
Comment on lines +66 to +75
if CONFIG.VERBOSE_OUTPUT:
utils.print_dim('Found matching users:')

for user_email, user_name in users:
if user_email in CONFIG.USERS_EXCLUDE:
users.pop(users.index((user_email, user_name)))
continue

if CONFIG.VERBOSE_OUTPUT:
utils.print_dim(f'{user_name} <{user_email}>')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would just run a filter on the list, then print it as is

Comment thread zoom_batch_downloader.py
Comment on lines +219 to +220
topic_lower = str.lower(meeting['topic'])
topic_lower_slug = utils.slugify(meeting['topic'])
Copy link
Copy Markdown
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

Comment thread zoom_batch_downloader.py
url = f'https://api.zoom.us/v2/meetings/{utils.double_encode(meeting_uuid)}/recordings'
meetings.append(get_with_token(lambda t: requests.get(url=url, headers=get_headers(t))).json())

utils.print_dim(f"Recordings found: {len(meetings)}")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This isn't the number of recordings
it's more complicated than that

Comment thread config_template.py
GROUP_BY_TOPIC = True
# Group records in a folder hierarchy using the order below.
# Reorder or comment out any of the folder groups below to control the folder hierarchy created to orgainze the downloaded recording files.
GROUP_FOLDERS_BY = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

GROUP_BY or FOLDER_HEIRARCHY

Comment thread config_template.py
Comment on lines +60 to +67
# Recording file name format to use when saving files. Reorder or comment out any file name format pieces below to control the file naming pattern.
# Example: 2023-12-25t143021z__name-of-the-meeting__audio_transcript__ff625374.VTT
FILE_NAME_FORMAT = [
R"RECORDING_START_DATETIME", # Recording start datetime
R"RECORDING_NAME", # Recording name
R"RECORDING_TYPE", # Recoding type
R"FILE_ID", # Recording unique file ID
]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a bit problematic
I use the file_id in the end to detect already downloaded file. I don't think it's a good idea to let users remove it...

Comment thread zoom_batch_downloader.py
file_name = utils.slugify(
f'{recording_name}__{recording_type_suffix}{file_name_suffix}{file_id[-8:]}'
) + '.' + ext
recording_name = utils.slugify(f'{topic}')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utils.slugify(topic)

Comment thread zoom_batch_downloader.py
return file_name

def download_recording_file(download_url, host_folder, file_name, file_size, topic, recording_name, recording_start, user_email):
folder_path = create_folder_path(host_folder, topic, recording_name, recording_start, user_email)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would call this outside this method

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

no need to pass all these parameters to the download method

Comment thread zoom_batch_downloader.py
if group_by == "TOPIC":
folder_path = os.path.join(folder_path, topic)

if CONFIG.GROUP_BY_RECORDING:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why is this still here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It should be part of your grouping mechanism, no?

@AnessZurba AnessZurba self-assigned this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants