mirror of
https://github.com/dirtydishes/dreamio.git
synced 2026-06-06 13:37:24 +00:00
accept stremio subtitle download urls
This commit is contained in:
parent
11ed364094
commit
11b9c6a12a
7 changed files with 540 additions and 1 deletions
|
|
@ -169,12 +169,25 @@ final class DreamioWebViewController: UIViewController {
|
|||
}
|
||||
};
|
||||
|
||||
const isStremioSubtitleDownloadURL = (url) => {
|
||||
try {
|
||||
const parsed = new URL(url, window.location.href);
|
||||
const host = parsed.hostname.toLowerCase();
|
||||
const path = parsed.pathname.toLowerCase();
|
||||
return host === "strem.io" || host.endsWith(".strem.io")
|
||||
? /\/[a-z]{2,3}\/download(?:\/|$)/i.test(path) || /\/download(?:\/|$)/i.test(path)
|
||||
: false;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const isSubtitleURL = (url) => {
|
||||
if (!url || isOpenSubtitlesManifestID(url)) {
|
||||
return false;
|
||||
}
|
||||
return !isProbablyNonSubtitleAssetURL(url)
|
||||
&& (isDirectSubtitleFileURL(url) || isOpenSubtitlesDownloadURL(url));
|
||||
&& (isDirectSubtitleFileURL(url) || isOpenSubtitlesDownloadURL(url) || isStremioSubtitleDownloadURL(url));
|
||||
};
|
||||
|
||||
const findResolverURL = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue