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
Extract video filenames correctly from URLs #6428
Conversation
cannot process url like "https:/example.com/avatar/xxxx.mp4?se=2023-11-16T06:51:23Z&sp=r" correctly, will get format like"mp4?se=2023-11-16T06:51:23Z&sp=r", and do unnecessary convert
🪼 branch checks and previews
|
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
Thanks @112292454! This looks good. I wonder if there's a way to get the base filepath in a URL without having to do manual parsing of the string? Would you be able to add a test to |
now use urllib and os.path |
Thanks @112292454 I refactored this out to be a separate util function and added a test. Merging! |
@abidlabs 😭 i'm sorry, i has did some change when last comment, but i commit it incorrectly(merge from my another branch. but didn't put that code into this pr) |
Its okay, I think my changes should have covered everything, right? Unless I missed something? |
you're right, just different in test case, and if it end with / |
Description
before cannot process url like "https:/example.com/avatar/xxxx.mp4?se=2023-11-16T06:51:23Z&sp=r" correctly, will get format as "mp4?se=2023-11-16T06:51:23Z&sp=r", and go to unnecessary format convert