fix(extractor): handle FileLions deleted by administration
This commit is contained in:
parent
7e4891a93f
commit
c075fe9481
4 changed files with 152 additions and 1 deletions
|
|
@ -21,4 +21,8 @@ describe('FileLions', () => {
|
|||
test('file not found', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://filelions.to/v/ylcp2cu5qanb'))).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('deleted by administration', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://callistanise.com/f/cy4t5nkerjrt'))).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export class FileLions extends Extractor {
|
|||
return await this.extractInternal(ctx, new URL(url.href.replace('/f/', '/v/')), meta);
|
||||
}
|
||||
|
||||
if (/File Not Found/.test(html)) {
|
||||
if (/File Not Found|deleted by administration/.test(html)) {
|
||||
throw new NotFoundError();
|
||||
}
|
||||
|
||||
|
|
|
|||
145
src/extractor/__fixtures__/FileLions/https:callistanise.comfcy4t5nkerjrt
generated
Normal file
145
src/extractor/__fixtures__/FileLions/https:callistanise.comfcy4t5nkerjrt
generated
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
|
||||
Watch 300938 570f5a24 c281 484d 93fa 734dabbec813 jkgg 2651705 vidhide mp4
|
||||
|
||||
</title>
|
||||
<META NAME="description" CONTENT="">
|
||||
<META NAME="keywords" 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="/static/images/favicon/apple-touch-icon.png" sizes="180x180">
|
||||
<link rel="icon" href="/static/images/favicon/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" href="/static/images/favicon/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/static/images/favicon/manifest.json">
|
||||
<link rel="icon" href="/static/images/favicon/favicon.ico">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="crossorigin">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap" rel="stylesheet">
|
||||
<link href="/static/css/style.css?" rel="stylesheet">
|
||||
|
||||
<script src="/static/js/jquery-3.2.1.min.js?"></script>
|
||||
<script src="/static/js/bootstrap.bundle.min.js?"></script>
|
||||
<script src="/static/js/app.js?"></script>
|
||||
<script src="/static/js/xupload.js?"></script>
|
||||
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-48ZJD1VPGZ"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-48ZJD1VPGZ');
|
||||
</script>
|
||||
<!-- Yandex.Metrika counter -->
|
||||
<script type="text/javascript" >
|
||||
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
||||
m[i].l=1*new Date();
|
||||
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
||||
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
||||
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
||||
|
||||
ym(93381808, "init", {
|
||||
clickmap:true,
|
||||
trackLinks:true,
|
||||
accurateTrackBounce:true,
|
||||
webvisor:true
|
||||
});
|
||||
</script>
|
||||
<noscript><div><img src="https://mc.yandex.ru/watch/93381808" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
||||
<!-- /Yandex.Metrika counter -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<header class="header">
|
||||
<div class="container">
|
||||
<div class="row align-items-center flex-nowrap">
|
||||
<div class="col-auto flex-grow-1 flex-shrink-1">
|
||||
<div class="row align-items-center">
|
||||
|
||||
<div class="col-auto" style="margin: 0 auto;">
|
||||
<a href="/" class="logo">
|
||||
|
||||
<img src="/static/images/logo.svg" alt="">
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
<main>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="block">
|
||||
<div class="mb-3">
|
||||
The file was deleted by administration because it didn't comply with our Terms of Use:
|
||||
</div>
|
||||
<h4>
|
||||
300938--570f5a24-c281-484d-93fa-734dabbec813--jkgg--2651705-vidhide.mp4
|
||||
</h4>
|
||||
<br>
|
||||
Reason for deletion: <br>
|
||||
<b class="text-danger">
|
||||
DMCA request
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xs-12">
|
||||
<div class="mb-3 text-center">
|
||||
<a href="#" class="logo">
|
||||
|
||||
<img src="/static/images/logo.svg" alt="">
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8 col-xs-12" style="position: relative">
|
||||
<div class="mb-4 text-center">
|
||||
<p class="text-muted ">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<style>
|
||||
@media (min-width:481px) {
|
||||
.text-muted {}
|
||||
}
|
||||
|
||||
@media (min-width:961px) {
|
||||
.text-muted {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 15px
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`FileLions deleted by administration 1`] = `[]`;
|
||||
|
||||
exports[`FileLions file not found 1`] = `[]`;
|
||||
|
||||
exports[`FileLions filelions f 1`] = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue