Closed meadow-kun closed 1 year ago
Has anybody successfully updated this to use Server-to-server instead of JWT?
Has anybody successfully updated this to use Server-to-server instead of JWT?
Yes! But doing more tests.
@freelimiter let me know if I can help test!
``def load_access_token():
url = "https://zoom.us/oauth/token?grant_type=account_credentials&account_id=" + ACCOUNT_ID
client_cred = CLIENT_ID + ":" + CLIENT_SECRET
client_cred_base64_string = base64.b64encode(client_cred.encode('utf-8')).decode('utf-8')
headers = {
'Authorization': 'Basic ' + client_cred_base64_string,
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers)
jdata = json.loads(response.text)
global ACCESS_TOKEN
global AUTHORIZATION_HEADER
ACCESS_TOKEN = jdata["access_token"]
AUTHORIZATION_HEADER = {'Authorization': 'Bearer ' + ACCESS_TOKEN,
'Content-Type': 'application/json'}
``
I'm such a noob. sorry. Add ACCOUNT_ID, CLIENT_ID, CLIENT_SECRET at the top where the global vars are.
Then in the main function, insert load_access_token() before load_completed_meeting_ids()
also import base64
@freelimiter let me know if I can help test!
Does it work for you?
Giving this a go tomorrow morning, will let you know. Thank you for sharing!
@freelimiter - followed your instructions, got this:
Traceback (most recent call last):
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 319, in <module>
main()
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 264, in main
load_access_token()
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 81, in load_access_token
jdata = json.loads(response.text)
NameError: name 'json' is not defined
I added import json
and it fixed that error, but replaced it with this:
Traceback (most recent call last):
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 320, in <module>
main()
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 265, in main
load_access_token()
File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 87, in load_access_token
ACCESS_TOKEN = jdata["access_token"]
KeyError: 'access_token'
Add “import json” at the top
On Thu, May 18, 2023 at 5:19 AM Alex Hillman @.***> wrote:
@freelimiter https://github.com/freelimiter - followed your instructions, getting this:
Traceback (most recent call last): File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 319, in
main() File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 264, in main load_access_token() File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 81, in load_access_token jdata = json.loads(response.text) NameError: name 'json' is not defined — Reply to this email directly, view it on GitHub https://github.com/ricardorodrigues-ca/zoom-recording-downloader/issues/22#issuecomment-1552971436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWRK6MVBFSPJO3VDP6DIDXGYHUNANCNFSM6AAAAAAQOH3ICY . You are receiving this because you were mentioned.Message ID: @.*** .com>
Ok May need some error checking in that part of the code. But did you create a new App in zoom for Server to server OAuth and then filled out all credentials in the global variables?
On Thu, May 18, 2023 at 6:20 AM Arvin P @.***> wrote:
Add “import json” at the top
On Thu, May 18, 2023 at 5:19 AM Alex Hillman @.***> wrote:
@freelimiter https://github.com/freelimiter - followed your instructions, getting this:
Traceback (most recent call last): File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 319, in
main() File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 264, in main load_access_token() File "/Users/alexhillman/Desktop/zoom-recording-downloader/zoom-recording-downloader.py", line 81, in load_access_token jdata = json.loads(response.text) NameError: name 'json' is not defined — Reply to this email directly, view it on GitHub https://github.com/ricardorodrigues-ca/zoom-recording-downloader/issues/22#issuecomment-1552971436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWRK6MVBFSPJO3VDP6DIDXGYHUNANCNFSM6AAAAAAQOH3ICY . You are receiving this because you were mentioned.Message ID: <ricardorodrigues-ca/zoom-recording-downloader/issues/22/1552971436@ github.com>
Good news! I didn't realize that I hadn't finished setting up the S2S Oauth App, I just copied the credentials from the first panel.
While completing the app creation, I did some guess and check and got the script working by adding the scopes for downloads, users, and accounts. Once I had them done, the app worked again! Thanks so much for this.
Any idea which ones are actually needed, so I can remove the rest?
That great! It’s all about trial and error at this point. Glad it’s working out for you!
On Thu, May 18, 2023 at 7:10 AM Alex Hillman @.***> wrote:
Good news! I didn't realize that I hadn't finished setting up the S2S Oauth App, I just copied the credentials from the first panel.
While completing the app creation, I did some guess and check and got the script working by adding the scopes for downloads, users, and accounts. Once I had them done, the app worked again! Thanks so much for this. [image: Monosnap M2 Mini 2023-05-18 10-08-37] https://user-images.githubusercontent.com/3707/239255986-83dbdb8f-eaf4-44a7-8bf8-974b0918786a.png
Any idea which ones are actually needed, so I can remove the rest?
— Reply to this email directly, view it on GitHub https://github.com/ricardorodrigues-ca/zoom-recording-downloader/issues/22#issuecomment-1553120539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWRKYD4FGUTQD2ZBEBF5DXGYUVXANCNFSM6AAAAAAQOH3ICY . You are receiving this because you were mentioned.Message ID: @.*** .com>
Everything good so far? Please make sure to review the downloaded files and the videos are actually playable. Had an issue where I had activated the passcode for sharing recordings and the downloads were unplayable.
i checked and all of the latest videos it downloaded look good and playable. Works like a charm! thanks again.
Hi. All works! Thank you!
care to share the source code?
read this entire thread.
care to share the source code?
Hi folks, I've been using this script for a while and it has saved my life! Thanks for the update @freelimiter I've just submitted my first pull request ever, with the updated code. Hope I've done everything right. :-)
Oh awesome! I was going to do it but got busy. Thanks!!!
@risdian you can check the changes/new code here https://github.com/ricardorodrigues-ca/zoom-recording-downloader/pull/37/files
@risdian you can check the changes/new code here https://github.com/ricardorodrigues-ca/zoom-recording-downloader/pull/37/files
i already done the code. thanks to @freelimiter. thank you all.
also added new function called delete_meeting. You can call this function after "skipping already downloaded" and the "# if successful, write the ID of this recording to the completed file". hope that makes sense.
def delete_meeting(meeting_id):
delete_url = "https://api.zoom.us/v2/meetings/{}/recordings".format(meeting_id)
response = requests.delete(delete_url, headers=AUTHORIZATION_HEADER)
if response.status_code == 204:
print("Successfully deleted recording for meeting: {}".format(meeting_id))
else:
print("Failed to delete recording for meeting: {}. Response: {}".format(meeting_id, response.text))
Script now uses Server-to-Server OAuth authentication, and updated README.md to reflect new instructions.
Just a heads up that this implementation will run into issues by June 2023.
Cloned today, worked flawlessly. Thank you!