fix(extractor): handle FileMoon with missing height info in packed
This commit is contained in:
parent
258e35c94d
commit
d44e0a2588
6 changed files with 326 additions and 2 deletions
|
|
@ -17,4 +17,8 @@ describe('FileMoon', () => {
|
|||
test('page not found', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://filemoon.sx/e/n7i8zodwjqr9'))).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('missing height', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://filemoon.to/d/ugj7f1kq94p1'))).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export class FileMoon extends Extractor {
|
|||
const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'FileMoon', originalUrl as URL, headers);
|
||||
|
||||
const unpacked = unpackEval(html);
|
||||
const heightMatch = unpacked.match(/(\d{3,})p/) as string[];
|
||||
const heightMatch = unpacked.match(/(\d{3,})p/);
|
||||
|
||||
return [
|
||||
{
|
||||
|
|
@ -75,7 +75,7 @@ export class FileMoon extends Extractor {
|
|||
ttl: this.ttl,
|
||||
meta: {
|
||||
...meta,
|
||||
height: parseInt(heightMatch[1] as string),
|
||||
...(heightMatch && { height: parseInt(heightMatch[1] as string) }),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
227
src/extractor/__fixtures__/FileMoon/https:filemoon.todugj7f1kq94p1
generated
Normal file
227
src/extractor/__fixtures__/FileMoon/https:filemoon.todugj7f1kq94p1
generated
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Watch tt0307453</title>
|
||||
<meta name="description" content="">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#FFF">
|
||||
|
||||
<link rel="apple-touch-icon" href="//filemoon.to/assets/images/favicon/apple-touch-icon.png" sizes="180x180">
|
||||
<link rel="icon" href="//filemoon.to/assets/images/favicon/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" href="//filemoon.to/assets/images/favicon/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="icon" href="//filemoon.to/assets/images/favicon/favicon.ico">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="//filemoon.to/assets/css/front.css?v=51">
|
||||
<META NAME="description" CONTENT="Watch video tt0307453">
|
||||
<META NAME="keywords" CONTENT="tt0307453">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="is-home d-flex flex-column justify-content-between ">
|
||||
<header class="header py-3 py-lg-4">
|
||||
<div class="container">
|
||||
<div class="row align-items-center justify-content-between justify-content-lg-start">
|
||||
<div class="col-auto d-lg-none">
|
||||
<button class="btn text-muted ssm-toggle-nav px-1" type="button">
|
||||
<i class="icon icon-menu icon-size-22 text-muted"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a href="/" class="logo d-block"><img src="//filemoon.to/assets/images/logo.svg" alt=""></a>
|
||||
</div>
|
||||
<div class="col-auto d-none d-lg-block flex-lg-grow-1">
|
||||
<nav class="nav ml-lg-3">
|
||||
<a class="nav-link" href="/premium">Premium</a>
|
||||
<a class="nav-link" href="/affiliate">Make Money</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="d-none d-lg-flex">
|
||||
|
||||
<a href="/login" class="btn btn-dark sign-btn rounded-pill mr-2">Log In</a>
|
||||
<a href="/register" class="btn btn-success sign-btn rounded-pill">Sign Up</a>
|
||||
|
||||
</div>
|
||||
<div class="d-lg-none">
|
||||
<button class="btn text-muted usrmobile-toggle-nav px-1" type="button">
|
||||
<i class="icon icon-user icon-size-18 text-muted"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
|
||||
<script src="https://filemoon.to/js/jquery.cookie.js"></script>
|
||||
<script>
|
||||
$.cookie('file_id', '48721931', { expires: 10 });
|
||||
$.cookie('aff', '89667', { expires: 10 });
|
||||
$.cookie('ref_url', 'https://filemoon.to/d/ugj7f1kq94p1', { expires: 10 });
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src='/js/ls.js'></script>
|
||||
<main class="flex-grow-1 a-bean">
|
||||
<div class="container mt-5">
|
||||
<div class="mb-4 mb-lg-5 sm-bg px-4 py-5 p-lg-0 mx-lg-5 rounded-lg">
|
||||
<div class="row justify-content-between align-items-center text-muted mb-4 mb-lg-5">
|
||||
<div class="col-auto mb-2">
|
||||
<h3 class="text-light mb-0 font-weight-bold">tt0307453</h3>
|
||||
</div>
|
||||
<div class="col-auto mb-2"> Uploaded: <span class="text-success">2025-08-24 00:12:36</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4 mb-lg-5 ">
|
||||
<div class="position-relative">
|
||||
|
||||
<div class="bimg-top text-center">
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 640px;" id="iframe-holder">
|
||||
|
||||
<iframe src="https://ico3c.com/bkg/ugj7f1kq94p1" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="100%" height="100%" allowfullscreen></iframe>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bimg-bottom text-center">
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-4 mb-lg-5 text-center">
|
||||
<a href="/download/ugj7f1kq94p1" class="btn btn-success px-5">Download</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
#vplayer {padding-top: 56.25%;}
|
||||
.bimg-top,
|
||||
.bimg-bottom {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flex;
|
||||
display: flex;
|
||||
-ms-align-items: center;
|
||||
align-items: center;
|
||||
-webkit-flex-wrap: wrap;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.bimg-top div,
|
||||
.bimg-bottom div {
|
||||
margin: .5rem;
|
||||
}
|
||||
@media(min-width:1600px){
|
||||
.bimg-top,
|
||||
.bimg-bottom {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
flex-direction: column;
|
||||
}
|
||||
.bimg-top {
|
||||
left: -310px;
|
||||
}
|
||||
.bimg-bottom {
|
||||
right: -310px;
|
||||
}
|
||||
.bimg-top div,
|
||||
.bimg-bottom div {
|
||||
margin: .5rem 0;
|
||||
}
|
||||
}
|
||||
@media(min-width:1800px){
|
||||
.bimg-top {
|
||||
left: -350px;
|
||||
}
|
||||
.bimg-bottom {
|
||||
right: -350px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<footer class="footer py-4 py-lg-5">
|
||||
<div class="container">
|
||||
<div class="row align-items-center justify-content-between">
|
||||
<div class="col-auto my-1">
|
||||
<div class="text-muted"> FileMoon © 2022 </div>
|
||||
</div>
|
||||
<div class="col-auto my-1">
|
||||
<nav class="nav">
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/">Home</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/tos">Terms of Service</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/privacy">Privacy Policy</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/copyright">Copyright Policy</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/affiliate">Make Money</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="/api">API Documentation</a>
|
||||
<a class="nav-link text-muted footer-link px-0 mr-4" href="https://status.filemoon.sx">Server Status</a>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
<div class="ssm">
|
||||
<nav class="nav ssm-nav flex-column">
|
||||
<a class="nav-link ssm-nav-link active" href="/"><i class="icon icon-home icon-size-16 ssm-nav-icon mr-3"></i>Home</a>
|
||||
<a class="nav-link ssm-nav-link" href="/dashboard"><i class="icon icon-account icon-size-16 ssm-nav-icon mr-3"></i>My account</a>
|
||||
<a class="nav-link ssm-nav-link" href="/premium"><i class="icon icon-money icon-size-16 ssm-nav-icon mr-3"></i>Premium</a>
|
||||
<a class="nav-link ssm-nav-link" href="/affiliate"><i class="icon icon-money icon-size-16 ssm-nav-icon mr-3"></i>Make Money</a>
|
||||
</nav>
|
||||
<hr class="mx-3">
|
||||
<nav class="nav flex-column ssm-nav">
|
||||
<a class="nav-link ssm-nav-link" href="/tos"><i class="icon icon-pen icon-size-16 ssm-nav-icon mr-3"></i>Terms of Service</a>
|
||||
<a class="nav-link ssm-nav-link" href="/privacy"><i class="icon icon-key icon-size-16 ssm-nav-icon mr-3"></i>Privacy Policy</a>
|
||||
<a class="nav-link ssm-nav-link" href="/api"><i class="icon icon-note icon-size-16 ssm-nav-icon mr-3"></i>API Documentation</a>
|
||||
<a class="nav-link ssm-nav-link" href="https://status.filemoon.sx"><i class="icon icon-note icon-size-16 ssm-nav-icon mr-3"></i>Server Status</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="ssm-overlay ssm-toggle-nav"></div>
|
||||
<div class="usrmobile p-5 usrmobile-toggle-nav">
|
||||
|
||||
<a href="/login" class="btn btn-success btn-success-custom btn-lg btn-block text-uppercase shadow">Sign in</a>
|
||||
<a href="/register" class="btn btn-outline-success btn-lg btn-block mb-2 text-uppercase">Sign up</a>
|
||||
|
||||
</div>
|
||||
<script src="//filemoon.to/assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="//filemoon.to/assets/js/jquery.slideandswipe.min.js"></script>
|
||||
<script src="//filemoon.to/assets/js/jquery.touchSwipe.min.js"></script>
|
||||
<script src="//filemoon.to/assets/js/front.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
76
src/extractor/__fixtures__/FileMoon/https:ico3c.combkgugj7f1kq94p1
generated
Normal file
76
src/extractor/__fixtures__/FileMoon/https:ico3c.combkgugj7f1kq94p1
generated
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
{"destination_url":"https://be7713.rcr82.waw05.i8yz83pn.com/hls2/05/09711/aeuhexjcoysl_x/master.m3u8?t=fiqqJThcgnrc77etu-nLPLodbF1UeqY5Cou0vvnLIB0&s=1765556185&e=10800&f=48721931&srv=1050&asn=13335&sp=5500&p=","request_headers":{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","referer":"https://ico3c.com/bkg/ugj7f1kq94p1"},"mediaflow_proxy_url":"https://mediaflow.test.org/proxy/hls/manifest.m3u8","query_params":{"api_password":"test"}}
|
||||
|
|
@ -1,5 +1,21 @@
|
|||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`FileMoon missing height 1`] = `
|
||||
[
|
||||
{
|
||||
"format": "hls",
|
||||
"label": "FileMoon (MFP)",
|
||||
"meta": {
|
||||
"countryCodes": [],
|
||||
"extractorId": "filemoon",
|
||||
"title": "tt0307453",
|
||||
},
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow.test.org/proxy/hls/manifest.m3u8?api_password=test&h_user-agent=Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F136.0.0.0+Safari%2F537.36&h_referer=https%3A%2F%2Fico3c.com%2Fbkg%2Fugj7f1kq94p1&d=https%3A%2F%2Fbe7713.rcr82.waw05.i8yz83pn.com%2Fhls2%2F05%2F09711%2Faeuhexjcoysl_x%2Fmaster.m3u8%3Ft%3DfiqqJThcgnrc77etu-nLPLodbF1UeqY5Cou0vvnLIB0%26s%3D1765556185%26e%3D10800%26f%3D48721931%26srv%3D1050%26asn%3D13335%26sp%3D5500%26p%3D",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`FileMoon page not found 1`] = `[]`;
|
||||
|
||||
exports[`FileMoon z1ekv717 d 1`] = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue