Skip to content
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

[Zoom] Fix extractor #32828

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[Zoom] Fix extractor #32828

wants to merge 2 commits into from

Conversation

rafiw
Copy link

@rafiw rafiw commented Jul 1, 2024

#32094

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This fixes the zoom extractor reported in #32094

@dirkf dirkf linked an issue Jul 6, 2024 that may be closed by this pull request
5 tasks
Copy link
Contributor

@dirkf dirkf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work!

I have some work-in-progress to contribute. We should also ensure align the extractor with yt-dlp's as appropriate.

For now I've just made some initial suggestions.

youtube_dl/extractor/zoom.py Outdated Show resolved Hide resolved
youtube_dl/extractor/zoom.py Outdated Show resolved Hide resolved
youtube_dl/extractor/zoom.py Outdated Show resolved Hide resolved
youtube_dl/extractor/zoom.py Outdated Show resolved Hide resolved
@dirkf
Copy link
Contributor

dirkf commented Jul 8, 2024

I've taken the opportunity of your PR to make a wholesale update of the extractor, and I hope that's OK. It would be a big help if you were able to check that the revised code works well for you.

@rafiw
Copy link
Author

rafiw commented Jul 8, 2024 via email

if url_type == 'share':
webpage = self._get_real_webpage(url, base_url, video_id, 'share')
meeting_id = self._get_page_data(webpage, video_id)['meetingId']
redirect_path = self._download_json(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if video doesn't exists like in the test https://us02web.zoom.us/rec/share/hkUk5Zxcga0nkyNGhVCRfzkA2gX_mzgS3LpTxEEWJz9Y_QpIQ4mZFOUx7KZRZDQA.9LGQBdqmDAYgiZ_8 result object will be None and accessing redirectUrl will throw a nasy exception.
maybe something like this?

if download_json['result'] is not None and 'redirectUrl' in download_json['result']:
	redirect_path = download_json['result']['redirectUrl']
	url = urljoin(base_url, redirect_path)
	query['continueMode'] = 'true'
else:
	if 'errorMessage' in download_json:
		raise UnsupportedError(download_json['errorMessage'])
	else:
		raise UnsupportedError("No video found")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zoom
2 participants