-
Notifications
You must be signed in to change notification settings - Fork 20
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
PancakeTornado
wants to merge
4
commits into
lanec:master
Choose a base branch
from
PancakeTornado:pancakes/main
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
63fc1fd
Added config option to exclude users from search
PancakeTornado db82b83
Added config to allow partial matches of topic filters, otherwise onl…
PancakeTornado d96f662
Print the number of meetings and recordings found to the console.
PancakeTornado 0cec807
Added config to group recordings by year-month and control folder hie…
PancakeTornado File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.venv | ||
.venv | ||
config.py | ||
__pycache__ | ||
.DS_Store | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,16 @@ | |
|
||
# 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 | ||
|
||
# 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"####@####.####", | ||
] | ||
Comment on lines
-14
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,11 @@ def print_filter_warnings(): | |
if CONFIG.TOPICS: | ||
utils.print_bright(f'Topics filter is active {CONFIG.TOPICS}') | ||
did_print = True | ||
if CONFIG.USERS: | ||
utils.print_bright(f'Users filter is active {CONFIG.USERS}') | ||
if CONFIG.USERS_INCLUDE: | ||
utils.print_bright(f'Users include filter is active {CONFIG.USERS_INCLUDE}') | ||
did_print = True | ||
if CONFIG.USERS_EXCLUDE: | ||
utils.print_bright(f'Users exclude filter is active {CONFIG.USERS_EXCLUDE}') | ||
did_print = True | ||
if CONFIG.RECORDING_FILE_TYPES: | ||
utils.print_bright(f'Recording file types filter is active {CONFIG.RECORDING_FILE_TYPES}') | ||
|
@@ -49,16 +52,29 @@ def print_filter_warnings(): | |
print() | ||
|
||
def get_users(): | ||
if CONFIG.USERS: | ||
return [(email, '') for email in CONFIG.USERS] | ||
|
||
return paginate_reduce( | ||
'https://api.zoom.us/v2/users?status=active', [], | ||
lambda users, page: users + [(user['email'], get_user_name(user)) for user in page['users']] | ||
) + paginate_reduce( | ||
'https://api.zoom.us/v2/users?status=inactive', [], | ||
lambda users, page: users + [(user['email'], get_user_name(user)) for user in page['users']] | ||
) | ||
if CONFIG.USERS_INCLUDE: | ||
users = [(email, '') for email in CONFIG.USERS_INCLUDE] | ||
else: | ||
users = paginate_reduce( | ||
'https://api.zoom.us/v2/users?status=active', [], | ||
lambda users, page: users + [(user['email'], get_user_name(user)) for user in page['users']] | ||
) + paginate_reduce( | ||
'https://api.zoom.us/v2/users?status=inactive', [], | ||
lambda users, page: users + [(user['email'], get_user_name(user)) for user in page['users']] | ||
) | ||
|
||
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}>') | ||
Comment on lines
+69
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
return users | ||
|
||
def paginate_reduce(url, initial, reduce): | ||
initial_url = utils.add_url_params(url, {'page_size': 300}) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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