fix: Implement retry logic for YouTube transcript fetching and fix URL decoding issue #1035
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! had problem with youtube part, especially when I wanted to paste url on terminal (MacOS: zsh, bash - Linux: bash).
Also in the README nothing's mentioned about Youtube, I added it until doc completes.
What’s Changed:
This PR introduces several important updates to improve the reliability and functionality of the YouTube transcript fetching process and URL handling:
Retry Logic for YouTube Transcript Fetching:
Fixed URL Decoding Issue:
\?
and\=
) were not being processed correctly, especially when pasted from the terminal. This fix ensures that URLs are properly decoded usingurllib.parse.unquote()
, so URLs likehttps://www.youtube.com/watch\?v\=videoID
are handled properly.Improved Metadata and Description Extraction:
Error Handling Improvements:
Refactored
_findKey
Function:_findKey
function has been refactored to simplify its code and make it more efficient by usingjson.items()
for dictionary iteration instead of a more complex recursive method.Why This Change is Needed: