fast-dirpy 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,6 +23,7 @@ A simple library/CLI to download youtube(etc.) videos.
23
23
  * [Koreanpornmovies](https://koreanpornmovie.com/)
24
24
  * [XVideos](https://www.xvideos.com/)
25
25
  * [Missav](https://missav.ws/) (m3u8)
26
+ * [Hanime1.me](https://hanime1.me/)
26
27
  </details>
27
28
 
28
29
  And `.m3u8` videos.
@@ -149,9 +150,9 @@ fast-dirpy --help
149
150
 
150
151
  ### Use as a library
151
152
  ```ts
152
- import { fastLink, fastDownload } from 'fast-dirpy'
153
+ import { fastLink, fastDownload, remoteM3U8ToMP4, downloadVideo } from 'fast-dirpy'
153
154
 
154
- // get direct link
155
+ // get direct link, returns string or object(some cases)
155
156
  const link = await fastLink(
156
157
  {
157
158
  url: '<url>',
package/dist/cli.mjs CHANGED
@@ -1 +1 @@
1
- import{a as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,y as g}from"./judgeUrl-BE4MkMrz.mjs";import{bold as _,dim as v}from"ansis";import{cac as y}from"cac";import b from"restore-cursor";const x=y(`fast-dirpy`),{version:S}=g;x.command(`get <url>`,`get video direct link.`).option(`--proxyHost, -H <proxyHost>`,`Proxy host.`).option(`--proxyPort, -P <proxyPort>`,`Proxy port.`).option(`--config, -c <path>`,`Specify an external config file.`).option(`--silent`,`Suppress non-error logs`).option(`--chromePath`,`Path to your Google Chrome browser`).action(async(e,t)=>{let n=m(e),{proxyHost:i,proxyPort:c,config:u,silent:f,chromePath:h}=t,g=i?{proxy:{host:i,port:c}}:void 0,y=h?{puppeteer:{executablePath:h}}:void 0;if(a(!!f),o.info(`fast-dirpy ${v(`v${S}`)} : ${_(`Direct Link Getter`)}.`),n===l.Bilibili){if(o.info(`Matched link source: Bilibili.`),!e.includes(`bilibili.com`)){o.error(`Please provide a valid Bilibili URL.`);return}let t=await r(e);console.log(t)}else if(n===l.Dirpy){o.info(`Matched link source: Dirpy.`);let t=await s({url:e,cwd:u},g);console.log(t)}else if(n===l.AnimeIdHentai){o.info(`Matched link source: Animeidhentai.`);let t=await d({url:e,cwd:u},{...g,...y});console.log(t)}else if(n===l.KoreanPM){o.info(`Matched link source: KoreanPM.`);let t=await p({url:e,cwd:u},g);console.log(t)}else o.error(`Your link is not supported!`)}),x.command(`download <url>`,`download a video.`).option(`--path, -p <path>`,`Download destination path + filename. e.g. /xxx/example.mp4.`).option(`--proxyHost, -H <proxyHost>`,`Proxy host.`).option(`--proxyPort, -P <proxyPort>`,`Proxy port.`).option(`--config, -c <path>`,`Specify an external config file.`).option(`--silent`,`Suppress non-error logs`).option(`--chromePath`,`Path to your Google Chrome browser`).action(async(t,r)=>{let s=m(t),{proxyHost:d,proxyPort:p,path:g,config:y,silent:b,chromePath:x}=r,C=d?{proxy:{host:d,port:p}}:void 0,w=x?{puppeteer:{executablePath:x}}:void 0;a(!!b),o.info(`fast-dirpy ${v(`v${S}`)} : ${_(`Video Downloader`)}.`),s===l.Bilibili?(o.info(`Matched link source: Bilibili.`),await h({url:t,path:g})):s===l.Dirpy?(o.info(`Matched link source: Dirpy.`),n({url:t,path:g||`./dirpy.mp4`,cwd:y},C)):s===l.AnimeIdHentai?(o.info(`Matched link source: AnimeIdHentai.`),await i({url:t,path:g||`./animeidhentai.mp4`,cwd:y},{...C,...w})):s===l.KoreanPM?(o.info(`Matched link source: KoreanPM.`),await u({url:t,path:g||`./korean-pm.mp4`,cwd:y},C)):s===l.MissAV?(o.info(`Matched link source: MissAV.`),await f({url:t,path:g,cwd:y})):s===l.M3U8?(o.info(`Matched link source: m3u8.`),await e({url:t,path:g||`./m3u8-download.mp4`,cwd:y})):s===l.MP4?(o.info(`Matched link source: mp4.`),await c({url:t,path:g,cwd:y})):o.error(`Your link is not supported!`)}),x.help(),x.version(t),x.parse(),b();export{};
1
+ import{S as e,_ as t,a as n,c as r,d as i,f as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,v as h,x as g}from"./judgeUrl-CVv06PmX.mjs";import{bold as _,dim as v}from"ansis";import{cac as y}from"cac";import b from"restore-cursor";const x=y(`fast-dirpy`),{version:S}=g;x.command(`get <url>`,`get video direct link.`).option(`--proxyHost, -H <proxyHost>`,`Proxy host.`).option(`--proxyPort, -P <proxyPort>`,`Proxy port.`).option(`--config, -c <path>`,`Specify an external config file.`).option(`--silent`,`Suppress non-error logs`).option(`--chromePath`,`Path to your Google Chrome browser`).action(async(e,n)=>{let r=p(e),{proxyHost:a,proxyPort:s,config:l,silent:d,chromePath:m}=n,g=a?{proxy:{host:a,port:s}}:void 0,y=m?{puppeteer:{executablePath:m}}:void 0;if(h(!!d),t.info(`fast-dirpy ${v(`v${S}`)} : ${_(`Direct Link Getter`)}.`),r===c.Bilibili){if(t.info(`Matched link source: Bilibili.`),!e.includes(`bilibili.com`)){t.error(`Please provide a valid Bilibili URL.`);return}let n=await i(e);console.log(n)}else if(r===c.Dirpy){t.info(`Matched link source: Dirpy.`);let n=await o({url:e,cwd:l},g);console.log(n)}else if(r===c.AnimeIdHentai){t.info(`Matched link source: Animeidhentai.`);let n=await u({url:e,cwd:l},{...g,...y});console.log(n)}else if(r===c.KoreanPM){t.info(`Matched link source: KoreanPM.`);let n=await f({url:e,cwd:l},g);console.log(n)}else t.error(`Your link is not supported!`)}),x.command(`download <url>`,`download a video.`).option(`--path, -p <path>`,`Download destination path + filename. e.g. /xxx/example.mp4.`).option(`--proxyHost, -H <proxyHost>`,`Proxy host.`).option(`--proxyPort, -P <proxyPort>`,`Proxy port.`).option(`--config, -c <path>`,`Specify an external config file.`).option(`--silent`,`Suppress non-error logs`).option(`--chromePath`,`Path to your Google Chrome browser`).action(async(e,i)=>{let o=p(e),{proxyHost:u,proxyPort:f,path:g,config:y,silent:b,chromePath:x}=i,C=u?{proxy:{host:u,port:f}}:void 0,w=x?{puppeteer:{executablePath:x}}:void 0;h(!!b),t.info(`fast-dirpy ${v(`v${S}`)} : ${_(`Video Downloader`)}.`),o===c.Bilibili?(t.info(`Matched link source: Bilibili.`),await m({url:e,path:g})):o===c.Dirpy?(t.info(`Matched link source: Dirpy.`),r({url:e,path:g||`./dirpy.mp4`,cwd:y},C)):o===c.AnimeIdHentai?(t.info(`Matched link source: AnimeIdHentai.`),await a({url:e,path:g||`./animeidhentai.mp4`,cwd:y},{...C,...w})):o===c.KoreanPM?(t.info(`Matched link source: KoreanPM.`),await l({url:e,path:g||`./korean-pm.mp4`,cwd:y},C)):o===c.MissAV?(t.info(`Matched link source: MissAV.`),await d({url:e,path:g,cwd:y})):o===c.M3U8?(t.info(`Matched link source: m3u8.`),await n({url:e,path:g||`./m3u8-download.mp4`,cwd:y})):o===c.MP4?(t.info(`Matched link source: mp4.`),await s({url:e,path:g,cwd:y})):t.error(`Your link is not supported!`)}),x.help(),x.version(e),x.parse(),b();export{};
@@ -17,7 +17,7 @@ interface DirectLinkParams {
17
17
  }
18
18
  interface DownloadParams {
19
19
  url: string;
20
- path: string;
20
+ path?: string;
21
21
  cwd?: string;
22
22
  }
23
23
  type M3U8Params = DownloadParams & {
@@ -30,7 +30,8 @@ declare enum UrlType {
30
30
  M3U8 = 3,
31
31
  KoreanPM = 4,
32
32
  MissAV = 5,
33
- MP4 = 6,
33
+ Hanime = 6,
34
+ MP4 = 7,
34
35
  }
35
36
  //#endregion
36
37
  //#region src/config.d.ts
package/dist/config.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as defineConfig } from "./config-Ri5GoyR_.mjs";
1
+ import { t as defineConfig } from "./config-DH7qoWD4.mjs";
2
2
  export { defineConfig };
package/dist/config.mjs CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./config-C-5h1aQS.mjs";export{e as defineConfig};
1
+ import{t as e}from"./config-D2bPo76p.mjs";export{e as defineConfig};
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Options, i as M3U8Params, n as DirectLinkParams, o as UrlType, r as DownloadParams, t as defineConfig } from "./config-Ri5GoyR_.mjs";
1
+ import { a as Options, i as M3U8Params, n as DirectLinkParams, o as UrlType, r as DownloadParams, t as defineConfig } from "./config-DH7qoWD4.mjs";
2
2
 
3
3
  //#region src/constants.d.ts
4
4
  declare const DEFAULT_OPTIONS: Options;
@@ -30,11 +30,15 @@ declare function remoteM3U8ToMP4(params: Partial<M3U8Params>): void;
30
30
  declare function getMissavLink(params: DirectLinkParams): Promise<string>;
31
31
  declare function downloadMissav(params: Partial<DownloadParams>): Promise<void>;
32
32
  //#endregion
33
+ //#region src/core/hanime.d.ts
34
+ declare function getHanimeLink(params: DirectLinkParams, options?: Partial<Options>): Promise<Record<string, any>[]>;
35
+ declare function downloadHanime(params: DownloadParams, options?: Partial<Options>): Promise<void>;
36
+ //#endregion
33
37
  //#region src/utils/downloader.d.ts
34
38
  declare function downloadVideo(params: DownloadParams, options?: Partial<Options>): Promise<void>;
35
39
  //#endregion
36
40
  //#region src/index.d.ts
37
- declare function fastLink(params: DirectLinkParams, options?: Partial<Options>): Promise<string>;
41
+ declare function fastLink(params: DirectLinkParams, options?: Partial<Options>): Promise<string | Record<string, any>[]>;
38
42
  declare function fastDownload(params: DownloadParams, options?: Partial<Options>): Promise<void>;
39
43
  //#endregion
40
- export { DEFAULT_OPTIONS, DirectLinkParams, DownloadParams, M3U8Params, Options, UrlType, __dirname, defineConfig, downloadAnimeIdHentai, downloadBilibili, downloadDirpy, downloadKoreanPm, downloadMissav, downloadVideo, fastDownload, fastLink, getAnimeIdHentaiLink, getBilibiliLink, getDirpyLink, getKoreanPmLink, getMissavLink, remoteM3U8ToMP4 };
44
+ export { DEFAULT_OPTIONS, DirectLinkParams, DownloadParams, M3U8Params, Options, UrlType, __dirname, defineConfig, downloadAnimeIdHentai, downloadBilibili, downloadDirpy, downloadHanime, downloadKoreanPm, downloadMissav, downloadVideo, fastDownload, fastLink, getAnimeIdHentaiLink, getBilibiliLink, getDirpyLink, getHanimeLink, getKoreanPmLink, getMissavLink, remoteM3U8ToMP4 };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,c as n,d as r,f as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h,v as g,y as _}from"./judgeUrl-BE4MkMrz.mjs";import{t as v}from"./config-C-5h1aQS.mjs";import{bold as y,dim as b}from"ansis";const{version:x}=_;async function S(t,n=e){let{url:i,cwd:c}=t,{proxy:u,puppeteer:f}=n,h=u||{},g=f||{},_=m(i);return a.info(`fast-dirpy ${b(`v${x}`)} : ${y(`Direct Link Getter`)}.`),_===l.Bilibili?(a.info(`Matched link source: Bilibili.`),i.includes(`bilibili.com`)?await r(i):(a.error(`Please provide a valid Bilibili URL.`),``)):_===l.AnimeIdHentai?(a.info(`Matched link source: Animeidhentai.`),await d({url:i,cwd:c},{...h,...g})):_===l.KoreanPM?(a.info(`Matched link source: KoreanPM.`),await p({url:i,cwd:c},h)):_===l.MissAV?(a.info(`Matched link source: MissAV.`),await o({url:i,cwd:c})):_===l.Dirpy?(a.info(`Matched link source: Dirpy.`),await s({url:i,cwd:c},h)):(a.error(`Your link is not supported!`),``)}async function C(r,o=e){let{url:s,path:c,cwd:d}=r,{proxy:p,puppeteer:g}=o,_=p||{},v=g||{},S=m(s);a.info(`fast-dirpy ${b(`v${x}`)} : ${y(`Video Downloader`)}.`),S===l.Bilibili?(a.info(`Matched link source: Bilibili.`),await h({url:s,path:c})):S===l.Dirpy?(a.info(`Matched link source: Dirpy.`),n({url:s,path:c||`./dirpy.mp4`,cwd:d},_)):S===l.AnimeIdHentai?(a.info(`Matched link source: AnimeIdHentai.`),await i({url:s,path:c||`./animeidhentai.mp4`,cwd:d},{..._,...v})):S===l.KoreanPM?(a.info(`Matched link source: KoreanPM.`),await u({url:s,path:c||`./korean-pm.mp4`,cwd:d},_)):S===l.MissAV?(a.info(`Matched link source: MissAV.`),await f({url:s,path:c,cwd:d})):S===l.M3U8?(a.info(`Matched link source: m3u8.`),await t({url:s,path:c||`./m3u8-download.mp4`,cwd:d})):a.error(`Your link is not supported!`)}export{e as DEFAULT_OPTIONS,l as UrlType,g as __dirname,v as defineConfig,i as downloadAnimeIdHentai,h as downloadBilibili,n as downloadDirpy,u as downloadKoreanPm,f as downloadMissav,c as downloadVideo,C as fastDownload,S as fastLink,d as getAnimeIdHentaiLink,r as getBilibiliLink,s as getDirpyLink,p as getKoreanPmLink,o as getMissavLink,t as remoteM3U8ToMP4};
1
+ import{_ as e,a as t,b as n,c as r,d as i,f as a,g as o,h as s,i as c,l,m as u,n as d,o as f,p,r as m,s as h,t as g,u as _,x as v,y}from"./judgeUrl-CVv06PmX.mjs";import{t as b}from"./config-D2bPo76p.mjs";import{bold as x,dim as S}from"ansis";import C from"axios";import{load as w}from"cheerio";function T(e,t){return Number(e.size)-Number(t.size)}async function E(e,t=y){let{url:n,cwd:r}=e,{proxy:i,timeout:a}=await o(t,r),c=i?.host===``?void 0:i,{data:l}=await C.get(n,{headers:{"User-Agent":s(),Referer:`https://hanime1.me/`},proxy:c,timeout:a}),u=w(l),d=[],f=u(`source[type="video/mp4"]`);for(let e of Object.values(f))d.push(e.attribs);return d=d.filter(e=>e!=null).sort(T),d}async function D(t,n=y){let{path:r,url:i,cwd:a}=t,o=await E({url:i},n);o.length>0&&e.success(`Successfully get video sources, size ${o[o.length-1].size} to be downloaded.`),await u({url:o[o.length-1].src,path:r,cwd:a},n)}const{version:O}=v;async function k(t,n=y){let{url:r,cwd:a}=t,{proxy:o,puppeteer:s}=n,u=o||{},f=s||{},m=g(r);return e.info(`fast-dirpy ${S(`v${O}`)} : ${x(`Direct Link Getter`)}.`),m===d.Bilibili?(e.info(`Matched link source: Bilibili.`),r.includes(`bilibili.com`)?await i(r):(e.error(`Please provide a valid Bilibili URL.`),``)):m===d.AnimeIdHentai?(e.info(`Matched link source: Animeidhentai.`),await p({url:r,cwd:a},{...u,...f})):m===d.KoreanPM?(e.info(`Matched link source: KoreanPM.`),await h({url:r,cwd:a},u)):m===d.MissAV?(e.info(`Matched link source: MissAV.`),await c({url:r,cwd:a})):m===d.Hanime?(e.info(`Matched link source: Hanime.`),await E({url:r,cwd:a},u)):m===d.Dirpy?(e.info(`Matched link source: Dirpy.`),await l({url:r,cwd:a},u)):(e.error(`Your link is not supported!`),``)}async function A(n,i=y){let{url:o,path:s,cwd:c}=n,{proxy:l,puppeteer:p}=i,h=l||{},v=p||{},b=g(o);e.info(`fast-dirpy ${S(`v${O}`)} : ${x(`Video Downloader`)}.`),b===d.Bilibili?(e.info(`Matched link source: Bilibili.`),await _({url:o,path:s})):b===d.AnimeIdHentai?(e.info(`Matched link source: AnimeIdHentai.`),await a({url:o,path:s||`./animeidhentai.mp4`,cwd:c},{...h,...v})):b===d.KoreanPM?(e.info(`Matched link source: KoreanPM.`),await f({url:o,path:s||`./korean-pm.mp4`,cwd:c},h)):b===d.MissAV?(e.info(`Matched link source: MissAV.`),await m({url:o,path:s,cwd:c})):b===d.Hanime?(e.info(`Matched link source: Hanime.`),await D({url:o,path:s,cwd:c})):b===d.Dirpy?(e.info(`Matched link source: Dirpy.`),r({url:o,path:s||`./dirpy.mp4`,cwd:c},h)):b===d.MP4?(e.info(`Matched link source: mp4.`),await u({url:o,path:s||`./mp4-download.mp4`,cwd:c})):b===d.M3U8?(e.info(`Matched link source: m3u8.`),await t({url:o,path:s||`./m3u8-download.mp4`,cwd:c})):e.error(`Your link is not supported!`)}export{y as DEFAULT_OPTIONS,d as UrlType,n as __dirname,b as defineConfig,a as downloadAnimeIdHentai,_ as downloadBilibili,r as downloadDirpy,D as downloadHanime,f as downloadKoreanPm,m as downloadMissav,u as downloadVideo,A as fastDownload,k as fastLink,p as getAnimeIdHentaiLink,i as getBilibiliLink,l as getDirpyLink,E as getHanimeLink,h as getKoreanPmLink,c as getMissavLink,t as remoteM3U8ToMP4};
@@ -0,0 +1,3 @@
1
+ import e from"axios";import{load as t}from"cheerio";import n from"node:path";import{fileURLToPath as r}from"node:url";import{createConfigLoader as i}from"unconfig";import a from"node:process";import{consola as o}from"consola";import s from"puppeteer-core";import c,{createWriteStream as l}from"node:fs";import u from"m3u8stream";var d=Object.create,f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),v=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=m(t),a=0,o=i.length,s;a<o;a++)s=i[a],!g.call(e,s)&&s!==n&&f(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=p(t,s))||r.enumerable});return e},y=(e,t,n)=>(n=e==null?{}:d(h(e)),v(t||!e||!e.__esModule?f(n,`default`,{value:e,enumerable:!0}):n,e)),b=`0.3.7`,x={name:`fast-dirpy`,type:`module`,version:b,description:`A simple library/CLI to download video from several websites.`,author:`Vincent-the-gamer`,license:`MIT`,homepage:`https://github.com/Vincent-the-gamer/fast-dirpy#readme`,repository:{type:`git`,url:`git+https://github.com/Vincent-the-gamer/fast-dirpy.git`},bugs:{url:`https://github.com/Vincent-the-gamer/fast-dirpy/issues`},sideEffects:!1,main:`dist/index.mjs`,module:`dist/index.mjs`,types:`dist/index.d.mts`,typesVersions:{"*":{".":[`./dist/index.d.mts`,`./dist/cli.d.mts`]}},bin:{"fast-dirpy":`bin/fast-dirpy.js`},files:[`dist`],scripts:{tsx:`tsx`,build:`tsdown`,test:`vitest`,dep:`taze major -I`,"lint:fix":`eslint . --fix`,login:`pnpm login --registry https://registry.npmjs.com`},publishConfig:{registry:`https://registry.npmjs.com`,access:`public`},dependencies:{ansis:`^4.2.0`,axios:`^1.13.2`,cac:`^6.7.14`,cheerio:`^1.1.2`,consola:`^3.4.2`,m3u8stream:`^0.8.6`,"puppeteer-core":`^24.31.0`,"restore-cursor":`^5.1.0`,unconfig:`^7.4.1`},devDependencies:{"@antfu/eslint-config":`^6.2.0`,"@types/node":`^24.10.1`,deepmerge:`^4.3.1`,eslint:`^9.39.1`,taze:`^19.9.2`,tsdown:`^0.16.8`,tsx:`^4.20.6`,typescript:`^5.9.3`,vitest:`^4.0.14`}};const S={timeout:2e4},C=r(import.meta.url),w=n.dirname(C);var T=_(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g}));const E=o.withTag(`fast-dirpy`);function D(e){`CONSOLA_LEVEL`in a.env||(E.level=e?0:3)}var O=y(T(),1);async function k(e,t){let n=S,{config:r,sources:a}=await i({sources:[{files:[`fast-dirpy.config`],extensions:[`ts`,`mts`,`cts`,`js`,`mjs`,`cjs`,`json`]}],cwd:t||process.cwd(),merge:!1}).load();return a.length?(E.info(`Config file found: ${a[0]}`),(0,O.default)((0,O.default)(n,r),e)):(0,O.default)(n,e)}async function A(e){return await s.launch(e)}function j(e){return e[Math.floor(Math.random()*e.length)]}const M=[`Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10`,`Mozilla/5.0 (Windows NT 6.1; rv,2.0.1) Gecko/20100101 Firefox/4.0.1`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36`,`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/27.0.1453.93 Chrome/27.0.1453.93 Safari/537.36`];function N(){return j(M)}async function P(t,n=S){let{path:r,url:i}=t,{proxy:a,timeout:o}=await k(n),s=a?.host===``?void 0:a;if(i===``)return Promise.reject(`Extract direct link failed!`);let l=c.createWriteStream(r||`./download.mp4`);return(await e({url:i,headers:{"User-Agent":N()},method:`GET`,responseType:`stream`,proxy:s,timeout:o,onDownloadProgress:e=>{let{loaded:t,total:n,progress:r}=e,i=`loaded:${t} total: ${n} progress: ${(r*100).toFixed(2)}%`;E.info(i)}})).data.pipe(l),new Promise((e,t)=>{l.on(`finish`,e),l.on(`error`,t)})}async function F(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(i,{headers:{"User-Agent":N()},proxy:c,timeout:s}),u=t(l),d=``,f=u(`div.embed.rad2 > iframe`).attr();return f&&(d=f.src),d}async function I(e,t=S){let{url:n,cwd:r}=e,{proxy:i,puppeteer:a}=await k(t,r),o=i?.host===``?void 0:i,s=await F({url:n},{proxy:o}),{executablePath:c,headless:l}=a,u=await A({executablePath:c,headless:l,args:[`--proxy-server=http://${o?.host}:${i?.port}`]}),d=N(),f=await u.newPage();await f.setUserAgent(d),await f.goto(s),await f.waitForSelector(`div.play.p-pulse`),await f.click(`div.play.p-pulse`),await f.waitForSelector(`div.frame > iframe`);let p=await f.$eval(`div.frame > iframe`,e=>e.src),m=await u.newPage();await m.goto(`${p}`),await m.waitForSelector(`video.jw-video.jw-reset`);let h=await m.$eval(`video.jw-video.jw-reset`,e=>e.src);return await u.close(),h}async function L(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await I({url:r},t),path:n,cwd:i},t)}function R(e){let t=e.match(/BV[a-zA-Z0-9]+/);return t?`https://bilibili-real-url.deno.dev/${t[0]}.mp4`:``}async function z(e){let{path:t,url:n}=e,r=R(n);r===``?console.error(`Extract direct link failed!`):await P({url:r,path:t||`./download.mp4`})}async function B(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(`https://dirpy.com/studio`,{params:{url:i},headers:{"User-Agent":N(),Referer:`https://dirpy.com/studio?url=${i}`},proxy:c,timeout:s}),u=t(l),d=``,f=u(`#media-source`).attr();return f&&(d=f.src),d}async function V(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await B({url:r},t),path:n,cwd:i},t)}async function H(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(i,{headers:{"User-Agent":N()},proxy:c,timeout:s}),u=t(l),d=``,f=u(`meta[itemprop="contentURL"]`).attr();return f&&(d=f.content),d}async function U(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await H({url:r},t),path:n,cwd:i},t)}function W(e){let{url:t,path:r}=e,i=r??n.resolve(w,`../m3u8-download.mp4`),a=u(t);a.pipe(l(i)),a.on(`progress`,(e,t,n)=>{E.info(`Segment: ${JSON.stringify(e)},
2
+ Total Segments: ${t},
3
+ downloaded: ${(n/1024/1024).toFixed(2)}MB Downloaded`),e.num>=t&&a.end()})}function G(e){return new Promise(t=>setTimeout(t,e*1e3))}async function K(e,t=S){let{url:n,cwd:r}=e,{proxy:i,puppeteer:a}=await k(t,r),o=i?.host===``?void 0:i,{executablePath:s,headless:c}=a,l=await A({executablePath:s,headless:c,args:[`--proxy-server=http://${o?.host}:${i?.port}`,`--disable-features=IsolateOrigins,site-per-process`,`--disable-site-isolation-trials`,`--disable-web-security`,`--disable-setuid-sandbox`,`--no-sandbox`,`--disable-gpu`,`--disable-dev-shm-usage`,`--disable-accelerated-2d-canvas`,`--no-first-run`,`--no-zygote`,`--single-process`,`--window-size=1920,1080`],slowMo:50,timezoneId:`America/New_York`,locale:`en-US`}),u=await l.newPage(),d=N();await u.setUserAgent(d);try{let e=await u.goto(n,{waitUntil:`domcontentloaded`});e&&E.info(`http status: ${e.status()}`);let t=await u.title(),r=await u.content();if(E.info(`Page title: ${t}`),t.includes(`Just a moment`)||r.includes(`Checking your browser`)){E.info(`Cloudflare challenge detected, waiting for it to complete...`);try{E.info(`Waiting for page title to change...`),await u.waitForFunction(`document.title != 'Just a moment...'`,{timeout:3e4}),E.info(`Page title has changed`)}catch(e){E.error(`Timeout waiting for title change: ${e}`);try{for(let e of[`input[type='checkbox']`,`.ray-button`,`#challenge-stage button`,`button:has-text('Verify')`,`button:has-text('Continue')`])if(await u.$(e)){E.info(`Found possible verification button: ${e}`),await u.click(e),G(5);break}}catch(e){E.error(`Failed to click verification button: ${e}`)}}}let i=await u.title();E.info(`current page title: ${i}`),E.info(`Simulating page scroll...`);for(let e=0;e<3;e++)await u.evaluate(`window.scrollBy(0, window.innerHeight / 2)`),await u.evaluate(`window.scrollBy(0, window.innerHeight / 4)`);E.info(`Getting page content...`);let a=await u.content();return E.info(`Page content retrieved successfully.`),a}catch(e){E.error(`Error during scraping: ${e}`)}finally{E.info(`Closing browser`),await l.close()}}async function q(e){let t=e.match(/m3u8\|([a-f0-9|]+)\|com\|surrit\|https\|video/);return t?t[1].split(`|`).reverse().join(`-`):(E.error(`Failed to extract UUID from HTML.`),null)}function J(e){return e.split(`/`).pop()||(E.error(`Failed to extract movie ID from URL.`),null)}async function Y(t){let{url:n,cwd:r}=t,i=await q(await K({url:n,cwd:r})),a=`https://surrit.com/${i}/playlist.m3u8`,{data:o}=await e.get(a),s=o.match(/(?:\d+p|\d+x\d+)\/video\.m3u8/g);return`https://surrit.com/${i}/${s[s.length-1]}`}async function X(e){let{url:t,cwd:n,path:r}=e,i=J(t);await W({url:await Y({url:t,cwd:n}),cwd:n,path:r||`${i}.mp4`})}let Z=function(e){return e[e.Bilibili=0]=`Bilibili`,e[e.AnimeIdHentai=1]=`AnimeIdHentai`,e[e.Dirpy=2]=`Dirpy`,e[e.M3U8=3]=`M3U8`,e[e.KoreanPM=4]=`KoreanPM`,e[e.MissAV=5]=`MissAV`,e[e.Hanime=6]=`Hanime`,e[e.MP4=7]=`MP4`,e}({});function Q(e){return e.includes(`bilibili`)||/BV[a-zA-Z0-9]+/.test(e)?Z.Bilibili:e.includes(`animeidhentai`)?Z.AnimeIdHentai:e.includes(`koreanpornmovie`)?Z.KoreanPM:e.includes(`missav`)?Z.MissAV:e.includes(`hanime1.me`)?Z.Hanime:e.endsWith(`.m3u8`)||e.includes(`.m3u8`)&&!e.endsWith(`.mp4`)?Z.M3U8:e.endsWith(`.mp4`)||e.includes(`.mp4`)&&!e.endsWith(`.m3u8`)?Z.MP4:Z.Dirpy}export{b as S,E as _,W as a,w as b,V as c,R as d,L as f,k as g,N as h,Y as i,B as l,P as m,Z as n,U as o,I as p,X as r,H as s,Q as t,z as u,D as v,x,S as y};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fast-dirpy",
3
3
  "type": "module",
4
- "version": "0.3.6",
4
+ "version": "0.3.7",
5
5
  "description": "A simple library/CLI to download video from several websites.",
6
6
  "author": "Vincent-the-gamer",
7
7
  "license": "MIT",
@@ -42,20 +42,20 @@
42
42
  "cheerio": "^1.1.2",
43
43
  "consola": "^3.4.2",
44
44
  "m3u8stream": "^0.8.6",
45
- "puppeteer-core": "^24.29.1",
45
+ "puppeteer-core": "^24.31.0",
46
46
  "restore-cursor": "^5.1.0",
47
- "unconfig": "^7.4.0"
47
+ "unconfig": "^7.4.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@antfu/eslint-config": "^6.2.0",
51
- "@types/node": "^24.10.0",
51
+ "@types/node": "^24.10.1",
52
52
  "deepmerge": "^4.3.1",
53
53
  "eslint": "^9.39.1",
54
- "taze": "^19.9.0",
55
- "tsdown": "^0.16.1",
54
+ "taze": "^19.9.2",
55
+ "tsdown": "^0.16.8",
56
56
  "tsx": "^4.20.6",
57
57
  "typescript": "^5.9.3",
58
- "vitest": "^4.0.8"
58
+ "vitest": "^4.0.14"
59
59
  },
