Skip to content

Commit 1fadce9

Browse files
authored
Detect unauthorized downloads (#12)
* Work around status code 200 - Password Required While fetching download_url from zoom without an access token, password protected recordings return: HTTP/2 200 content-type: text/html;charset=utf-8 <!doctype html> <title>Password Required - Zoom</title> zat only considers non-html so a content-type check for html detects this. * log download_url on failure
1 parent f619b1c commit 1fadce9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

main.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,13 @@ func (z *Config) Archive(meeting zoom.Meeting, params runParams) error {
362362
}
363363
if r.StatusCode != http.StatusOK {
364364
curArchMeeting.status = "error"
365-
return fmt.Errorf("download failed, got %d error: %#v", r.StatusCode, r)
365+
return fmt.Errorf("while downloading recording %s: download failed, got %d error: %#v",
366+
f.DownloadURL, r.StatusCode, r)
367+
}
368+
if contentType := r.Header.Get("content-type"); strings.HasPrefix(contentType, "text/html") {
369+
curArchMeeting.status = "error"
370+
return fmt.Errorf("while downloading recording %s: download failed, got %s content",
371+
f.DownloadURL, contentType)
366372
}
367373
_, err = gdrive.Files.Create(&drive.File{
368374
Name: name,

0 commit comments

Comments
 (0)