Configs for user/topic filters and folder/file format#25
Configs for user/topic filters and folder/file format#25PancakeTornado wants to merge 4 commits intolanec:masterfrom
Conversation
…y exact topic matches are downloaded.
…rachy. Added config to define the recording file name format.
AnessZurba
left a comment
There was a problem hiding this comment.
Looking Great! Thanks for your contribution!
Some changes that I think are worth doing before merging
| # 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"####@####.####", | ||
| ] |
There was a problem hiding this comment.
The logic here isn't clear to me from the docs, What gets precedence?
| # 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 |
There was a problem hiding this comment.
pls revert the added spaces
| 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}>') |
There was a problem hiding this comment.
I would just run a filter on the list, then print it as is
| topic_lower = str.lower(meeting['topic']) | ||
| topic_lower_slug = utils.slugify(meeting['topic']) |
There was a problem hiding this comment.
put outside the if statement
| 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)}") |
There was a problem hiding this comment.
This isn't the number of recordings
it's more complicated than that
| 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 = [ |
There was a problem hiding this comment.
GROUP_BY or FOLDER_HEIRARCHY
| # 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 | ||
| ] |
There was a problem hiding this comment.
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...
| file_name = utils.slugify( | ||
| f'{recording_name}__{recording_type_suffix}{file_name_suffix}{file_id[-8:]}' | ||
| ) + '.' + ext | ||
| recording_name = utils.slugify(f'{topic}') |
| 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) |
There was a problem hiding this comment.
I would call this outside this method
There was a problem hiding this comment.
no need to pass all these parameters to the download method
| if group_by == "TOPIC": | ||
| folder_path = os.path.join(folder_path, topic) | ||
|
|
||
| if CONFIG.GROUP_BY_RECORDING: |
There was a problem hiding this comment.
why is this still here?
There was a problem hiding this comment.
It should be part of your grouping mechanism, no?
Added new configs to: