Skip to content

Commit

Permalink
double encode session_uuid with starting slash
Browse files Browse the repository at this point in the history
  • Loading branch information
bearums committed Dec 11, 2023
1 parent e263852 commit ed69bbd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions workshop-registration/external/zoom_api/get_attendees.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
import requests
import urllib.parse

def double_encode(input):
single_encoded = urllib.parse.quote(input, safe='')
double_encoded = urllib.parse.quote(single_encoded, safe='')
return double_encoded

def get_attendees(access_token: str, meeting_id: str) -> List[ZoomAttendee]:
session_uuids = get_session_uuids(access_token=access_token, meeting_id=meeting_id)
zoom_attendees = []
for session_idx, session_uuid in enumerate(session_uuids):


if session_uuid[0]=='/':
session_uuid= double_encode(session_uuid)
url = f"https://api.zoom.us/v2/report/meetings/{session_uuid}/participants"
single_encoded_url = urllib.parse.quote(url, safe='')
double_encoded_url = urllib.parse.quote(single_encoded_url, safe='')
#note when session_uuid starts with a /, code breaks
try:
response = requests.get(
url=url,
Expand All @@ -35,6 +41,8 @@ def get_attendees(access_token: str, meeting_id: str) -> List[ZoomAttendee]:
except:
print('problem with sesion_uuid:')
print(session_idx, session_uuid)
print (single_encoded_url, double_encoded_url)
print(url)
return zoom_attendees

def get_session_uuids(access_token: str, meeting_id: str) -> Sequence[str]:
Expand Down

0 comments on commit ed69bbd

Please sign in to comment.