8000 Fixed KeyError on generate_srt_captions command by MYusufY · Pull Request #1959 · pytube/pytube · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed KeyError on generate_srt_captions command #1959

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

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

Conversation

MYusufY
Copy link
@MYusufY MYusufY commented Jul 10, 2024

Description

This PR fixes a KeyError in xml_caption_to_srt caused by missing start or dur attributes in XML captions. Default values of 0.0 are now used when these attributes are absent.

Solved this:

Changes

  • Added try-except blocks to handle missing start and dur attributes in pytube/captions.py.
  • Provided default values to ensure smooth execution.

@MYusufY MYusufY changed the title Fixed KeyError in xml_caption_to_srt method, solved #1957 Fixed KeyError on generate_captions_srt command Jul 18, 2024
@MYusufY MYusufY changed the title Fixed KeyError on generate_captions_srt command Fixed KeyError on generate_srt_captions command Jul 18, 2024
@MYusufY MYusufY mentioned this pull request Jul 18, 2024
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.

1 participant
0