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

[BUG] Inadequate checking of domains when loading video media with custom loaders (streamable) #534

Open
robigan opened this issue Sep 17, 2024 · 2 comments
Labels
bug/fix Something isn't working

Comments

@robigan
Copy link

robigan commented Sep 17, 2024

I was reviewing the code that handles loading of media, and noticed that in Winston, the check for if media can be loaded using Streamable simply checks the url string for the presence of streamable.com

if data.url.contains("streamable.com") {
return .streamable(StreamableExtracted(url: data.url))
}

Additionally, the extractor doesn't check for the presence of a valid video ID slug, or that the streamable.com link isn't another landing page/non-video page like their landing page https://streamable.com/pricing, with the extractor returning an empty string if a leading slash is present and the domain being returned if there are no path delimiters in the URL (in which case leads to Winston trying to load a streamable video with ID streamable.com).

self.shortCode = String(url[url.index(url.lastIndex(of: "/") ?? url.startIndex, offsetBy: 1)...])

I see that right below, the URL is eventually parsed and then hosts are checked properly there, my suggestion would be to properly check the host component of the URL and only send the path component to the extractor.

@robigan robigan added the bug/fix Something isn't working label Sep 17, 2024
@robigan
Copy link
Author

robigan commented Sep 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant