ricardorodrigues-ca / zoom-recording-downloader

Downloads and organizes all cloud recordings from your Zoom Business account
MIT License
124 stars 63 forks source link

Error 124 Forbidden #35

Open hwhelchel opened 1 year ago

hwhelchel commented 1 year ago

Hi @ricardorodrigues-ca,

I ran it for about 2,000 Zoom recordings and a number of them got this error:

{"status":false,"errorCode":124,"errorMessage":"Forbidden"}

Perhaps my JWT had expired when these were attempted.

That said all of these, about 880, that have this error were logged by the system as being successfully downloaded.

What's the simplest way for me to rerun only the ones that failed in this way?

Screenshot 2023-04-19 at 3 02 48 PM

I've separated out the ones that errored into a downloads-errors folder if helpful.

I imagine what we would need to do is reverse lookup the meeting IDs of the errored recordings and then just download those.

hwhelchel commented 1 year ago

Added this function

def get_failed_meeting_names():
    failed_meeting_names = set()
    error_directory = 'downloads-errors'
    error_folders = glob.glob(os.path.join(error_directory, '*'))

    for folder in error_folders:
        folder_name = os.path.basename(folder)
        failed_meeting_names.add(folder_name)

    return failed_meeting_names

Added this to main

def main():
    # ...
    # Add this line after loading completed and failed meeting IDs:
    failed_meeting_names = get_failed_meeting_names()

    for email, user_id, first_name, last_name in users:
        # ...
        for index, recording in enumerate(recordings):
            # ...
            _, foldername = format_filename(
                recording, file_type, file_extension, recording_type, recording_id)

            # Skip the meeting if it's not in the failed_meeting_names set
            if foldername not in failed_meeting_names:
                continue

            # Rest of the code for downloading the recording
            # ...