60
60
  "scripts": {
61
61
  "tsx": "tsx",
@@ -1,3 +0,0 @@
1
- import e from"axios";import{load as t}from"cheerio";import n from"node:path";import{fileURLToPath as r}from"node:url";import{createConfigLoader as i}from"unconfig";import a from"node:process";import{consola as o}from"consola";import s from"puppeteer-core";import c,{createWriteStream as l}from"node:fs";import u from"m3u8stream";var d=Object.create,f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),v=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=m(t),a=0,o=i.length,s;a<o;a++)s=i[a],!g.call(e,s)&&s!==n&&f(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=p(t,s))||r.enumerable});return e},y=(e,t,n)=>(n=e==null?{}:d(h(e)),v(t||!e||!e.__esModule?f(n,`default`,{value:e,enumerable:!0}):n,e)),b=`0.3.6`,x={name:`fast-dirpy`,type:`module`,version:b,description:`A simple library/CLI to download video from several websites.`,author:`Vincent-the-gamer`,license:`MIT`,homepage:`https://github.com/Vincent-the-gamer/fast-dirpy#readme`,repository:{type:`git`,url:`git+https://github.com/Vincent-the-gamer/fast-dirpy.git`},bugs:{url:`https://github.com/Vincent-the-gamer/fast-dirpy/issues`},sideEffects:!1,main:`dist/index.mjs`,module:`dist/index.mjs`,types:`dist/index.d.mts`,typesVersions:{"*":{".":[`./dist/index.d.mts`,`./dist/cli.d.mts`]}},bin:{"fast-dirpy":`bin/fast-dirpy.js`},files:[`dist`],scripts:{tsx:`tsx`,build:`tsdown`,test:`vitest`,dep:`taze major -I`,"lint:fix":`eslint . --fix`,login:`pnpm login --registry https://registry.npmjs.com`},publishConfig:{registry:`https://registry.npmjs.com`,access:`public`},dependencies:{ansis:`^4.2.0`,axios:`^1.13.2`,cac:`^6.7.14`,cheerio:`^1.1.2`,consola:`^3.4.2`,m3u8stream:`^0.8.6`,"puppeteer-core":`^24.29.1`,"restore-cursor":`^5.1.0`,unconfig:`^7.4.0`},devDependencies:{"@antfu/eslint-config":`^6.2.0`,"@types/node":`^24.10.0`,deepmerge:`^4.3.1`,eslint:`^9.39.1`,taze:`^19.9.0`,tsdown:`^0.16.1`,tsx:`^4.20.6`,typescript:`^5.9.3`,vitest:`^4.0.8`}};const S={timeout:2e4},C=r(import.meta.url),w=n.dirname(C);var T=_(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(p(e,i)&&n.isMergeableObject(t[i])?r[i]=u(i,n)(e[i],t[i],n):r[i]=c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g}));const E=o.withTag(`fast-dirpy`);function D(e){`CONSOLA_LEVEL`in a.env||(E.level=e?0:3)}var O=y(T(),1);async function k(e,t){let n=S,{config:r,sources:a}=await i({sources:[{files:[`fast-dirpy.config`],extensions:[`ts`,`mts`,`cts`,`js`,`mjs`,`cjs`,`json`]}],cwd:t||process.cwd(),merge:!1}).load();return a.length?(E.info(`Config file found: ${a[0]}`),(0,O.default)((0,O.default)(n,r),e)):(0,O.default)(n,e)}async function A(e){return await s.launch(e)}function j(e){return e[Math.floor(Math.random()*e.length)]}const M=[`Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10`,`Mozilla/5.0 (Windows NT 6.1; rv,2.0.1) Gecko/20100101 Firefox/4.0.1`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.36`,`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/11.10 Chromium/27.0.1453.93 Chrome/27.0.1453.93 Safari/537.36`];function N(){return j(M)}async function P(t,n=S){let{path:r,url:i}=t,{proxy:a,timeout:o}=await k(n),s=a?.host===``?void 0:a;if(i===``)return Promise.reject(`Extract direct link failed!`);let l=c.createWriteStream(r);return(await e({url:i,headers:{"User-Agent":N()},method:`GET`,responseType:`stream`,proxy:s,timeout:o,onDownloadProgress:e=>{let{loaded:t,total:n,progress:r}=e,i=`loaded:${t} total: ${n} progress: ${(r*100).toFixed(2)}%`;E.info(i)}})).data.pipe(l),new Promise((e,t)=>{l.on(`finish`,e),l.on(`error`,t)})}async function F(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(i,{headers:{"User-Agent":N()},proxy:c,timeout:s}),u=t(l),d=``,f=u(`div.embed.rad2 > iframe`).attr();return f&&(d=f.src),d}async function I(e,t=S){let{url:n,cwd:r}=e,{proxy:i,puppeteer:a}=await k(t,r),o=i?.host===``?void 0:i,s=await F({url:n},{proxy:o}),{executablePath:c,headless:l}=a,u=await A({executablePath:c,headless:l,args:[`--proxy-server=http://${o?.host}:${i?.port}`]}),d=N(),f=await u.newPage();await f.setUserAgent(d),await f.goto(s),await f.waitForSelector(`div.play.p-pulse`),await f.click(`div.play.p-pulse`),await f.waitForSelector(`div.frame > iframe`);let p=await f.$eval(`div.frame > iframe`,e=>e.src),m=await u.newPage();await m.goto(`${p}`),await m.waitForSelector(`video.jw-video.jw-reset`);let h=await m.$eval(`video.jw-video.jw-reset`,e=>e.src);return await u.close(),h}async function L(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await I({url:r},t),path:n,cwd:i},t)}function R(e){let t=e.match(/BV[a-zA-Z0-9]+/);return t?`https://bilibili-real-url.deno.dev/${t[0]}.mp4`:``}async function z(e){let{path:t,url:n}=e,r=R(n);r===``?console.error(`Extract direct link failed!`):await P({url:r,path:t||`./download.mp4`})}async function B(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(`https://dirpy.com/studio`,{params:{url:i},headers:{"User-Agent":N(),Referer:`https://dirpy.com/studio?url=${i}`},proxy:c,timeout:s}),u=t(l),d=``,f=u(`#media-source`).attr();return f&&(d=f.src),d}async function V(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await B({url:r},t),path:n,cwd:i},t)}async function H(n,r=S){let{url:i,cwd:a}=n,{proxy:o,timeout:s}=await k(r,a),c=o?.host===``?void 0:o,{data:l}=await e.get(i,{headers:{"User-Agent":N()},proxy:c,timeout:s}),u=t(l),d=``,f=u(`meta[itemprop="contentURL"]`).attr();return f&&(d=f.content),d}async function U(e,t=S){let{path:n,url:r,cwd:i}=e;await P({url:await H({url:r},t),path:n,cwd:i},t)}function W(e){let{url:t,path:r}=e,i=r??n.resolve(w,`../m3u8-download.mp4`),a=u(t);a.pipe(l(i)),a.on(`progress`,(e,t,n)=>{E.info(`Segment: ${JSON.stringify(e)},
2
- Total Segments: ${t},
3
- downloaded: ${(n/1024/1024).toFixed(2)}MB Downloaded`),e.num>=t&&a.end()})}function G(e){return new Promise(t=>setTimeout(t,e*1e3))}async function K(e,t=S){let{url:n,cwd:r}=e,{proxy:i,puppeteer:a}=await k(t,r),o=i?.host===``?void 0:i,{executablePath:s,headless:c}=a,l=await A({executablePath:s,headless:c,args:[`--proxy-server=http://${o?.host}:${i?.port}`,`--disable-features=IsolateOrigins,site-per-process`,`--disable-site-isolation-trials`,`--disable-web-security`,`--disable-setuid-sandbox`,`--no-sandbox`,`--disable-gpu`,`--disable-dev-shm-usage`,`--disable-accelerated-2d-canvas`,`--no-first-run`,`--no-zygote`,`--single-process`,`--window-size=1920,1080`],slowMo:50,timezoneId:`America/New_York`,locale:`en-US`}),u=await l.newPage(),d=N();await u.setUserAgent(d);try{let e=await u.goto(n,{waitUntil:`domcontentloaded`});e&&E.info(`http status: ${e.status()}`);let t=await u.title(),r=await u.content();if(E.info(`Page title: ${t}`),t.includes(`Just a moment`)||r.includes(`Checking your browser`)){E.info(`Cloudflare challenge detected, waiting for it to complete...`);try{E.info(`Waiting for page title to change...`),await u.waitForFunction(`document.title != 'Just a moment...'`,{timeout:3e4}),E.info(`Page title has changed`)}catch(e){E.error(`Timeout waiting for title change: ${e}`);try{for(let e of[`input[type='checkbox']`,`.ray-button`,`#challenge-stage button`,`button:has-text('Verify')`,`button:has-text('Continue')`])if(await u.$(e)){E.info(`Found possible verification button: ${e}`),await u.click(e),G(5);break}}catch(e){E.error(`Failed to click verification button: ${e}`)}}}let i=await u.title();E.info(`current page title: ${i}`),E.info(`Simulating page scroll...`);for(let e=0;e<3;e++)await u.evaluate(`window.scrollBy(0, window.innerHeight / 2)`),await u.evaluate(`window.scrollBy(0, window.innerHeight / 4)`);E.info(`Getting page content...`);let a=await u.content();return E.info(`Page content retrieved successfully.`),a}catch(e){E.error(`Error during scraping: ${e}`)}finally{E.info(`Closing browser`),await l.close()}}async function q(e){let t=e.match(/m3u8\|([a-f0-9|]+)\|com\|surrit\|https\|video/);return t?t[1].split(`|`).reverse().join(`-`):(E.error(`Failed to extract UUID from HTML.`),null)}function J(e){return e.split(`/`).pop()||(E.error(`Failed to extract movie ID from URL.`),null)}async function Y(t){let{url:n,cwd:r}=t,i=await q(await K({url:n,cwd:r})),a=`https://surrit.com/${i}/playlist.m3u8`,{data:o}=await e.get(a),s=o.match(/(?:\d+p|\d+x\d+)\/video\.m3u8/g);return`https://surrit.com/${i}/${s[s.length-1]}`}async function X(e){let{url:t,cwd:n,path:r}=e,i=J(t);await W({url:await Y({url:t,cwd:n}),cwd:n,path:r||`${i}.mp4`})}let Z=function(e){return e[e.Bilibili=0]=`Bilibili`,e[e.AnimeIdHentai=1]=`AnimeIdHentai`,e[e.Dirpy=2]=`Dirpy`,e[e.M3U8=3]=`M3U8`,e[e.KoreanPM=4]=`KoreanPM`,e[e.MissAV=5]=`MissAV`,e[e.MP4=6]=`MP4`,e}({});function Q(e){return e.includes(`bilibili`)||/BV[a-zA-Z0-9]+/.test(e)?Z.Bilibili:e.includes(`animeidhentai`)?Z.AnimeIdHentai:e.includes(`koreanpornmovie`)?Z.KoreanPM:e.includes(`missav`)?Z.MissAV:e.endsWith(`.m3u8`)||e.includes(`.m3u8`)&&!e.endsWith(`.mp4`)?Z.M3U8:e.endsWith(`.mp4`)||e.includes(`.mp4`)&&!e.endsWith(`.m3u8`)?Z.MP4:Z.Dirpy}export{S as _,W as a,b,V as c,R as d,L as f,D as g,E as h,Y as i,B as l,P as m,Z as n,U as o,I as p,X as r,H as s,Q as t,z as u,w as v,x as y};