patreon-dl 3.7.0 → 3.7.1
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 +17 -1
- package/dist/browse/web/assets/index-CQnQD2xz.css +1 -0
- package/dist/browse/web/index.html +2 -2
- package/dist/cli/CLIOptions.js +2 -0
- package/dist/cli/CLIOptions.js.map +1 -1
- package/dist/cli/ConfigFileParser.js +2 -0
- package/dist/cli/ConfigFileParser.js.map +1 -1
- package/dist/downloaders/DownloaderOptions.d.ts +1 -0
- package/dist/downloaders/DownloaderOptions.js +2 -0
- package/dist/downloaders/DownloaderOptions.js.map +1 -1
- package/dist/downloaders/task/M3U8DownloadTask.d.ts +1 -0
- package/dist/downloaders/task/M3U8DownloadTask.js +137 -39
- package/dist/downloaders/task/M3U8DownloadTask.js.map +1 -1
- package/dist/parsers/PageParser.js +1 -1
- package/dist/parsers/PageParser.js.map +1 -1
- package/dist/utils/Fetcher.d.ts +4 -1
- package/dist/utils/Fetcher.js +6 -1
- package/dist/utils/Fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/browse/web/assets/index-CW4CUoWl.css +0 -1
- /package/dist/browse/web/assets/{index-CziUWlSw.js → index-B1h15ViZ.js} +0 -0
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ This repo contains the `patreon-dl` library and its command-line tool. For GUI a
|
|
|
11
11
|
- Download posts by user, in a collection or single post.
|
|
12
12
|
- Download products (aka shop purchases)
|
|
13
13
|
- Items included in downloads:
|
|
14
|
-
- videos
|
|
14
|
+
- videos - but see [limitations](#limitations) on Patreon-hosted videos
|
|
15
15
|
- images
|
|
16
16
|
- audio
|
|
17
17
|
- attachments
|
|
@@ -26,12 +26,23 @@ You can run `patreon-dl` from the command-line or [use it as a library](./docs/L
|
|
|
26
26
|
|
|
27
27
|
### Limitations
|
|
28
28
|
|
|
29
|
+
**Embedded videos / links**
|
|
30
|
+
|
|
29
31
|
- Embedded links are not followed; only info about the embed is saved. Exception:
|
|
30
32
|
- YouTube video link - in which case the video is downloaded; or
|
|
31
33
|
- An external downloader is configured for the link provider.
|
|
32
34
|
|
|
33
35
|
For information on external downloaders, see the [Embedded videos / links - external downloader](#embedded-videos--links---external-downloader) section. Example config is provided for fetching YouTube (replacing the built-in downloader) and Vimeo videos.
|
|
34
36
|
|
|
37
|
+
**Patreon-hosted videos with DRM protection**
|
|
38
|
+
|
|
39
|
+
Some videos served by Patreon are now protected with DRM. Because these videos require a real-time decryption key available only during authorized streaming, they cannot be played back normally after being downloaded.
|
|
40
|
+
|
|
41
|
+
By default, `patreon-dl` will skip DRM-protected content to avoid broken downloads. If you still wish to download these files, you can force the download using:
|
|
42
|
+
|
|
43
|
+
- CLI: Use the `protected.media` option (see [example.conf](./example.conf)).
|
|
44
|
+
- Library: Use the `include.protectedMedia` option (see [documentation](./docs/Library.md)).
|
|
45
|
+
|
|
35
46
|
### FFmpeg dependency
|
|
36
47
|
|
|
37
48
|
[FFmpeg](https://ffmpeg.org) is required when downloading:
|
|
@@ -203,6 +214,7 @@ include.posts.in.tier = 123456, 789100
|
|
|
203
214
|
# include.content.info
|
|
204
215
|
# include.preview.media
|
|
205
216
|
# include.content.media
|
|
217
|
+
# include.protected.media
|
|
206
218
|
# include.all.media.variants
|
|
207
219
|
# include.images.by.filename
|
|
208
220
|
# include.audio.by.filename
|
|
@@ -293,6 +305,10 @@ Note the URL shown in the output. Open this URL in a web browser to begin viewin
|
|
|
293
305
|
|
|
294
306
|
## Changelog
|
|
295
307
|
|
|
308
|
+
3.7.1
|
|
309
|
+
- Check and skip download of Patreon-hosted videos that are protected by DRM; add `include.protectedMedia` / `protected.media` option.
|
|
310
|
+
- Fix campaign not found when targeting collections ([#124](https://github.com/patrickkfkan/patreon-dl/issues/124)).
|
|
311
|
+
|
|
296
312
|
v3.7.0
|
|
297
313
|
- Vimeo download script: fetch full player URL ([#118](https://github.com/patrickkfkan/patreon-dl/issues/118))
|
|
298
314
|
- Fix downloaded posts missing content / teaser ([@Fabelwesen](https://github.com/Fabelwesen) - [#119](https://github.com/patrickkfkan/patreon-dl/issues/119))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";@font-face{font-family:Material Icons;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-kAwBdRge.woff2) format("woff2"),url(/assets/material-icons-Dr0goTwe.woff) format("woff")}.material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Outlined;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-outlined-DZhiGvEA.woff2) format("woff2"),url(/assets/material-icons-outlined-BpWbwl2n.woff) format("woff")}.material-icons-outlined{font-family:Material Icons Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Round;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-round-DrirKXBx.woff2) format("woff2"),url(/assets/material-icons-round-BDlwx-sv.woff) format("woff")}.material-icons-round{font-family:Material Icons Round;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Sharp;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-sharp-gidztirS.woff2) format("woff2"),url(/assets/material-icons-sharp-CH1KkVu7.woff) format("woff")}.material-icons-sharp{font-family:Material Icons Sharp;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}@font-face{font-family:Material Icons Two Tone;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-icons-two-tone-DuNIpaEj.woff2) format("woff2"),url(/assets/material-icons-two-tone-B7wz7mED.woff) format("woff")}.material-icons-two-tone{font-family:Material Icons Two Tone;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;font-feature-settings:"liga"}a{text-decoration:none}.campaign-list.mw-narrower{max-width:40.5em}.campaign-list.mw-standard{max-width:47.5em}.campaign-list.mw-wider{max-width:54.5em}.campaign-card{overflow:hidden}.campaign-card__avatar{height:6.5em;aspect-ratio:1;object-fit:cover}.campaign-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-weight:700}.campaign-card__creation-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.campaign-card__count-icon{font-size:1.2em!important;margin-right:.3em}.campaign-card__count-text{font-size:1em}.custom-scrollbars__track-vertical{top:0;bottom:0;right:0;background:var(--bs-secondary);opacity:.2;border-radius:3px}.custom-scrollbars__track-horizontal{left:0;right:0;bottom:0;background:var(--bs-secondary);opacity:.2;border-radius:3px}.custom-scrollbars__thumb-vertical,.custom-scrollbars__thumb-horizontal{border-radius:3px;background:var(--bs-light);opacity:.2}.sidebar{width:100%;height:100vh;border-radius:0}.sidebar__header{background:var(--bs-card-bg)}.sidebar__brand a{color:inherit}.sidebar__section-title{color:var(--bs-body-color);font-weight:700;font-size:.9em}.sidebar__main{display:flex;flex-direction:column}.sidebar__link{display:flex;align-items:center;color:var(--bs-body-color);transition:color .15s}.sidebar__link:hover{color:var(--bs-link-hover-color)}.sidebar__link-icon{width:1.5em;height:1.5em;object-fit:cover}.sidebar__link-icon--svg{fill:var(--bs-body-color)}.sidebar__link-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-size:.9em}.sidebar-trigger{text-decoration:none;color:var(--bs-body-color);transition:color .15s}.sidebar-trigger:hover{color:var(--bs-link-hover-color)}.campaign-content{width:100%}.campaign-content--post.mw-narrower{max-width:40.5em}.campaign-content--post.mw-standard{max-width:47.5em}.campaign-content--post.mw-wider{max-width:54.5em}.post-card{overflow:hidden}.post-card__inline-media-wrapper{text-align:center}.post-card__inline-media-wrapper img{max-width:100%}.post-card__inline-media-caption,.post-card__external-embed-caption{font-size:smaller}.post-card__external-embed-wrapper{text-align:center}.post-card__external-embed>iframe{width:100%;height:100%}.post-card__content img{max-width:100%}.post-card__content p:not(:first-child){margin:1rem 0}.media-grid{display:grid;position:relative;max-height:32em;gap:1px;background:var(--bs-card-border-color);border-bottom:var(--bs-card-border-color)}.media-grid--1{grid-template-rows:1fr;grid-template-columns:1fr;grid-template-areas:"a"}.media-grid--2{grid-template-rows:1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b"}.media-grid--3{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b" "a c"}.media-grid--4{grid-template-rows:1fr 1fr;grid-template-columns:1fr 1fr;grid-template-areas:"a b" "c d"}.media-grid__item-wrapper{width:100%;position:relative}.media-grid__item-wrapper:nth-child(1){grid-area:a}.media-grid__item-wrapper:nth-child(2){grid-area:b}.media-grid__item-wrapper:nth-child(3){grid-area:c}.media-grid__item-wrapper:nth-child(4){grid-area:d}.media-grid__thumbnail-backdrop{width:100%;height:100%;position:absolute;background-size:cover;filter:blur(1em);transform:scale(1.5)}.media-grid__thumbnail-wrapper{width:100%;height:100%;z-index:1000;cursor:pointer}.media-grid__thumbnail-wrapper--video:before{content:"";font-family:Material Icons Outlined;font-size:4em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;transition:opacity .15s ease-in-out;opacity:.8}.media-grid__thumbnail-wrapper--video:hover:before{opacity:1}.media-grid__thumbnail{width:100%;height:100%;object-fit:contain}.media-grid__badge{position:absolute;font-size:1em;bottom:1em;left:1em;z-index:1001}@font-face{font-family:lg;src:url(data:font/woff2;base64,d09GMgABAAAAAAkcAAsAAAAAEogAAAjNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgSQRCAqcLJZKCzoAATYCJANwBCAFgkoHIBupDgDm53Gzej8JpU0wqygVVyoWwphIsuuw60jpmBY6ppTa7mk7jtx57UQ0V2ulvfmteSIQji061T2HvfDEECASKizU5VUQXFjFRtgYTVg+woiYDVezOThR4tAvr/YYgOO/RZ+BAABzYtMA8Kl8Neg3UIDCoCkOyWBuLcCvSHycH78QvhFxmUCK03A0RwGSvXBAHgR8UB8DMvocJYAgbiZiJnqmYGbXjG3mz7P8nHhe8Uvxr0j+fzwPABAjWT1E83IJHh/x87G/jv1l7JtYR+y+WF2MKAai/qfDtfIRt7hBikI8D1IpipXqWqYSDgDBfwE7qDLw5EEALqFRDMKAsApNwchXAJgFL/WETMbKcDVSifR6QkjwkDaRTEugqlBtKVcL6Smi1dHlIqUmuii6Pic1JTIlFTX3uRenMNpiCiKOCZBm2ges0b/ScigDVgcb2MEHfloel7e1z208KrZUeQFjK0dIkbl6FOFczRhFE6zaRklPlz52tOXcKtmpdqisgHnbxRatg66vsZNHaWMPQ/eZmH6jaavlNASsipbKwVZSYrRm1mywI0670UEdhLy+yuscolSZJHKwg5IyNzRJQbKRZiicwnYiChjO1vSbKCBpkAgCjGIb6KCvA5GL0VHeUDwAQEHkSC2ToBJhKN9KAneim2ekLf1vENf3mjT3vAS295XY2MMgzRpSqTVWpt4ang+ksXynRUQPlkFOu+b6Yw0jBp8krbXbYbjc5mn6KpsNWKtqtcNz0D8xTTQKzthbZYAxLev3Nk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ZHUyUW88R/abjA/OxeYpIa9sNmNGMqHbMgd2CAZPzVuOfQFg5H275pWwx73mQMODQAAAA==) format("woff2"),url(/assets/lg-oyjwlqP2.ttf?io9a6k) format("truetype"),url(/assets/lg-CosQH4Cu.woff?io9a6k) format("woff"),url(/assets/lg-B0dIV2BS.svg?io9a6k#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-container{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Liberation Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.lg-next,.lg-prev{background-color:#00000073;border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1084;outline:none;border:none}.lg-next.disabled,.lg-prev.disabled{opacity:0!important;cursor:default}.lg-next:hover:not(.disabled),.lg-prev:hover:not(.disabled){color:#fff}.lg-single-item .lg-next,.lg-single-item .lg-prev{display:none}.lg-next{right:20px}.lg-next:before{content:""}.lg-prev{left:20px}.lg-prev:after{content:""}@-webkit-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-moz-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-ms-keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@keyframes lg-right-end{0%{left:0}50%{left:-30px}to{left:0}}@-webkit-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@-moz-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@-ms-keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}@keyframes lg-left-end{0%{left:0}50%{left:30px}to{left:0}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-media-overlap .lg-toolbar{background-image:linear-gradient(0deg,#0000,#0006)}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:medium none;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear;background:none;border:none;box-shadow:none}.lg-toolbar .lg-icon.lg-icon-18{font-size:18px}.lg-toolbar .lg-icon:hover{color:#fff}.lg-toolbar .lg-close:after{content:""}.lg-toolbar .lg-maximize{font-size:22px}.lg-toolbar .lg-maximize:after{content:""}.lg-toolbar .lg-download:after{content:""}.lg-sub-html{color:#eee;font-size:16px;padding:10px 40px;text-align:center;z-index:1080;opacity:0;-webkit-transition:opacity .2s ease-out 0s;-o-transition:opacity .2s ease-out 0s;transition:opacity .2s ease-out 0s}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}.lg-sub-html a{color:inherit}.lg-sub-html a:hover{text-decoration:underline}.lg-media-overlap .lg-sub-html{background-image:linear-gradient(180deg,#0000,#0009)}.lg-item .lg-sub-html{position:absolute;bottom:0;right:0;left:0}.lg-error-msg{font-size:14px;color:#999}.lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;height:47px;vertical-align:middle}.lg-closing .lg-toolbar,.lg-closing .lg-prev,.lg-closing .lg-next,.lg-closing .lg-sub-html{opacity:0;-webkit-transition:-webkit-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-moz-transition:-moz-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-o-transition:-o-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;transition:transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-video-cont,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-media-cont{opacity:0;-moz-transform:scale3d(.5,.5,.5);-o-transform:scale3d(.5,.5,.5);-ms-transform:scale3d(.5,.5,.5);-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1)!important}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-video-cont,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-media-cont{opacity:1;-moz-transform:scale3d(1,1,1);-o-transform:scale3d(1,1,1);-ms-transform:scale3d(1,1,1);-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}.lg-icon:focus-visible{color:#fff;border-radius:3px;outline:1px dashed rgba(255,255,255,.6)}.lg-toolbar .lg-icon:focus-visible{border-radius:8px;outline-offset:-5px}.lg-group:after{content:"";display:table;clear:both}.lg-container{display:none;outline:none}.lg-on{scroll-behavior:unset}.lg-overlay-open{overflow:hidden}.lg-toolbar,.lg-prev,.lg-next,.lg-pager-outer,.lg-hide-sub-html .lg-sub-html{opacity:0;will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s}.lg-show-in .lg-toolbar,.lg-show-in .lg-prev,.lg-show-in .lg-next,.lg-show-in .lg-pager-outer,.lg-show-in.lg-hide-sub-html .lg-sub-html{opacity:1}.lg-show-in .lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-show-in .lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-show-in .lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html{opacity:0;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.lg-outer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:.001;outline:none;will-change:auto;overflow:hidden;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-zoom-from-image,.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-content{position:absolute;top:0;left:0;right:0;bottom:0}.lg-outer .lg-inner{width:100%;position:absolute;left:0;top:0;bottom:0;-webkit-transition:opacity 0s;-o-transition:opacity 0s;transition:opacity 0s;white-space:nowrap}.lg-outer .lg-item{display:none!important}.lg-outer .lg-item:not(.lg-start-end-progress){background:url(/assets/loading-BZOHaeKn.gif) no-repeat scroll center center transparent}.lg-outer.lg-css3 .lg-prev-slide,.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css .lg-current{display:inline-block!important}.lg-outer .lg-item,.lg-outer .lg-img-wrap{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-item:before,.lg-outer .lg-img-wrap:before{content:"";display:inline-block;height:100%;vertical-align:middle}.lg-outer .lg-img-wrap{position:absolute;left:0;right:0;top:0;bottom:0;white-space:nowrap;font-size:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-object{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto;height:auto;position:relative}.lg-outer .lg-empty-html.lg-sub-html,.lg-outer .lg-empty-html .lg-sub-html{display:none}.lg-outer.lg-hide-download .lg-download{opacity:.75;pointer-events:none}.lg-outer .lg-first-slide .lg-dummy-img{position:absolute;top:50%;left:50%}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components{-webkit-transform:translate3d(0,0%,0);transform:translateZ(0);opacity:1}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html{opacity:1;transition:opacity .2s ease-out .15s}.lg-outer .lg-media-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-media-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-media-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;will-change:auto;-webkit-transition:opacity 333ms ease-in 0s;-o-transition:opacity 333ms ease-in 0s;transition:opacity 333ms ease-in 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-prev-slide,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-current{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-prev-slide,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-current{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-moz-transition:-moz-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-o-transition:-o-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;transition:transform 1s cubic-bezier(.175,.885,.32,1.275) 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translateZ(0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-container{display:none}.lg-container.lg-show{display:block}.lg-container.lg-dragging-vertical .lg-backdrop{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-inline .lg-backdrop,.lg-inline .lg-outer{position:absolute}.lg-inline .lg-backdrop{z-index:1}.lg-inline .lg-outer{z-index:2}.lg-inline .lg-maximize:after{content:""}.lg-components{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);will-change:transform;-webkit-transition:-webkit-transform .35s ease-out 0s;-moz-transition:-moz-transform .35s ease-out 0s;-o-transition:-o-transform .35s ease-out 0s;transition:transform .35s ease-out 0s;z-index:1080;position:absolute;bottom:0;right:0;left:0}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transition-duration:0ms!important;transition-duration:0ms!important}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s}.lg-outer.lg-use-transition-for-zoom.lg-zoom-drag-transition .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .8s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .8s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .8s cubic-bezier(0,0,.25,1) 0s;transition:transform .8s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translateZ(0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1);-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.no-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.no-transition{transition:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition{transform:scaleZ(1) translate3d(-50%,-50%,0)!important;max-width:none!important;max-height:none!important;top:50%!important;left:50%!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-x,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-x{transform:scaleZ(1) translate3d(-50%,0,0)!important;top:0!important;left:50%!important;max-width:none!important;max-height:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-y,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-y{transform:scaleZ(1) translate3d(0,-50%,0)!important;top:50%!important;left:0%!important;max-width:none!important;max-height:none!important}.lg-icon.lg-zoom-in:after{content:""}.lg-actual-size .lg-icon.lg-zoom-in{opacity:1;pointer-events:auto}.lg-icon.lg-actual-size{font-size:20px}.lg-icon.lg-actual-size:after{content:""}.lg-icon.lg-zoom-out{opacity:.5;pointer-events:none}.lg-icon.lg-zoom-out:after{content:""}.lg-zoomed .lg-icon.lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer[data-lg-slide-type=video] .lg-zoom-in,.lg-outer[data-lg-slide-type=video] .lg-actual-size,.lg-outer[data-lg-slide-type=video] .lg-zoom-out,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-in,.lg-outer[data-lg-slide-type=iframe] .lg-actual-size,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-out,.lg-outer.lg-first-slide-loading .lg-zoom-in,.lg-outer.lg-first-slide-loading .lg-actual-size,.lg-outer.lg-first-slide-loading .lg-zoom-out{opacity:.75;pointer-events:none}.lg-outer .lg-thumb-outer{background-color:#0d0a0a;width:100%;max-height:350px;overflow:hidden;float:left}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb,.lg-outer .lg-thumb-outer.lg-rebuilding-thumbnails .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-thumb-align-middle{text-align:center}.lg-outer .lg-thumb-outer.lg-thumb-align-left{text-align:left}.lg-outer .lg-thumb-outer.lg-thumb-align-right{text-align:right}.lg-outer.lg-single-item .lg-thumb-outer{display:none}.lg-outer .lg-thumb{padding:5px 0;height:100%;margin-bottom:-5px;display:inline-block;vertical-align:middle}@media (min-width: 768px){.lg-outer .lg-thumb{padding:10px 0}}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border-radius:2px;margin-bottom:5px;will-change:border-color}@media (min-width: 768px){.lg-outer .lg-thumb-item{border-radius:4px;border:2px solid #fff;-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover;display:block}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer .lg-toggle-thumb:after{content:""}.lg-outer.lg-animate-thumb .lg-thumb{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}.lg-outer .lg-video-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-video-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-video-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-video-object{position:absolute;left:0;right:0;width:100%;height:100%;top:0;bottom:0;z-index:3}.lg-outer .lg-video-poster{z-index:1}.lg-outer .lg-has-video .lg-video-object{opacity:0;will-change:opacity;-webkit-transition:opacity .3s ease-in;-o-transition:opacity .3s ease-in;transition:opacity .3s ease-in}.lg-outer .lg-has-video.lg-video-loaded .lg-video-poster,.lg-outer .lg-has-video.lg-video-loaded .lg-video-play-button{opacity:0!important}.lg-outer .lg-has-video.lg-video-loaded .lg-video-object{opacity:1}@keyframes lg-play-stroke{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes lg-play-rotate{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.lg-video-play-button{width:18%;max-width:140px;position:absolute;top:50%;left:50%;z-index:2;cursor:pointer;transform:translate(-50%,-50%) scale(1);will-change:opacity,transform;-webkit-transition:-webkit-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-moz-transition:-moz-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-o-transition:-o-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;transition:transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s}.lg-video-play-button:hover .lg-video-play-icon-bg,.lg-video-play-button:hover .lg-video-play-icon{opacity:1}.lg-video-play-icon-bg{fill:none;stroke-width:3%;stroke:#fcfcfc;opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon-circle{position:absolute;top:0;left:0;bottom:0;right:0;fill:none;stroke-width:3%;stroke:#1e1e1ee6;stroke-opacity:1;stroke-linecap:round;stroke-dasharray:200;stroke-dashoffset:200}.lg-video-play-icon{position:absolute;width:25%;max-width:120px;left:50%;top:50%;transform:translate3d(-50%,-50%,0);opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon .lg-video-play-icon-inner{fill:#fcfcfc}.lg-video-loading .lg-video-play-icon-circle{animation:lg-play-rotate 2s linear .25s infinite,lg-play-stroke 1.5s ease-in-out .25s infinite}.lg-video-loaded .lg-video-play-button{opacity:0;transform:translate(-50%,-50%) scale(.7)}.light-gallery-item{position:relative}.light-gallery-item__badge{position:absolute;font-size:.85em;top:1em;left:1em;z-index:1001}.fade-content{--fade-content-height: 480px;--fade-content-bg: var(--bs-card-bg);position:relative}.fade-content__body{overflow:hidden;position:relative;transition:max-height .3s ease;max-height:var(--fade-content-height)}.fade-content__body--expanded{max-height:none}.fade-content__overlay{position:absolute;bottom:0;left:0;width:100%;height:50px;background:linear-gradient(to bottom,transparent,var(--fade-content-bg));pointer-events:none}.fade-content__toggle{margin-top:.5rem}.filter-modal__section{transition:height .15s ease,margin-bottom .15s ease}.filter-modal__section--hidden{overflow:hidden;height:0!important;margin-bottom:0!important}.filter-modal__section:not(:last-of-type){margin-bottom:2rem}.filter-modal-button{display:flex;align-items:center;white-space:nowrap}.filter-modal-button--show:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.2em}.filter-modal-button--clear:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.2em}.product-list{--card-width: 300px;--gap: 16px;width:100%;display:flex;flex-wrap:wrap;gap:var(--gap)}.product-list__card-wrapper{width:var(--card-width);flex-grow:1}.product-list__card-wrapper--fixed{flex-grow:0}.product-card{width:100%}.product-card__description img{max-width:100%}.product-card--compact .product-card__description{display:none}.product-card--compact .product-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:var(--bs-link-color)}.product-card__media-nav{display:flex;gap:1.5em;border-bottom:1px solid var(--bs-secondary)}.product-card__media-nav a{position:relative;top:1px;padding:.5em 0;color:var(--bs-link-color)}.product-card__media-nav a:hover{color:var(--bs-link-hover-color)}.product-card__media-nav a.active{color:var(--bs-link-color);border-bottom:2px solid var(--bs-link-color)}.product-card__media-nav a.active:hover{color:var(--bs-link-hover-color)}.lg-video-poster{object-fit:contain}.media-gallery{display:flex;flex-wrap:wrap;gap:var(--media-gallery-gap)}.media-gallery__thumbnail-wrapper{flex-grow:1;width:auto;position:relative;height:var(--media-gallery-row-height);border:var(--media-gallery-thumbnail-border) solid var(--bs-border-color);border-radius:var(--bs-border-radius);overflow:hidden;cursor:pointer}.media-gallery__thumbnail-wrapper--video:before{content:"";font-family:Material Icons Outlined;font-size:4em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;transition:opacity .15s ease-in-out;opacity:.8}.media-gallery__thumbnail-wrapper--video:hover:before{opacity:1}.media-gallery__thumbnail-wrapper--empty{width:var(--media-gallery-row-height)}.media-gallery__thumbnail{width:100%;height:100%;object-fit:cover}.media-gallery__source-link{color:inherit}.media-gallery__source-link:hover{text-decoration:none!important}.campaign-header__cover{max-height:10em;width:100%;object-fit:cover}.campaign-header__avatar{height:8em;aspect-ratio:1;object-fit:cover}.campaign-header__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-weight:700}.campaign-header__creation-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.campaign-header__nav{border-bottom:1px solid var(--bs-secondary)}.campaign-header__nav a{padding-bottom:.5em;position:relative;top:1px}.campaign-header__nav a.active{border-bottom:2px solid var(--bs-link-color)}.about-campaign__summary img{max-width:100%}.slider--h100 .slick-track{display:flex!important}.slider--h100 .slick-track .slick-slide{height:auto;display:flex!important}.slider--h100 .slick-track .slick-slide>div{display:flex;width:100%}.slider__dots li button:before{color:var(--bs-body-color)!important}.reward-card{width:100%;height:100%}.reward-card__image{max-height:10em;object-fit:contain}.reward-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-weight:700}.reward-card__content{font-size:.9em}.reward-card__content p{margin-bottom:0}.reward-card__content ul{padding-left:1em}.reward-card__content img{max-width:100%}.slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:none}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-track,.slick-slider .slick-list{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translateZ(0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:before,.slick-track:after{display:table;content:""}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none}.slick-loading .slick-list{background:#fff url(/assets/ajax-loader-BcnMEykj.gif) center center no-repeat}@font-face{font-family:slick;font-weight:400;font-style:normal;src:url(data:application/vnd.ms-fontobject;base64,AAgAAGQHAAABAAIAAAAAAAIABQkAAAAAAAABAJABAAAAAExQAQAAgCAAAAAAAAAAAAAAAAEAAAAAAAAATxDE8AAAAAAAAAAAAAAAAAAAAAAAAAoAcwBsAGkAYwBrAAAADgBSAGUAZwB1AGwAYQByAAAAFgBWAGUAcgBzAGkAbwBuACAAMQAuADAAAAAKAHMAbABpAGMAawAAAAAAAAEAAAANAIAAAwBQRkZUTW3RyK8AAAdIAAAAHEdERUYANAAGAAAHKAAAACBPUy8yT/b9sgAAAVgAAABWY21hcCIPRb0AAAHIAAABYmdhc3D//wADAAAHIAAAAAhnbHl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QkoKjodHBwSFAwLCwwUEhwcHSIeIBMGAQQDJwMCISspNC8mLBobFBERFBsaLCYvKicpHSUIDAsBt4AICgsLCScnCwwUEhwcOhwcEhQMCw8OHAMDJwMDAgQnFBQRFBsaLCZeJiwaGxQRDxEcJQgEBgAAAAAAAAwAlgABAAAAAAABAAUADAABAAAAAAACAAcAIgABAAAAAAADACEAbgABAAAAAAAEAAUAnAABAAAAAAAFAAsAugABAAAAAAAGAAUA0gADAAEECQABAAoAAAADAAEECQACAA4AEgADAAEECQADAEIAKgADAAEECQAEAAoAkAADAAEECQAFABYAogADAAEECQAGAAoAxgBzAGwAaQBjAGsAAHNsaWNrAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAHMAbABpAGMAawAgADoAIAAxADQALQA0AC0AMgAwADEANAAARm9udEZvcmdlIDIuMCA6IHNsaWNrIDogMTQtNC0yMDE0AABzAGwAaQBjAGsAAHNsaWNrAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABzAGwAaQBjAGsAAHNsaWNrAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAgECAQMAhwBECmFycm93cmlnaHQJYXJyb3dsZWZ0AAAAAAAAAf//AAIAAQAAAA4AAAAYAAAAAAACAAEAAwAGAAEABAAAAAIAAAAAAAEAAAAAzu7XsAAAAADPcXh/AAAAAM9xeH8=) format("embedded-opentype"),url(data:font/woff;base64,d09GRk9UVE8AAAVkAAsAAAAAB1wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAAi4AAAKbH/pWDkZGVE0AAAM4AAAAGgAAABxt0civR0RFRgAAA1QAAAAcAAAAIAAyAARPUy8yAAADcAAAAFIAAABgUBj/rmNtYXAAAAPEAAAAUAAAAWIiC0SwaGVhZAAABBQAAAAuAAAANgABMftoaGVhAAAERAAAABwAAAAkA+UCA2htdHgAAAR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HBgcGBwYUFxYXFhcWMzI3Njc2MzIfARYVFAcGBwYjIicmJyYnJjQ3Njc2NzYzMhcWFzc2FxYB2woIgAsGBQkoKjodHBwSFAwLCwwUEhwcHSIeIBMGAQQDJwMCISspNC8mLBobFBERFBsaLCYvKicpHSUIDAsBt4AICgsLCScnCwwUEhwcOhwcEhQMCw8OHAMDJwMDAgQnFBQRFBsaLCZeJiwaGxQRDxEcJQgEBgAAAAAAAAwAlgABAAAAAAABAAUADAABAAAAAAACAAcAIgABAAAAAAADACEAbgABAAAAAAAEAAUAnAABAAAAAAAFAAsAugABAAAAAAAGAAUA0gADAAEECQABAAoAAAADAAEECQACAA4AEgADAAEECQADAEIAKgADAAEECQAEAAoAkAADAAEECQAFABYAogADAAEECQAGAAoAxgBzAGwAaQBjAGsAAHNsaWNrAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAHMAbABpAGMAawAgADoAIAAxADQALQA0AC0AMgAwADEANAAARm9udEZvcmdlIDIuMCA6IHNsaWNrIDogMTQtNC0yMDE0AABzAGwAaQBjAGsAAHNsaWNrAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABzAGwAaQBjAGsAAHNsaWNrAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAgECAQMAhwBECmFycm93cmlnaHQJYXJyb3dsZWZ0AAAAAAAAAf//AAIAAQAAAA4AAAAYAAAAAAACAAEAAwAGAAEABAAAAAIAAAAAAAEAAAAAzu7XsAAAAADPcXh/AAAAAM9xeH8=) format("truetype"),url(/assets/slick-BlzDm7g2.svg#slick) format("svg")}.slick-prev,.slick-next{font-size:0;line-height:0;position:absolute;top:50%;display:block;width:20px;height:20px;padding:0;-webkit-transform:translate(0,-50%);-ms-transform:translate(0,-50%);transform:translateY(-50%);cursor:pointer;color:transparent;border:none;outline:none;background:transparent}.slick-prev:hover,.slick-prev:focus,.slick-next:hover,.slick-next:focus{color:transparent;outline:none;background:transparent}.slick-prev:hover:before,.slick-prev:focus:before,.slick-next:hover:before,.slick-next:focus:before{opacity:1}.slick-prev.slick-disabled:before,.slick-next.slick-disabled:before{opacity:.25}.slick-prev:before,.slick-next:before{font-family:slick;font-size:20px;line-height:1;opacity:.75;color:#fff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-prev{left:-25px}[dir=rtl] .slick-prev{right:-25px;left:auto}.slick-prev:before{content:"←"}[dir=rtl] .slick-prev:before{content:"→"}.slick-next{right:-25px}[dir=rtl] .slick-next{right:auto;left:-25px}.slick-next:before{content:"→"}[dir=rtl] .slick-next:before{content:"←"}.slick-dotted.slick-slider{margin-bottom:30px}.slick-dots{position:absolute;bottom:-25px;display:block;width:100%;padding:0;margin:0;list-style:none;text-align:center}.slick-dots li{position:relative;display:inline-block;width:20px;height:20px;margin:0 5px;padding:0;cursor:pointer}.slick-dots li button{font-size:0;line-height:0;display:block;width:20px;height:20px;padding:5px;cursor:pointer;color:transparent;border:0;outline:none;background:transparent}.slick-dots li button:hover,.slick-dots li button:focus{outline:none}.slick-dots li button:hover:before,.slick-dots li button:focus:before{opacity:1}.slick-dots li button:before{font-family:slick;font-size:6px;line-height:20px;position:absolute;top:0;left:0;width:20px;height:20px;content:"•";text-align:center;opacity:.25;color:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.slick-dots li.slick-active button:before{opacity:.75;color:#000}.slider-arrow{width:auto!important;height:auto!important;color:var(--bs-btn-color)!important;background:var(--bs-btn-bg)!important;font-size:inherit!important}.slider-arrow__icon{font-size:2em}.slider-arrow:hover{color:var(--bs-btn-hover-color)!important;background-color:var(--bs-btn-hover-bg)!important}.slider-arrow.slick-prev:before,.slider-arrow.slick-next:before{content:none!important}.slider-arrow--prev{left:-2.5em}.slider-arrow--next{right:-2.5em}.post-nav__wrapper.fixed{position:sticky;bottom:0;border-top:1px solid var(--bs-secondary);padding-top:.5rem;background:var(--bs-body-bg)}.post-nav__previous,.post-nav__next{display:flex;align-items:center;width:calc(50% - 2rem)}.post-nav__previous--fill,.post-nav__next--fill{width:calc(90% - 2rem)}.post-nav__previous-label,.post-nav__next-label{width:calc(100% - 1.7rem);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.post-nav__next-label{text-align:right}.post-nav__next{justify-content:end}.post-nav__previous:before{content:"";font-family:Material Icons;font-size:1.2em;margin-right:.5em}.post-nav__next:after{content:"";font-family:Material Icons;font-size:1.2em;margin-left:.5em}.post-content__column.mw-narrower{max-width:40.5em}.post-content__column.mw-standard{max-width:47.5em}.post-content__column.mw-wider{max-width:54.5em}.collection-list.mw-narrower{max-width:40.5em}.collection-list.mw-standard{max-width:47.5em}.collection-list.mw-wider{max-width:54.5em}.collection-card{overflow:hidden}.collection-card__thumbnail>img{height:6.5em;aspect-ratio:1;object-fit:cover}.collection-card__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-weight:700}.collection-card__description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden}.collection-card__count-icon{font-size:1.2em!important;margin-right:.3em}.collection-card__count-text{font-size:1em}.collection-banner{overflow:hidden;border:none;border-radius:0}.collection-banner.mw-narrower{max-width:40.5em}.collection-banner.mw-standard{max-width:47.5em}.collection-banner.mw-wider{max-width:54.5em}.collection-banner__thumbnail{z-index:100}.collection-banner__thumbnail>img{border-radius:var(--bs-border-radius);height:8em;aspect-ratio:1;object-fit:cover}.collection-banner__title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;color:var(--bs-link-color);font-size:1.2rem;font-weight:700}.collection-banner .fade-content__toggle{margin-bottom:.5em}.collection-banner--nodesc .collection-banner__thumbnail>img{height:4em}.collection-banner--nodesc .collection-banner__title{flex:1 auto;align-items:center;font-size:1.5rem}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link id="theme-stylesheet-0" rel="stylesheet" href="/themes/bootstrap/default/css/bootstrap.min.css">
|
|
7
7
|
<title>patreon-dl</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-B1h15ViZ.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CQnQD2xz.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/dist/cli/CLIOptions.js
CHANGED
|
@@ -133,6 +133,7 @@ function getCLIIncludeOptions(commandLineOptions, configFileOptions) {
|
|
|
133
133
|
contentInfo: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.contentInfo, configFileOptions?.include?.contentInfo)),
|
|
134
134
|
previewMedia: CLIOptionValidator.validateIncludePreviewMedia(pickDefined(commandLineOptions.include?.previewMedia, configFileOptions?.include?.previewMedia)),
|
|
135
135
|
contentMedia: CLIOptionValidator.validateIncludeContentMedia(pickDefined(commandLineOptions.include?.contentMedia, configFileOptions?.include?.contentMedia)),
|
|
136
|
+
protectedMedia: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.protectedMedia, configFileOptions?.include?.protectedMedia)),
|
|
136
137
|
allMediaVariants: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.allMediaVariants, configFileOptions?.include?.allMediaVariants)),
|
|
137
138
|
mediaThumbnails: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.mediaThumbnails, configFileOptions?.include?.mediaThumbnails)),
|
|
138
139
|
mediaByFilename: {
|
|
@@ -174,6 +175,7 @@ function readTargetsFile(file) {
|
|
|
174
175
|
contentInfo: 'include.content.info',
|
|
175
176
|
previewMedia: 'include.preview.media',
|
|
176
177
|
contentMedia: 'include.content.media',
|
|
178
|
+
protectedMedia: 'nclude.protected.media',
|
|
177
179
|
allMediaVariants: 'include.all.media.variants',
|
|
178
180
|
mediaThumbnails: 'include.media.thumbnails',
|
|
179
181
|
imagesByFilename: 'include.images.by.filename',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLIOptions.js","sourceRoot":"","sources":["../../src/cli/CLIOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAA2C,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGxF,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,iBAAkD,MAAM,wBAAwB,CAAC;AACxF,OAAO,gBAAgD,MAAM,uBAAuB,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,0BAA0B,CAAC;AA8BpD,MAAM,UAAU,aAAa,CAAC,cAAc,GAAG,KAAK;IAClD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,KAAK,EAAE,CAAC;IAErD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpI,IAAI,UAAU,GAAwB,EAAE,CAAC;IAEzC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,EAAE,KAAK,CAAC;QACzD,IAAI,CAAC,WAAW;YACd,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;YAC3B,CAAC,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAC3E,CAAC;YACD,MAAM,KAAK,CAAC,GAAG,kBAAkB,CAAC,QAAQ,CAAC,GAAG,uCAAuC,CAAC,CAAC;QAC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AG,YAAY,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE;gBACnE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI;aACtD,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3C,CAAC,CAAC,OAAO,GAAG,WAAW,CAAC;YAC1B,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import fs from 'fs';\nimport { type DownloaderIncludeOptions, type DownloaderOptions } from '../downloaders/DownloaderOptions.js';\nimport { type DeepPartial, type RecursivePropsTo, pickDefined } from '../utils/Misc.js';\nimport { type ConsoleLoggerOptions } from '../utils/logging/ConsoleLogger.js';\nimport { type FileLoggerType, type FileLoggerOptions } from '../utils/logging/FileLogger.js';\nimport CLIOptionValidator from './CLIOptionValidator.js';\nimport CommandLineParser, { type CommandLineParseResult } from './CommandLineParser.js';\nimport ConfigFileParser, { type ConfigFileParseResult } from './ConfigFileParser.js';\nimport path from 'path';\nimport ObjectHelper from '../utils/ObjectHelper.js';\n\nexport interface CLITargetURLEntry {\n url: string;\n // Target-specific 'include' options\n include?: DownloaderIncludeOptions;\n}\n\nexport interface CLIOptions extends Omit<DownloaderOptions, 'logger'> {\n targetURLs: CLITargetURLEntry[];\n noPrompt: boolean;\n consoleLogger: ConsoleLoggerOptions;\n fileLoggers?: Omit<FileLoggerOptions<FileLoggerType.Downloader>, 'init'>[];\n}\n\nexport type CLIOptionParserEntry = ({\n src: 'cli'\n} | {\n src: 'cfg',\n section: string\n} | {\n src: 'tgt',\n line: number\n}) & {\n key: string;\n value?: string;\n}\n\nexport function getCLIOptions(skipTargetURLs: true): Omit<CLIOptions, 'targetURLs'>;\nexport function getCLIOptions(skipTargetURLs?: false): CLIOptions;\nexport function getCLIOptions(skipTargetURLs = false): CLIOptions | Omit<CLIOptions, 'targetURLs'> {\n const commandLineOptions = CommandLineParser.parse();\n\n const configFileOptions = commandLineOptions.configFile?.value ? ConfigFileParser.parse(commandLineOptions.configFile.value) : null;\n let targetURLs: CLITargetURLEntry[] = [];\n\n if (commandLineOptions.debugAPI) {\n const apiDataFile = commandLineOptions.targetURLs?.value;\n if (!apiDataFile ||\n !fs.existsSync(apiDataFile) ||\n !['post-api.json', 'product-api.json'].includes(path.basename(apiDataFile))\n ) {\n throw Error(`${commandLineOptions.debugAPI.key}: target is not a local API data file`);\n }\n targetURLs = [{ url: apiDataFile }];\n }\n else if (!skipTargetURLs) {\n const targetURLValue = CLIOptionValidator.validateRequired(pickDefined(commandLineOptions.targetURLs, configFileOptions?.targetURLs), 'No target URL specified');\n const targetsFile = path.resolve(targetURLValue);\n if (fs.existsSync(targetsFile)) {\n targetURLs = readTargetsFile(targetsFile);\n }\n else {\n targetURLs = CLIOptionValidator\n .validateTargetURLs(targetURLValue)\n .map((url) => ({ url }));\n }\n }\n\n const { consoleLogger, fileLoggers } = getCLILoggerOptions(commandLineOptions, configFileOptions);\n const proxy = getProxyOptions(configFileOptions);\n\n const options = {\n cookie: CLIOptionValidator.validateString(pickDefined(commandLineOptions.cookie, configFileOptions?.cookie)),\n useStatusCache: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.useStatusCache, configFileOptions?.useStatusCache)),\n stopOn: CLIOptionValidator.validateString(pickDefined(commandLineOptions.stopOn, configFileOptions?.stopOn), 'never', 'postPreviouslyDownloaded', 'postPublishDateOutOfRange', 'previouslyDownloaded', 'publishDateOutOfRange'),\n pathToFFmpeg: CLIOptionValidator.validateString(pickDefined(commandLineOptions.pathToFFmpeg, configFileOptions?.pathToFFmpeg)),\n pathToDeno: CLIOptionValidator.validateString(pickDefined(commandLineOptions.pathToDeno, configFileOptions?.pathToDeno)),\n outDir: CLIOptionValidator.validateString(pickDefined(commandLineOptions.outDir, configFileOptions?.outDir)),\n dirNameFormat: {\n campaign: CLIOptionValidator.validateString(pickDefined(commandLineOptions.dirNameFormat?.campaign, configFileOptions?.dirNameFormat?.campaign)),\n content: CLIOptionValidator.validateString(pickDefined(commandLineOptions.dirNameFormat?.content, configFileOptions?.dirNameFormat?.content))\n },\n filenameFormat: {\n media: CLIOptionValidator.validateString(pickDefined(commandLineOptions.filenameFormat?.media, configFileOptions?.filenameFormat?.media))\n },\n include: getCLIIncludeOptions(commandLineOptions, configFileOptions),\n request: {\n maxRetries: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.maxRetries, configFileOptions?.request?.maxRetries)),\n maxConcurrent: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.maxConcurrent, configFileOptions?.request?.maxConcurrent)),\n minTime: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.minTime, configFileOptions?.request?.minTime)),\n proxy,\n userAgent: CLIOptionValidator.validateString(pickDefined(commandLineOptions?.request?.userAgent, configFileOptions?.request?.userAgent))\n },\n fileExistsAction: {\n content: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.content, configFileOptions?.fileExistsAction?.content), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer'),\n info: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.info, configFileOptions?.fileExistsAction?.info), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer'),\n infoAPI: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.infoAPI, configFileOptions?.fileExistsAction?.infoAPI), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer')\n },\n embedDownloaders: getEmbedDownloaderOptions(configFileOptions),\n maxVideoResolution: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions.maxVideoResolution, configFileOptions?.maxVideoResolution)),\n noPrompt: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.noPrompt, configFileOptions?.noPrompt)) || false,\n dryRun: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.dryRun, configFileOptions?.dryRun)) || false,\n consoleLogger,\n fileLoggers\n } satisfies Omit<CLIOptions, 'targetURLs'>;\n\n if (skipTargetURLs) {\n return options;\n }\n\n return {\n targetURLs,\n ...options\n } satisfies CLIOptions;\n}\n\nexport function getCLILoggerOptions(commandLineOptions?: CommandLineParseResult, configFileOptions?: ReturnType<typeof ConfigFileParser['parse']> | null) {\n if (!commandLineOptions) {\n commandLineOptions = CommandLineParser.parse();\n }\n const consoleLogger = {\n enabled: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.enabled, configFileOptions?.consoleLogger?.enabled)),\n logLevel: CLIOptionValidator.validateString(pickDefined(commandLineOptions.consoleLogger?.logLevel, configFileOptions?.consoleLogger?.logLevel), 'info', 'debug', 'warn', 'error'),\n include: {\n dateTime: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.dateTime, configFileOptions?.consoleLogger?.include?.dateTime)),\n level: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.level, configFileOptions?.consoleLogger?.include?.level)),\n originator: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.originator, configFileOptions?.consoleLogger?.include?.originator)),\n errorStack: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.errorStack, configFileOptions?.consoleLogger?.include?.errorStack))\n },\n dateTimeFormat: CLIOptionValidator.validateString(pickDefined(commandLineOptions.consoleLogger?.dateTimeFormat, configFileOptions?.consoleLogger?.dateTimeFormat)),\n color: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.color, configFileOptions?.consoleLogger?.color))\n };\n let fileLoggers;\n if (configFileOptions?.fileLoggers) {\n fileLoggers = configFileOptions.fileLoggers.map((logger): Omit<FileLoggerOptions<FileLoggerType.Downloader>, 'init'> => ({\n enabled: CLIOptionValidator.validateBoolean(logger.enabled),\n logDir: CLIOptionValidator.validateString(logger.logDir),\n logFilename: CLIOptionValidator.validateString(logger.logFilename),\n fileExistsAction: CLIOptionValidator.validateString(logger.fileExistsAction, 'append', 'overwrite'),\n logLevel: CLIOptionValidator.validateString(logger.logLevel, 'info', 'debug', 'warn', 'error'),\n include: {\n dateTime: CLIOptionValidator.validateBoolean(logger.include?.dateTime),\n level: CLIOptionValidator.validateBoolean(logger.include?.level),\n originator: CLIOptionValidator.validateBoolean(logger.include?.originator),\n errorStack: CLIOptionValidator.validateBoolean(logger.include?.errorStack)\n },\n dateTimeFormat: CLIOptionValidator.validateString(logger.dateTimeFormat),\n color: CLIOptionValidator.validateBoolean(logger.color)\n }));\n }\n return {\n consoleLogger,\n fileLoggers\n };\n}\n\nfunction getCLIIncludeOptions(commandLineOptions: CommandLineParseResult, configFileOptions?: ConfigFileParseResult | null) {\n if (!commandLineOptions) {\n commandLineOptions = CommandLineParser.parse();\n }\n return {\n lockedContent: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.lockedContent, configFileOptions?.include?.lockedContent)),\n postsWithMediaType: CLIOptionValidator.validateIncludeContentWithMediaType(pickDefined(commandLineOptions.include?.postsWithMediaType, configFileOptions?.include?.postsWithMediaType)),\n postsInTier: CLIOptionValidator.validateIncludeContentInTier(pickDefined(commandLineOptions.include?.postsInTier, configFileOptions?.include?.postsInTier)),\n postsPublished: {\n after: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.postsPublished?.after, configFileOptions?.include?.postsPublished?.after)) || null,\n before: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.postsPublished?.before, configFileOptions?.include?.postsPublished?.before)) || null,\n },\n productsPublished: {\n after: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.productsPublished?.after, configFileOptions?.include?.productsPublished?.after)) || null,\n before: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.productsPublished?.before, configFileOptions?.include?.productsPublished?.before)) || null,\n },\n campaignInfo: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.campaignInfo, configFileOptions?.include?.campaignInfo)),\n contentInfo: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.contentInfo, configFileOptions?.include?.contentInfo)),\n previewMedia: CLIOptionValidator.validateIncludePreviewMedia(pickDefined(commandLineOptions.include?.previewMedia, configFileOptions?.include?.previewMedia)),\n contentMedia: CLIOptionValidator.validateIncludeContentMedia(pickDefined(commandLineOptions.include?.contentMedia, configFileOptions?.include?.contentMedia)),\n allMediaVariants: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.allMediaVariants, configFileOptions?.include?.allMediaVariants)),\n mediaThumbnails: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.mediaThumbnails, configFileOptions?.include?.mediaThumbnails)),\n mediaByFilename: {\n images: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.images, configFileOptions?.include?.mediaByFilename?.images)) || null,\n audio: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.audio, configFileOptions?.include?.mediaByFilename?.audio)) || null,\n attachments: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.attachments, configFileOptions?.include?.mediaByFilename?.attachments)) || null\n },\n comments: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.comments, configFileOptions?.include?.comments))\n };\n}\n\nfunction getEmbedDownloaderOptions(configFileOptions?: ConfigFileParseResult | null) {\n if (configFileOptions?.embedDownloaders) {\n return configFileOptions?.embedDownloaders.map((dl) => ({\n provider: CLIOptionValidator.validateRequired(dl.provider),\n exec: CLIOptionValidator.validateRequired(dl.exec)\n }));\n }\n return undefined;\n}\n\nfunction getProxyOptions(configFileOptions?: ConfigFileParseResult | null) {\n if (configFileOptions?.request?.proxy && configFileOptions.request.proxy.url?.value?.trim()) {\n return {\n url: CLIOptionValidator.validateProxyURL(configFileOptions.request.proxy.url),\n rejectUnauthorizedTLS: CLIOptionValidator.validateBoolean(configFileOptions.request.proxy.rejectUnauthorizedTLS)\n };\n }\n return null;\n}\n\nfunction readTargetsFile(file: string) {\n const includeKeys = {\n lockedContent: 'include.locked.content',\n postsWithMediaType: 'include.posts.with.media.type',\n postsInTier: 'include.posts.in.tier',\n postsPublishedAfter: 'include.posts.published.after',\n postsPublishedBefore: 'include.posts.published.before',\n productsPublishedAfter: 'include.products.published.after',\n productsPublishedBefore: 'include.products.published.before',\n campaignInfo: 'include.campaign.info',\n contentInfo: 'include.content.info',\n previewMedia: 'include.preview.media',\n contentMedia: 'include.content.media',\n allMediaVariants: 'include.all.media.variants',\n mediaThumbnails: 'include.media.thumbnails',\n imagesByFilename: 'include.images.by.filename',\n audioByFilename: 'include.audio.by.filename',\n attachmentsByFilename: 'include.attachments.by.filename',\n comments: 'include.comments'\n };\n\n const lines = fs.readFileSync(file)\n .toString('utf-8')\n // Replace Windows line breaks with Unix ones and then split\n .replace(/\\r\\n/g, '\\n').split('\\n')\n .map((line) => line.trim());\n\n const currentTargets: { url: string; include?: RecursivePropsTo<DeepPartial<DownloaderIncludeOptions>, CLIOptionParserEntry>; }[] = [];\n for (let ln = 0; ln < lines.length; ln++) {\n const line = lines[ln];\n if (line === '' || line.startsWith('#')) {\n continue;\n }\n try {\n const match = Object.entries(includeKeys).find((e) => line.startsWith(e[1]));\n if (match) {\n const [ optName, matchKey ] = match;\n const eq = line.indexOf('=');\n const propValue = (eq >= matchKey.length ? line.substring(eq + 1) : '').trim();\n if (propValue) {\n const target = currentTargets.at(-1);\n if (target) {\n const entry: CLIOptionParserEntry = {\n key: matchKey,\n line: ln,\n src: 'tgt',\n value: propValue\n };\n if (!target.include) {\n target.include = {};\n }\n if (matchKey === includeKeys.postsPublishedAfter || matchKey === includeKeys.postsPublishedBefore) {\n if (!target.include.postsPublished) {\n target.include.postsPublished = {};\n }\n if (matchKey === includeKeys.postsPublishedAfter) {\n target.include.postsPublished.after = entry;\n }\n else {\n target.include.postsPublished.before = entry;\n }\n }\n else if (matchKey === includeKeys.productsPublishedAfter || matchKey === includeKeys.productsPublishedBefore) {\n if (!target.include.productsPublished) {\n target.include.productsPublished = {};\n }\n if (matchKey === includeKeys.productsPublishedAfter) {\n target.include.productsPublished.after = entry;\n }\n else {\n target.include.productsPublished.before = entry;\n }\n }\n else if (matchKey === includeKeys.imagesByFilename || matchKey === includeKeys.audioByFilename ||\n matchKey === includeKeys.attachmentsByFilename) {\n if (!target.include.mediaByFilename) {\n target.include.mediaByFilename = {};\n }\n switch (matchKey) {\n case includeKeys.imagesByFilename:\n target.include.mediaByFilename.images = entry;\n break;\n case includeKeys.audioByFilename:\n target.include.mediaByFilename.audio = entry;\n break;\n case includeKeys.attachmentsByFilename:\n target.include.mediaByFilename.attachments = entry;\n break;\n }\n }\n else {\n target.include[optName as keyof DownloaderIncludeOptions] = entry;\n }\n }\n }\n }\n else {\n const url = CLIOptionValidator.validateTargetURL(line);\n currentTargets.push({ url });\n }\n }\n catch (error: any) {\n const errMsg = error instanceof Error ? error.message : error;\n throw Error(`Error parsing targets file (line ${ln})${errMsg ? `: ${errMsg}` : ''}`);\n }\n }\n\n const result: CLITargetURLEntry[] = [];\n for (const target of currentTargets) {\n const v: CLITargetURLEntry = { url: target.url };\n if (target.include) {\n const includeOpts = ObjectHelper.clean(getCLIIncludeOptions(target), {\n deep: true, cleanNulls: true, cleanEmptyObjects: true\n });\n if (Object.entries(includeOpts).length > 0) {\n v.include = includeOpts;\n }\n }\n result.push(v);\n }\n\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CLIOptions.js","sourceRoot":"","sources":["../../src/cli/CLIOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAA2C,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGxF,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,iBAAkD,MAAM,wBAAwB,CAAC;AACxF,OAAO,gBAAgD,MAAM,uBAAuB,CAAC;AACr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,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import fs from 'fs';\nimport { type DownloaderIncludeOptions, type DownloaderOptions } from '../downloaders/DownloaderOptions.js';\nimport { type DeepPartial, type RecursivePropsTo, pickDefined } from '../utils/Misc.js';\nimport { type ConsoleLoggerOptions } from '../utils/logging/ConsoleLogger.js';\nimport { type FileLoggerType, type FileLoggerOptions } from '../utils/logging/FileLogger.js';\nimport CLIOptionValidator from './CLIOptionValidator.js';\nimport CommandLineParser, { type CommandLineParseResult } from './CommandLineParser.js';\nimport ConfigFileParser, { type ConfigFileParseResult } from './ConfigFileParser.js';\nimport path from 'path';\nimport ObjectHelper from '../utils/ObjectHelper.js';\n\nexport interface CLITargetURLEntry {\n url: string;\n // Target-specific 'include' options\n include?: DownloaderIncludeOptions;\n}\n\nexport interface CLIOptions extends Omit<DownloaderOptions, 'logger'> {\n targetURLs: CLITargetURLEntry[];\n noPrompt: boolean;\n consoleLogger: ConsoleLoggerOptions;\n fileLoggers?: Omit<FileLoggerOptions<FileLoggerType.Downloader>, 'init'>[];\n}\n\nexport type CLIOptionParserEntry = ({\n src: 'cli'\n} | {\n src: 'cfg',\n section: string\n} | {\n src: 'tgt',\n line: number\n}) & {\n key: string;\n value?: string;\n}\n\nexport function getCLIOptions(skipTargetURLs: true): Omit<CLIOptions, 'targetURLs'>;\nexport function getCLIOptions(skipTargetURLs?: false): CLIOptions;\nexport function getCLIOptions(skipTargetURLs = false): CLIOptions | Omit<CLIOptions, 'targetURLs'> {\n const commandLineOptions = CommandLineParser.parse();\n\n const configFileOptions = commandLineOptions.configFile?.value ? ConfigFileParser.parse(commandLineOptions.configFile.value) : null;\n let targetURLs: CLITargetURLEntry[] = [];\n\n if (commandLineOptions.debugAPI) {\n const apiDataFile = commandLineOptions.targetURLs?.value;\n if (!apiDataFile ||\n !fs.existsSync(apiDataFile) ||\n !['post-api.json', 'product-api.json'].includes(path.basename(apiDataFile))\n ) {\n throw Error(`${commandLineOptions.debugAPI.key}: target is not a local API data file`);\n }\n targetURLs = [{ url: apiDataFile }];\n }\n else if (!skipTargetURLs) {\n const targetURLValue = CLIOptionValidator.validateRequired(pickDefined(commandLineOptions.targetURLs, configFileOptions?.targetURLs), 'No target URL specified');\n const targetsFile = path.resolve(targetURLValue);\n if (fs.existsSync(targetsFile)) {\n targetURLs = readTargetsFile(targetsFile);\n }\n else {\n targetURLs = CLIOptionValidator\n .validateTargetURLs(targetURLValue)\n .map((url) => ({ url }));\n }\n }\n\n const { consoleLogger, fileLoggers } = getCLILoggerOptions(commandLineOptions, configFileOptions);\n const proxy = getProxyOptions(configFileOptions);\n\n const options = {\n cookie: CLIOptionValidator.validateString(pickDefined(commandLineOptions.cookie, configFileOptions?.cookie)),\n useStatusCache: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.useStatusCache, configFileOptions?.useStatusCache)),\n stopOn: CLIOptionValidator.validateString(pickDefined(commandLineOptions.stopOn, configFileOptions?.stopOn), 'never', 'postPreviouslyDownloaded', 'postPublishDateOutOfRange', 'previouslyDownloaded', 'publishDateOutOfRange'),\n pathToFFmpeg: CLIOptionValidator.validateString(pickDefined(commandLineOptions.pathToFFmpeg, configFileOptions?.pathToFFmpeg)),\n pathToDeno: CLIOptionValidator.validateString(pickDefined(commandLineOptions.pathToDeno, configFileOptions?.pathToDeno)),\n outDir: CLIOptionValidator.validateString(pickDefined(commandLineOptions.outDir, configFileOptions?.outDir)),\n dirNameFormat: {\n campaign: CLIOptionValidator.validateString(pickDefined(commandLineOptions.dirNameFormat?.campaign, configFileOptions?.dirNameFormat?.campaign)),\n content: CLIOptionValidator.validateString(pickDefined(commandLineOptions.dirNameFormat?.content, configFileOptions?.dirNameFormat?.content))\n },\n filenameFormat: {\n media: CLIOptionValidator.validateString(pickDefined(commandLineOptions.filenameFormat?.media, configFileOptions?.filenameFormat?.media))\n },\n include: getCLIIncludeOptions(commandLineOptions, configFileOptions),\n request: {\n maxRetries: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.maxRetries, configFileOptions?.request?.maxRetries)),\n maxConcurrent: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.maxConcurrent, configFileOptions?.request?.maxConcurrent)),\n minTime: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions?.request?.minTime, configFileOptions?.request?.minTime)),\n proxy,\n userAgent: CLIOptionValidator.validateString(pickDefined(commandLineOptions?.request?.userAgent, configFileOptions?.request?.userAgent))\n },\n fileExistsAction: {\n content: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.content, configFileOptions?.fileExistsAction?.content), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer'),\n info: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.info, configFileOptions?.fileExistsAction?.info), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer'),\n infoAPI: CLIOptionValidator.validateString(pickDefined(commandLineOptions.fileExistsAction?.infoAPI, configFileOptions?.fileExistsAction?.infoAPI), 'overwrite', 'skip', 'saveAsCopy', 'saveAsCopyIfNewer')\n },\n embedDownloaders: getEmbedDownloaderOptions(configFileOptions),\n maxVideoResolution: CLIOptionValidator.validateNumber(pickDefined(commandLineOptions.maxVideoResolution, configFileOptions?.maxVideoResolution)),\n noPrompt: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.noPrompt, configFileOptions?.noPrompt)) || false,\n dryRun: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.dryRun, configFileOptions?.dryRun)) || false,\n consoleLogger,\n fileLoggers\n } satisfies Omit<CLIOptions, 'targetURLs'>;\n\n if (skipTargetURLs) {\n return options;\n }\n\n return {\n targetURLs,\n ...options\n } satisfies CLIOptions;\n}\n\nexport function getCLILoggerOptions(commandLineOptions?: CommandLineParseResult, configFileOptions?: ReturnType<typeof ConfigFileParser['parse']> | null) {\n if (!commandLineOptions) {\n commandLineOptions = CommandLineParser.parse();\n }\n const consoleLogger = {\n enabled: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.enabled, configFileOptions?.consoleLogger?.enabled)),\n logLevel: CLIOptionValidator.validateString(pickDefined(commandLineOptions.consoleLogger?.logLevel, configFileOptions?.consoleLogger?.logLevel), 'info', 'debug', 'warn', 'error'),\n include: {\n dateTime: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.dateTime, configFileOptions?.consoleLogger?.include?.dateTime)),\n level: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.level, configFileOptions?.consoleLogger?.include?.level)),\n originator: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.originator, configFileOptions?.consoleLogger?.include?.originator)),\n errorStack: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.include?.errorStack, configFileOptions?.consoleLogger?.include?.errorStack))\n },\n dateTimeFormat: CLIOptionValidator.validateString(pickDefined(commandLineOptions.consoleLogger?.dateTimeFormat, configFileOptions?.consoleLogger?.dateTimeFormat)),\n color: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.consoleLogger?.color, configFileOptions?.consoleLogger?.color))\n };\n let fileLoggers;\n if (configFileOptions?.fileLoggers) {\n fileLoggers = configFileOptions.fileLoggers.map((logger): Omit<FileLoggerOptions<FileLoggerType.Downloader>, 'init'> => ({\n enabled: CLIOptionValidator.validateBoolean(logger.enabled),\n logDir: CLIOptionValidator.validateString(logger.logDir),\n logFilename: CLIOptionValidator.validateString(logger.logFilename),\n fileExistsAction: CLIOptionValidator.validateString(logger.fileExistsAction, 'append', 'overwrite'),\n logLevel: CLIOptionValidator.validateString(logger.logLevel, 'info', 'debug', 'warn', 'error'),\n include: {\n dateTime: CLIOptionValidator.validateBoolean(logger.include?.dateTime),\n level: CLIOptionValidator.validateBoolean(logger.include?.level),\n originator: CLIOptionValidator.validateBoolean(logger.include?.originator),\n errorStack: CLIOptionValidator.validateBoolean(logger.include?.errorStack)\n },\n dateTimeFormat: CLIOptionValidator.validateString(logger.dateTimeFormat),\n color: CLIOptionValidator.validateBoolean(logger.color)\n }));\n }\n return {\n consoleLogger,\n fileLoggers\n };\n}\n\nfunction getCLIIncludeOptions(commandLineOptions: CommandLineParseResult, configFileOptions?: ConfigFileParseResult | null) {\n if (!commandLineOptions) {\n commandLineOptions = CommandLineParser.parse();\n }\n return {\n lockedContent: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.lockedContent, configFileOptions?.include?.lockedContent)),\n postsWithMediaType: CLIOptionValidator.validateIncludeContentWithMediaType(pickDefined(commandLineOptions.include?.postsWithMediaType, configFileOptions?.include?.postsWithMediaType)),\n postsInTier: CLIOptionValidator.validateIncludeContentInTier(pickDefined(commandLineOptions.include?.postsInTier, configFileOptions?.include?.postsInTier)),\n postsPublished: {\n after: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.postsPublished?.after, configFileOptions?.include?.postsPublished?.after)) || null,\n before: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.postsPublished?.before, configFileOptions?.include?.postsPublished?.before)) || null,\n },\n productsPublished: {\n after: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.productsPublished?.after, configFileOptions?.include?.productsPublished?.after)) || null,\n before: CLIOptionValidator.validateDateTime(pickDefined(commandLineOptions.include?.productsPublished?.before, configFileOptions?.include?.productsPublished?.before)) || null,\n },\n campaignInfo: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.campaignInfo, configFileOptions?.include?.campaignInfo)),\n contentInfo: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.contentInfo, configFileOptions?.include?.contentInfo)),\n previewMedia: CLIOptionValidator.validateIncludePreviewMedia(pickDefined(commandLineOptions.include?.previewMedia, configFileOptions?.include?.previewMedia)),\n contentMedia: CLIOptionValidator.validateIncludeContentMedia(pickDefined(commandLineOptions.include?.contentMedia, configFileOptions?.include?.contentMedia)),\n protectedMedia: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.protectedMedia, configFileOptions?.include?.protectedMedia)),\n allMediaVariants: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.allMediaVariants, configFileOptions?.include?.allMediaVariants)),\n mediaThumbnails: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.mediaThumbnails, configFileOptions?.include?.mediaThumbnails)),\n mediaByFilename: {\n images: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.images, configFileOptions?.include?.mediaByFilename?.images)) || null,\n audio: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.audio, configFileOptions?.include?.mediaByFilename?.audio)) || null,\n attachments: CLIOptionValidator.validateString(pickDefined(commandLineOptions.include?.mediaByFilename?.attachments, configFileOptions?.include?.mediaByFilename?.attachments)) || null\n },\n comments: CLIOptionValidator.validateBoolean(pickDefined(commandLineOptions.include?.comments, configFileOptions?.include?.comments))\n };\n}\n\nfunction getEmbedDownloaderOptions(configFileOptions?: ConfigFileParseResult | null) {\n if (configFileOptions?.embedDownloaders) {\n return configFileOptions?.embedDownloaders.map((dl) => ({\n provider: CLIOptionValidator.validateRequired(dl.provider),\n exec: CLIOptionValidator.validateRequired(dl.exec)\n }));\n }\n return undefined;\n}\n\nfunction getProxyOptions(configFileOptions?: ConfigFileParseResult | null) {\n if (configFileOptions?.request?.proxy && configFileOptions.request.proxy.url?.value?.trim()) {\n return {\n url: CLIOptionValidator.validateProxyURL(configFileOptions.request.proxy.url),\n rejectUnauthorizedTLS: CLIOptionValidator.validateBoolean(configFileOptions.request.proxy.rejectUnauthorizedTLS)\n };\n }\n return null;\n}\n\nfunction readTargetsFile(file: string) {\n const includeKeys = {\n lockedContent: 'include.locked.content',\n postsWithMediaType: 'include.posts.with.media.type',\n postsInTier: 'include.posts.in.tier',\n postsPublishedAfter: 'include.posts.published.after',\n postsPublishedBefore: 'include.posts.published.before',\n productsPublishedAfter: 'include.products.published.after',\n productsPublishedBefore: 'include.products.published.before',\n campaignInfo: 'include.campaign.info',\n contentInfo: 'include.content.info',\n previewMedia: 'include.preview.media',\n contentMedia: 'include.content.media',\n protectedMedia: 'nclude.protected.media',\n allMediaVariants: 'include.all.media.variants',\n mediaThumbnails: 'include.media.thumbnails',\n imagesByFilename: 'include.images.by.filename',\n audioByFilename: 'include.audio.by.filename',\n attachmentsByFilename: 'include.attachments.by.filename',\n comments: 'include.comments'\n };\n\n const lines = fs.readFileSync(file)\n .toString('utf-8')\n // Replace Windows line breaks with Unix ones and then split\n .replace(/\\r\\n/g, '\\n').split('\\n')\n .map((line) => line.trim());\n\n const currentTargets: { url: string; include?: RecursivePropsTo<DeepPartial<DownloaderIncludeOptions>, CLIOptionParserEntry>; }[] = [];\n for (let ln = 0; ln < lines.length; ln++) {\n const line = lines[ln];\n if (line === '' || line.startsWith('#')) {\n continue;\n }\n try {\n const match = Object.entries(includeKeys).find((e) => line.startsWith(e[1]));\n if (match) {\n const [ optName, matchKey ] = match;\n const eq = line.indexOf('=');\n const propValue = (eq >= matchKey.length ? line.substring(eq + 1) : '').trim();\n if (propValue) {\n const target = currentTargets.at(-1);\n if (target) {\n const entry: CLIOptionParserEntry = {\n key: matchKey,\n line: ln,\n src: 'tgt',\n value: propValue\n };\n if (!target.include) {\n target.include = {};\n }\n if (matchKey === includeKeys.postsPublishedAfter || matchKey === includeKeys.postsPublishedBefore) {\n if (!target.include.postsPublished) {\n target.include.postsPublished = {};\n }\n if (matchKey === includeKeys.postsPublishedAfter) {\n target.include.postsPublished.after = entry;\n }\n else {\n target.include.postsPublished.before = entry;\n }\n }\n else if (matchKey === includeKeys.productsPublishedAfter || matchKey === includeKeys.productsPublishedBefore) {\n if (!target.include.productsPublished) {\n target.include.productsPublished = {};\n }\n if (matchKey === includeKeys.productsPublishedAfter) {\n target.include.productsPublished.after = entry;\n }\n else {\n target.include.productsPublished.before = entry;\n }\n }\n else if (matchKey === includeKeys.imagesByFilename || matchKey === includeKeys.audioByFilename ||\n matchKey === includeKeys.attachmentsByFilename) {\n if (!target.include.mediaByFilename) {\n target.include.mediaByFilename = {};\n }\n switch (matchKey) {\n case includeKeys.imagesByFilename:\n target.include.mediaByFilename.images = entry;\n break;\n case includeKeys.audioByFilename:\n target.include.mediaByFilename.audio = entry;\n break;\n case includeKeys.attachmentsByFilename:\n target.include.mediaByFilename.attachments = entry;\n break;\n }\n }\n else {\n target.include[optName as keyof DownloaderIncludeOptions] = entry;\n }\n }\n }\n }\n else {\n const url = CLIOptionValidator.validateTargetURL(line);\n currentTargets.push({ url });\n }\n }\n catch (error: any) {\n const errMsg = error instanceof Error ? error.message : error;\n throw Error(`Error parsing targets file (line ${ln})${errMsg ? `: ${errMsg}` : ''}`);\n }\n }\n\n const result: CLITargetURLEntry[] = [];\n for (const target of currentTargets) {\n const v: CLITargetURLEntry = { url: target.url };\n if (target.include) {\n const includeOpts = ObjectHelper.clean(getCLIIncludeOptions(target), {\n deep: true, cleanNulls: true, cleanEmptyObjects: true\n });\n if (Object.entries(includeOpts).length > 0) {\n v.include = includeOpts;\n }\n }\n result.push(v);\n }\n\n return result;\n}\n"]}
|
|
@@ -39,6 +39,7 @@ const CONFIG_FILE_PROPS = {
|
|
|
39
39
|
campaignInfo: 'include:campaign.info',
|
|
40
40
|
contentInfo: 'include:content.info',
|
|
41
41
|
previewMedia: 'include:preview.media',
|
|
42
|
+
protectedMedia: 'include:protected.media',
|
|
42
43
|
contentMedia: 'include:content.media',
|
|
43
44
|
allMediaVariants: 'include:all.media.variants',
|
|
44
45
|
mediaThumbnails: 'include:media.thumbnails',
|
|
@@ -127,6 +128,7 @@ class ConfigFileParser {
|
|
|
127
128
|
contentInfo: __getValue(CONFIG_FILE_PROPS.include.contentInfo),
|
|
128
129
|
previewMedia: __getValue(CONFIG_FILE_PROPS.include.previewMedia),
|
|
129
130
|
contentMedia: __getValue(CONFIG_FILE_PROPS.include.contentMedia),
|
|
131
|
+
protectedMedia: __getValue(CONFIG_FILE_PROPS.include.protectedMedia),
|
|
130
132
|
allMediaVariants: __getValue(CONFIG_FILE_PROPS.include.allMediaVariants),
|
|
131
133
|
mediaThumbnails: __getValue(CONFIG_FILE_PROPS.include.mediaThumbnails),
|
|
132
134
|
mediaByFilename: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigFileParser.js","sourceRoot":"","sources":["../../src/cli/ConfigFileParser.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AAIxC,MAAM,iBAAiB,GAAG;IACxB,SAAS,EAAE,uBAAuB;IAClC,MAAM,EAAE,mBAAmB;IAC3B,cAAc,EAAE,6BAA6B;IAC7C,MAAM,EAAE,oBAAoB;IAC5B,QAAQ,EAAE,sBAAsB;IAChC,YAAY,EAAE,2BAA2B;IACzC,kBAAkB,EAAE,iCAAiC;IACrD,UAAU,EAAE,yBAAyB;IACrC,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,gBAAgB;IACxB,aAAa,EAAE;QACb,QAAQ,EAAE,iCAAiC;QAC3C,OAAO,EAAE,gCAAgC;KAC1C;IACD,cAAc,EAAE;QACd,KAAK,EAAE,8BAA8B;KACtC;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,mCAAmC;QAC5C,IAAI,EAAE,gCAAgC;QACtC,OAAO,EAAE,oCAAoC;KAC9C;IACD,OAAO,EAAE;QACP,aAAa,EAAE,wBAAwB;QACvC,kBAAkB,EAAE,+BAA+B;QACnD,WAAW,EAAE,uBAAuB;QACpC,mBAAmB,EAAE,+BAA+B;QACpD,oBAAoB,EAAE,gCAAgC;QACtD,sBAAsB,EAAE,kCAAkC;QAC1D,uBAAuB,EAAE,mCAAmC;QAC5D,YAAY,EAAE,uBAAuB;QACrC,WAAW,EAAE,sBAAsB;QACnC,YAAY,EAAE,uBAAuB;QACrC,YAAY,EAAE,uBAAuB;QACrC,gBAAgB,EAAE,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CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;eA9JkB,gBAAgB","sourcesContent":["import ConfigParser from 'configparser';\nimport { type CLIOptionParserEntry, type CLIOptions } from './CLIOptions.js';\nimport { type DeepPartial, type RecursivePropsTo } from '../utils/Misc.js';\n\nconst CONFIG_FILE_PROPS = {\n targetURL: 'downloader:target.url',\n cookie: 'downloader:cookie',\n useStatusCache: 'downloader:use.status.cache',\n stopOn: 'downloader:stop.on',\n noPrompt: 'downloader:no.prompt',\n pathToFFmpeg: 'downloader:path.to.ffmpeg',\n maxVideoResolution: 'downloader:max.video.resolution',\n pathToDeno: 'downloader:path.to.deno',\n dryRun: 'downloader:dry.run',\n outDir: 'output:out.dir',\n dirNameFormat: {\n campaign: 'output:campaign.dir.name.format',\n content: 'output:content.dir.name.format'\n },\n filenameFormat: {\n media: 'output:media.filename.format'\n },\n fileExistsAction: {\n content: 'output:content.file.exists.action',\n info: 'output:info.file.exists.action',\n infoAPI: 'output:info.api.file.exists.action'\n },\n include: {\n lockedContent: 'include:locked.content',\n postsWithMediaType: 'include:posts.with.media.type',\n postsInTier: 'include:posts.in.tier',\n postsPublishedAfter: 'include:posts.published.after',\n postsPublishedBefore: 'include:posts.published.before',\n productsPublishedAfter: 'include:products.published.after',\n productsPublishedBefore: 'include:products.published.before',\n campaignInfo: 'include:campaign.info',\n contentInfo: 'include:content.info',\n previewMedia: 'include:preview.media',\n contentMedia: 'include:content.media',\n allMediaVariants: 'include:all.media.variants',\n mediaThumbnails: 'include:media.thumbnails',\n imagesByFilename: 'include:images.by.filename',\n audioByFilename: 'include.audio.by.filename',\n attachmentsByFilename: 'include:attachments.by.filename',\n comments: 'include:comments'\n },\n request: {\n maxRetries: 'request:max.retries',\n maxConcurrent: 'request:max.concurrent',\n minTime: 'request:min.time',\n proxy: {\n url: 'request:proxy.url',\n rejectUnauthorizedTLS: 'request:proxy.reject.unauthorized.tls'\n },\n userAgent: 'request:user.agent'\n },\n consoleLogger: {\n enabled: 'logger.console:enabled',\n logLevel: 'logger.console:log.level',\n include: {\n dateTime: 'logger.console:include.date.time',\n level: 'logger.console:include.level',\n originator: 'logger.console:include.originator',\n errorStack: 'logger.console:include.error.stack'\n },\n dateTimeFormat: 'logger.console:date.time.format',\n color: 'logger.console:color'\n },\n fileLogger: {\n enabled: ':enabled',\n logDir: ':log.dir',\n logFilename: ':log.filename',\n fileExistsAction: ':file.exists.action',\n logLevel: ':log.level',\n include: {\n dateTime: ':include.date.time',\n level: ':include.level',\n originator: ':include.originator',\n errorStack: ':include.error.stack'\n },\n dateTimeFormat: ':date.time.format',\n color: ':color'\n },\n embedDownloader: {\n exec: ':exec'\n }\n};\n\nexport type ConfigFileParseResult = RecursivePropsTo<DeepPartial<Omit<CLIOptions, 'targetURLs'>>, CLIOptionParserEntry> & {\n targetURLs?: CLIOptionParserEntry;\n};\n\nexport default class ConfigFileParser {\n\n static parse(file: string): ConfigFileParseResult {\n const parser = new ConfigParser();\n\n parser.read(file);\n\n const __getValue = (prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, prop);\n };\n\n return {\n targetURLs: __getValue(CONFIG_FILE_PROPS.targetURL),\n cookie: __getValue(CONFIG_FILE_PROPS.cookie),\n useStatusCache: __getValue(CONFIG_FILE_PROPS.useStatusCache),\n stopOn: __getValue(CONFIG_FILE_PROPS.stopOn),\n pathToFFmpeg: __getValue(CONFIG_FILE_PROPS.pathToFFmpeg),\n maxVideoResolution: __getValue(CONFIG_FILE_PROPS.maxVideoResolution),\n pathToDeno: __getValue(CONFIG_FILE_PROPS.pathToDeno),\n outDir: __getValue(CONFIG_FILE_PROPS.outDir),\n dirNameFormat: {\n campaign: __getValue(CONFIG_FILE_PROPS.dirNameFormat.campaign),\n content: __getValue(CONFIG_FILE_PROPS.dirNameFormat.content)\n },\n filenameFormat: {\n media: __getValue(CONFIG_FILE_PROPS.filenameFormat.media)\n },\n include: {\n lockedContent: __getValue(CONFIG_FILE_PROPS.include.lockedContent),\n postsWithMediaType: __getValue(CONFIG_FILE_PROPS.include.postsWithMediaType),\n postsInTier: __getValue(CONFIG_FILE_PROPS.include.postsInTier),\n postsPublished: {\n after: __getValue(CONFIG_FILE_PROPS.include.postsPublishedAfter),\n before: __getValue(CONFIG_FILE_PROPS.include.postsPublishedBefore),\n },\n productsPublished: {\n after: __getValue(CONFIG_FILE_PROPS.include.productsPublishedAfter),\n before: __getValue(CONFIG_FILE_PROPS.include.productsPublishedBefore),\n },\n campaignInfo: __getValue(CONFIG_FILE_PROPS.include.campaignInfo),\n contentInfo: __getValue(CONFIG_FILE_PROPS.include.contentInfo),\n previewMedia: __getValue(CONFIG_FILE_PROPS.include.previewMedia),\n contentMedia: __getValue(CONFIG_FILE_PROPS.include.contentMedia),\n allMediaVariants: __getValue(CONFIG_FILE_PROPS.include.allMediaVariants),\n mediaThumbnails: __getValue(CONFIG_FILE_PROPS.include.mediaThumbnails),\n mediaByFilename: {\n images: __getValue(CONFIG_FILE_PROPS.include.imagesByFilename),\n audio: __getValue(CONFIG_FILE_PROPS.include.audioByFilename),\n attachments: __getValue(CONFIG_FILE_PROPS.include.attachmentsByFilename)\n },\n comments: __getValue(CONFIG_FILE_PROPS.include.comments)\n },\n request: {\n maxRetries: __getValue(CONFIG_FILE_PROPS.request.maxRetries),\n maxConcurrent: __getValue(CONFIG_FILE_PROPS.request.maxConcurrent),\n minTime: __getValue(CONFIG_FILE_PROPS.request.minTime),\n proxy: {\n url: __getValue(CONFIG_FILE_PROPS.request.proxy.url),\n rejectUnauthorizedTLS: __getValue(CONFIG_FILE_PROPS.request.proxy.rejectUnauthorizedTLS),\n },\n userAgent: __getValue(CONFIG_FILE_PROPS.request.userAgent),\n },\n fileExistsAction: {\n content: __getValue(CONFIG_FILE_PROPS.fileExistsAction.content),\n info: __getValue(CONFIG_FILE_PROPS.fileExistsAction.info),\n infoAPI: __getValue(CONFIG_FILE_PROPS.fileExistsAction.infoAPI)\n },\n noPrompt: __getValue(CONFIG_FILE_PROPS.noPrompt),\n dryRun: __getValue(CONFIG_FILE_PROPS.dryRun),\n consoleLogger: {\n enabled: __getValue(CONFIG_FILE_PROPS.consoleLogger.enabled),\n logLevel: __getValue(CONFIG_FILE_PROPS.consoleLogger.logLevel),\n include: {\n dateTime: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.dateTime),\n level: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.level),\n originator: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.originator),\n errorStack: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.errorStack)\n },\n dateTimeFormat: __getValue(CONFIG_FILE_PROPS.consoleLogger.dateTimeFormat),\n color: __getValue(CONFIG_FILE_PROPS.consoleLogger.color)\n },\n fileLoggers: this.#parseFileLoggerOptions(parser),\n embedDownloaders: this.#parseEmbedDownloaderOptions(parser)\n };\n }\n\n static #getValueFromConfigParser(parser: ConfigParser, prop: string): CLIOptionParserEntry | undefined {\n const [ section, key ] = prop.split(':');\n let value = parser.get(section, key, true)?.trim();\n if (value && value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substring(1, value.length - 1);\n }\n if (value) {\n return {\n src: 'cfg',\n section,\n key,\n value\n };\n }\n return undefined;\n }\n\n static #parseFileLoggerOptions(parser: ConfigParser) {\n const __getValue = (section: string, prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, `${section}${prop}`);\n };\n\n const sections = parser.sections().filter((section) => section.startsWith('logger.file.'));\n\n const loggers = sections.reduce<NonNullable<ConfigFileParseResult['fileLoggers']>>((result, section) => {\n result.push({\n enabled: __getValue(section, CONFIG_FILE_PROPS.fileLogger.enabled),\n logDir: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logDir),\n logFilename: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logFilename),\n fileExistsAction: __getValue(section, CONFIG_FILE_PROPS.fileLogger.fileExistsAction),\n logLevel: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logLevel),\n include: {\n dateTime: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.dateTime),\n level: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.level),\n originator: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.originator),\n errorStack: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.errorStack)\n },\n dateTimeFormat: __getValue(section, CONFIG_FILE_PROPS.fileLogger.dateTimeFormat),\n color: __getValue(section, CONFIG_FILE_PROPS.fileLogger.color)\n });\n return result;\n }, []);\n\n return loggers.length > 0 ? loggers : undefined;\n }\n\n static #parseEmbedDownloaderOptions(parser: ConfigParser) {\n const __getValue = (section: string, prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, `${section}${prop}`);\n };\n\n const sections = parser.sections().filter((section) => section.startsWith('embed.downloader.'));\n const prefixLength = 'embed.downloader.'.length;\n const embedDownloaders = sections.reduce<NonNullable<ConfigFileParseResult['embedDownloaders']>>((result, section) => {\n const provider = section.substring(prefixLength).trim().toLowerCase();\n if (!provider) {\n throw Error('Config file section \\'embed.downloader.<provider>\\' is missing the provider name');\n }\n if (result.find((dl) => dl.provider?.value === provider)) {\n throw Error(`Duplicate config file section 'embed.downloader.${provider}`);\n }\n const exec = __getValue(section, CONFIG_FILE_PROPS.embedDownloader.exec);\n if (exec) {\n result.push({\n provider: { src: 'cfg', section: `embed.downloader.${provider}`, key: 'provider', value: provider },\n exec\n });\n }\n return result;\n }, []);\n\n return embedDownloaders.length > 0 ? embedDownloaders : undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigFileParser.js","sourceRoot":"","sources":["../../src/cli/ConfigFileParser.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,YAAY,MAAM,cAAc,CAAC;AAIxC,MAAM,iBAAiB,GAAG;IACxB,SAAS,EAAE,uBAAuB;IAClC,MAAM,EAAE,mBAAmB;IAC3B,cAAc,EAAE,6BAA6B;IAC7C,MAAM,EAAE,oBAAoB;IAC5B,QAA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AAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACtE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,KAAK,CAAC,kFAAkF,CAAC,CAAC;QAClG,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;YACzD,MAAM,KAAK,CAAC,mDAAmD,QAAQ,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACzE,IAAI,IAAI,EAAE,CAAC;YACT,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,oBAAoB,QAAQ,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE;gBACnG,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;eA/JkB,gBAAgB","sourcesContent":["import ConfigParser from 'configparser';\nimport { type CLIOptionParserEntry, type CLIOptions } from './CLIOptions.js';\nimport { type DeepPartial, type RecursivePropsTo } from '../utils/Misc.js';\n\nconst CONFIG_FILE_PROPS = {\n targetURL: 'downloader:target.url',\n cookie: 'downloader:cookie',\n useStatusCache: 'downloader:use.status.cache',\n stopOn: 'downloader:stop.on',\n noPrompt: 'downloader:no.prompt',\n pathToFFmpeg: 'downloader:path.to.ffmpeg',\n maxVideoResolution: 'downloader:max.video.resolution',\n pathToDeno: 'downloader:path.to.deno',\n dryRun: 'downloader:dry.run',\n outDir: 'output:out.dir',\n dirNameFormat: {\n campaign: 'output:campaign.dir.name.format',\n content: 'output:content.dir.name.format'\n },\n filenameFormat: {\n media: 'output:media.filename.format'\n },\n fileExistsAction: {\n content: 'output:content.file.exists.action',\n info: 'output:info.file.exists.action',\n infoAPI: 'output:info.api.file.exists.action'\n },\n include: {\n lockedContent: 'include:locked.content',\n postsWithMediaType: 'include:posts.with.media.type',\n postsInTier: 'include:posts.in.tier',\n postsPublishedAfter: 'include:posts.published.after',\n postsPublishedBefore: 'include:posts.published.before',\n productsPublishedAfter: 'include:products.published.after',\n productsPublishedBefore: 'include:products.published.before',\n campaignInfo: 'include:campaign.info',\n contentInfo: 'include:content.info',\n previewMedia: 'include:preview.media',\n protectedMedia: 'include:protected.media',\n contentMedia: 'include:content.media',\n allMediaVariants: 'include:all.media.variants',\n mediaThumbnails: 'include:media.thumbnails',\n imagesByFilename: 'include:images.by.filename',\n audioByFilename: 'include.audio.by.filename',\n attachmentsByFilename: 'include:attachments.by.filename',\n comments: 'include:comments'\n },\n request: {\n maxRetries: 'request:max.retries',\n maxConcurrent: 'request:max.concurrent',\n minTime: 'request:min.time',\n proxy: {\n url: 'request:proxy.url',\n rejectUnauthorizedTLS: 'request:proxy.reject.unauthorized.tls'\n },\n userAgent: 'request:user.agent'\n },\n consoleLogger: {\n enabled: 'logger.console:enabled',\n logLevel: 'logger.console:log.level',\n include: {\n dateTime: 'logger.console:include.date.time',\n level: 'logger.console:include.level',\n originator: 'logger.console:include.originator',\n errorStack: 'logger.console:include.error.stack'\n },\n dateTimeFormat: 'logger.console:date.time.format',\n color: 'logger.console:color'\n },\n fileLogger: {\n enabled: ':enabled',\n logDir: ':log.dir',\n logFilename: ':log.filename',\n fileExistsAction: ':file.exists.action',\n logLevel: ':log.level',\n include: {\n dateTime: ':include.date.time',\n level: ':include.level',\n originator: ':include.originator',\n errorStack: ':include.error.stack'\n },\n dateTimeFormat: ':date.time.format',\n color: ':color'\n },\n embedDownloader: {\n exec: ':exec'\n }\n};\n\nexport type ConfigFileParseResult = RecursivePropsTo<DeepPartial<Omit<CLIOptions, 'targetURLs'>>, CLIOptionParserEntry> & {\n targetURLs?: CLIOptionParserEntry;\n};\n\nexport default class ConfigFileParser {\n\n static parse(file: string): ConfigFileParseResult {\n const parser = new ConfigParser();\n\n parser.read(file);\n\n const __getValue = (prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, prop);\n };\n\n return {\n targetURLs: __getValue(CONFIG_FILE_PROPS.targetURL),\n cookie: __getValue(CONFIG_FILE_PROPS.cookie),\n useStatusCache: __getValue(CONFIG_FILE_PROPS.useStatusCache),\n stopOn: __getValue(CONFIG_FILE_PROPS.stopOn),\n pathToFFmpeg: __getValue(CONFIG_FILE_PROPS.pathToFFmpeg),\n maxVideoResolution: __getValue(CONFIG_FILE_PROPS.maxVideoResolution),\n pathToDeno: __getValue(CONFIG_FILE_PROPS.pathToDeno),\n outDir: __getValue(CONFIG_FILE_PROPS.outDir),\n dirNameFormat: {\n campaign: __getValue(CONFIG_FILE_PROPS.dirNameFormat.campaign),\n content: __getValue(CONFIG_FILE_PROPS.dirNameFormat.content)\n },\n filenameFormat: {\n media: __getValue(CONFIG_FILE_PROPS.filenameFormat.media)\n },\n include: {\n lockedContent: __getValue(CONFIG_FILE_PROPS.include.lockedContent),\n postsWithMediaType: __getValue(CONFIG_FILE_PROPS.include.postsWithMediaType),\n postsInTier: __getValue(CONFIG_FILE_PROPS.include.postsInTier),\n postsPublished: {\n after: __getValue(CONFIG_FILE_PROPS.include.postsPublishedAfter),\n before: __getValue(CONFIG_FILE_PROPS.include.postsPublishedBefore),\n },\n productsPublished: {\n after: __getValue(CONFIG_FILE_PROPS.include.productsPublishedAfter),\n before: __getValue(CONFIG_FILE_PROPS.include.productsPublishedBefore),\n },\n campaignInfo: __getValue(CONFIG_FILE_PROPS.include.campaignInfo),\n contentInfo: __getValue(CONFIG_FILE_PROPS.include.contentInfo),\n previewMedia: __getValue(CONFIG_FILE_PROPS.include.previewMedia),\n contentMedia: __getValue(CONFIG_FILE_PROPS.include.contentMedia),\n protectedMedia: __getValue(CONFIG_FILE_PROPS.include.protectedMedia),\n allMediaVariants: __getValue(CONFIG_FILE_PROPS.include.allMediaVariants),\n mediaThumbnails: __getValue(CONFIG_FILE_PROPS.include.mediaThumbnails),\n mediaByFilename: {\n images: __getValue(CONFIG_FILE_PROPS.include.imagesByFilename),\n audio: __getValue(CONFIG_FILE_PROPS.include.audioByFilename),\n attachments: __getValue(CONFIG_FILE_PROPS.include.attachmentsByFilename)\n },\n comments: __getValue(CONFIG_FILE_PROPS.include.comments)\n },\n request: {\n maxRetries: __getValue(CONFIG_FILE_PROPS.request.maxRetries),\n maxConcurrent: __getValue(CONFIG_FILE_PROPS.request.maxConcurrent),\n minTime: __getValue(CONFIG_FILE_PROPS.request.minTime),\n proxy: {\n url: __getValue(CONFIG_FILE_PROPS.request.proxy.url),\n rejectUnauthorizedTLS: __getValue(CONFIG_FILE_PROPS.request.proxy.rejectUnauthorizedTLS),\n },\n userAgent: __getValue(CONFIG_FILE_PROPS.request.userAgent),\n },\n fileExistsAction: {\n content: __getValue(CONFIG_FILE_PROPS.fileExistsAction.content),\n info: __getValue(CONFIG_FILE_PROPS.fileExistsAction.info),\n infoAPI: __getValue(CONFIG_FILE_PROPS.fileExistsAction.infoAPI)\n },\n noPrompt: __getValue(CONFIG_FILE_PROPS.noPrompt),\n dryRun: __getValue(CONFIG_FILE_PROPS.dryRun),\n consoleLogger: {\n enabled: __getValue(CONFIG_FILE_PROPS.consoleLogger.enabled),\n logLevel: __getValue(CONFIG_FILE_PROPS.consoleLogger.logLevel),\n include: {\n dateTime: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.dateTime),\n level: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.level),\n originator: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.originator),\n errorStack: __getValue(CONFIG_FILE_PROPS.consoleLogger.include.errorStack)\n },\n dateTimeFormat: __getValue(CONFIG_FILE_PROPS.consoleLogger.dateTimeFormat),\n color: __getValue(CONFIG_FILE_PROPS.consoleLogger.color)\n },\n fileLoggers: this.#parseFileLoggerOptions(parser),\n embedDownloaders: this.#parseEmbedDownloaderOptions(parser)\n };\n }\n\n static #getValueFromConfigParser(parser: ConfigParser, prop: string): CLIOptionParserEntry | undefined {\n const [ section, key ] = prop.split(':');\n let value = parser.get(section, key, true)?.trim();\n if (value && value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substring(1, value.length - 1);\n }\n if (value) {\n return {\n src: 'cfg',\n section,\n key,\n value\n };\n }\n return undefined;\n }\n\n static #parseFileLoggerOptions(parser: ConfigParser) {\n const __getValue = (section: string, prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, `${section}${prop}`);\n };\n\n const sections = parser.sections().filter((section) => section.startsWith('logger.file.'));\n\n const loggers = sections.reduce<NonNullable<ConfigFileParseResult['fileLoggers']>>((result, section) => {\n result.push({\n enabled: __getValue(section, CONFIG_FILE_PROPS.fileLogger.enabled),\n logDir: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logDir),\n logFilename: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logFilename),\n fileExistsAction: __getValue(section, CONFIG_FILE_PROPS.fileLogger.fileExistsAction),\n logLevel: __getValue(section, CONFIG_FILE_PROPS.fileLogger.logLevel),\n include: {\n dateTime: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.dateTime),\n level: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.level),\n originator: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.originator),\n errorStack: __getValue(section, CONFIG_FILE_PROPS.fileLogger.include.errorStack)\n },\n dateTimeFormat: __getValue(section, CONFIG_FILE_PROPS.fileLogger.dateTimeFormat),\n color: __getValue(section, CONFIG_FILE_PROPS.fileLogger.color)\n });\n return result;\n }, []);\n\n return loggers.length > 0 ? loggers : undefined;\n }\n\n static #parseEmbedDownloaderOptions(parser: ConfigParser) {\n const __getValue = (section: string, prop: string): CLIOptionParserEntry | undefined => {\n return this.#getValueFromConfigParser(parser, `${section}${prop}`);\n };\n\n const sections = parser.sections().filter((section) => section.startsWith('embed.downloader.'));\n const prefixLength = 'embed.downloader.'.length;\n const embedDownloaders = sections.reduce<NonNullable<ConfigFileParseResult['embedDownloaders']>>((result, section) => {\n const provider = section.substring(prefixLength).trim().toLowerCase();\n if (!provider) {\n throw Error('Config file section \\'embed.downloader.<provider>\\' is missing the provider name');\n }\n if (result.find((dl) => dl.provider?.value === provider)) {\n throw Error(`Duplicate config file section 'embed.downloader.${provider}`);\n }\n const exec = __getValue(section, CONFIG_FILE_PROPS.embedDownloader.exec);\n if (exec) {\n result.push({\n provider: { src: 'cfg', section: `embed.downloader.${provider}`, key: 'provider', value: provider },\n exec\n });\n }\n return result;\n }, []);\n\n return embedDownloaders.length > 0 ? embedDownloaders : undefined;\n }\n}\n"]}
|
|
@@ -27,6 +27,7 @@ export interface DownloaderIncludeOptions {
|
|
|
27
27
|
contentInfo?: boolean;
|
|
28
28
|
previewMedia?: boolean | Array<'image' | 'video' | 'audio'>;
|
|
29
29
|
contentMedia?: boolean | Array<'image' | 'video' | 'audio' | 'attachment' | 'file'>;
|
|
30
|
+
protectedMedia?: boolean;
|
|
30
31
|
allMediaVariants?: boolean;
|
|
31
32
|
mediaThumbnails?: boolean;
|
|
32
33
|
mediaByFilename?: {
|
|
@@ -30,6 +30,7 @@ const DEFAULT_DOWNLOADER_INIT = {
|
|
|
30
30
|
campaignInfo: true,
|
|
31
31
|
contentInfo: true,
|
|
32
32
|
previewMedia: true,
|
|
33
|
+
protectedMedia: false,
|
|
33
34
|
contentMedia: true,
|
|
34
35
|
allMediaVariants: false,
|
|
35
36
|
mediaThumbnails: true,
|
|
@@ -101,6 +102,7 @@ export function getDownloaderInit(options) {
|
|
|
101
102
|
campaignInfo: pickDefined(options?.include?.campaignInfo, defaults.include.campaignInfo),
|
|
102
103
|
contentInfo: pickDefined(options?.include?.contentInfo, defaults.include.contentInfo),
|
|
103
104
|
previewMedia: pickDefined(options?.include?.previewMedia, defaults.include.previewMedia),
|
|
105
|
+
protectedMedia: pickDefined(options?.include?.protectedMedia, defaults.include.protectedMedia),
|
|
104
106
|
contentMedia: pickDefined(options?.include?.contentMedia, defaults.include.contentMedia),
|
|
105
107
|
allMediaVariants: pickDefined(options?.include?.allMediaVariants, defaults.include.allMediaVariants),
|
|
106
108
|
mediaThumbnails: pickDefined(options?.include?.mediaThumbnails, defaults.include.mediaThumbnails),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloaderOptions.js","sourceRoot":"","sources":["../../src/downloaders/DownloaderOptions.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAqB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGlE,MAAM,kBAAkB,GAAG,+HAA+H,CAAC;AAyG3J,MAAM,uBAAuB,GAAmB;IAC9C,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE;IACrB,cAAc,EAAE,IAAI;IACpB,MAAM,EAAE,OAAO;IACf,YAAY,EAAE,IAAI;IAClB,wBAAwB,EAAE,IAAI;IAC9B,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE;QACb,QAAQ,EAAE,uCAAuC;QACjD,OAAO,EAAE,kCAAkC;KAC5C;IACD,cAAc,EAAE;QACd,KAAK,EAAE,kBAAkB;KAC1B;IACD,OAAO,EAAE;QACP,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,KAAK;QACzB,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE;YACd,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,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AW,CAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC;QACzF,MAAM,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,uBAAuB,CAAC,MAAM,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,GAAG,iBAAiB,EAAE;QACtB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,IAAI;QACxB,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport type Logger from '../utils/logging/Logger.js';\nimport { type DeepRequired, pickDefined } from '../utils/Misc.js';\nimport type DateTime from '../utils/DateTime.js';\n\nconst DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0';\n\n\nexport type FileExistsAction = 'overwrite' | 'skip' | 'saveAsCopy' | 'saveAsCopyIfNewer';\nexport type StopOnCondition =\n 'never'\n | 'previouslyDownloaded'\n | 'publishDateOutOfRange'\n /**\n * @deprecated\n */\n | 'postPreviouslyDownloaded'\n /**\n * @deprecated\n */\n | 'postPublishDateOutOfRange';\n\nexport interface DownloaderIncludeOptions {\n lockedContent?: boolean;\n postsWithMediaType?: Array<'image' | 'video' | 'audio' | 'attachment' | 'podcast'> | 'any' | 'none';\n postsInTier?: Array<string> | 'any';\n postsPublished?: {\n after?: DateTime | null;\n before?: DateTime | null;\n }\n productsPublished?: {\n after?: DateTime | null;\n before?: DateTime | null;\n };\n campaignInfo?: boolean;\n contentInfo?: boolean;\n previewMedia?: boolean | Array<'image' | 'video' | 'audio'>;\n contentMedia?: boolean | Array<'image' | 'video' | 'audio' | 'attachment' | 'file'>;\n allMediaVariants?: boolean;\n mediaThumbnails?: boolean;\n mediaByFilename?: {\n images?: string | null;\n audio?: string | null;\n attachments?: string | null;\n };\n comments?: boolean;\n}\n\nexport interface ProxyOptions {\n url: string;\n rejectUnauthorizedTLS?: boolean;\n}\n\nexport interface EmbedDownloader {\n provider: string;\n exec: string;\n}\n\nexport interface DownloaderOptions {\n cookie?: string;\n useStatusCache?: boolean;\n stopOn?: StopOnCondition;\n pathToFFmpeg?: string | null;\n pathToYouTubeCredentials?: string | null;\n pathToDeno?: string | null;\n outDir?: string;\n dirNameFormat?: {\n campaign?: string;\n content?: string;\n };\n filenameFormat?: {\n media?: string;\n }\n include?: DownloaderIncludeOptions;\n request?: {\n maxRetries?: number;\n maxConcurrent?: number;\n minTime?: number;\n proxy?: ProxyOptions | null;\n userAgent?: string;\n };\n fileExistsAction?: {\n content?: FileExistsAction;\n info?: FileExistsAction;\n infoAPI?: FileExistsAction;\n };\n embedDownloaders?: EmbedDownloader[];\n maxVideoResolution?: number | null;\n logger?: Logger | null;\n dryRun?: boolean;\n}\n\nexport type DownloaderInit = DeepRequired<Pick<DownloaderOptions,\n 'outDir' |\n 'useStatusCache' |\n 'stopOn' |\n 'pathToFFmpeg' |\n 'pathToYouTubeCredentials' |\n 'pathToDeno' |\n 'dirNameFormat' |\n 'filenameFormat' |\n 'include' |\n 'request' |\n 'fileExistsAction' |\n 'embedDownloaders' |\n 'dryRun'>> & {\n cookie?: string;\n maxVideoResolution?: number | null;\n };\n\nconst DEFAULT_DOWNLOADER_INIT: DownloaderInit = {\n outDir: process.cwd(),\n useStatusCache: true,\n stopOn: 'never',\n pathToFFmpeg: null,\n pathToYouTubeCredentials: null,\n pathToDeno: null,\n dirNameFormat: {\n campaign: '{creator.vanity}[ - ]?{campaign.name}',\n content: '{content.id}[ - ]?{content.name}'\n },\n filenameFormat: {\n media: '{media.filename}'\n },\n include: {\n lockedContent: true,\n postsWithMediaType: 'any',\n postsInTier: 'any',\n postsPublished: {\n after: null,\n before: null\n },\n productsPublished: {\n after: null,\n before: null\n },\n campaignInfo: true,\n contentInfo: true,\n previewMedia: true,\n contentMedia: true,\n allMediaVariants: false,\n mediaThumbnails: true,\n mediaByFilename: {\n images: null,\n audio: null,\n attachments: null\n },\n comments: false\n },\n request: {\n maxRetries: 3,\n maxConcurrent: 10,\n minTime: 333,\n proxy: {\n url: '',\n rejectUnauthorizedTLS: true\n },\n userAgent: DEFAULT_USER_AGENT\n },\n fileExistsAction: {\n content: 'skip',\n info: 'saveAsCopyIfNewer',\n infoAPI: 'overwrite'\n },\n embedDownloaders: [],\n maxVideoResolution: null,\n dryRun: false\n};\n\nexport function getDownloaderInit(options?: DownloaderOptions): DownloaderInit {\n const defaults = DEFAULT_DOWNLOADER_INIT;\n\n let proxy: DownloaderInit['request']['proxy'] = null;\n if (options?.request?.proxy && defaults.request.proxy) {\n proxy = {\n url: options.request.proxy.url,\n rejectUnauthorizedTLS: pickDefined(options.request.proxy.rejectUnauthorizedTLS, defaults.request.proxy.rejectUnauthorizedTLS)\n };\n }\n if (!proxy?.url) {\n proxy = null;\n }\n\n return {\n cookie: options?.cookie,\n outDir: options?.outDir ? path.resolve(options.outDir) : defaults.outDir,\n useStatusCache: pickDefined(options?.useStatusCache, defaults.useStatusCache),\n stopOn: pickDefined(options?.stopOn, defaults.stopOn),\n pathToFFmpeg: pickDefined(options?.pathToFFmpeg, defaults.pathToFFmpeg),\n pathToYouTubeCredentials: pickDefined(options?.pathToYouTubeCredentials, defaults.pathToYouTubeCredentials),\n pathToDeno: pickDefined(options?.pathToDeno, defaults.pathToDeno),\n dirNameFormat: {\n campaign: options?.dirNameFormat?.campaign || defaults.dirNameFormat.campaign,\n content: options?.dirNameFormat?.content || defaults.dirNameFormat.content\n },\n filenameFormat: {\n media: options?.filenameFormat?.media || defaults.filenameFormat.media\n },\n include: {\n lockedContent: pickDefined(options?.include?.lockedContent, defaults.include.lockedContent),\n postsWithMediaType: pickDefined(options?.include?.postsWithMediaType, defaults.include.postsWithMediaType),\n postsInTier: pickDefined(options?.include?.postsInTier, defaults.include.postsInTier),\n postsPublished: {\n after: pickDefined(options?.include?.postsPublished?.after, defaults.include.postsPublished.after),\n before: pickDefined(options?.include?.postsPublished?.before, defaults.include.postsPublished.before)\n },\n productsPublished: {\n after: pickDefined(options?.include?.productsPublished?.after, defaults.include.productsPublished.after),\n before: pickDefined(options?.include?.productsPublished?.before, defaults.include.productsPublished.before)\n },\n campaignInfo: pickDefined(options?.include?.campaignInfo, defaults.include.campaignInfo),\n contentInfo: pickDefined(options?.include?.contentInfo, defaults.include.contentInfo),\n previewMedia: pickDefined(options?.include?.previewMedia, defaults.include.previewMedia),\n contentMedia: pickDefined(options?.include?.contentMedia, defaults.include.contentMedia),\n allMediaVariants: pickDefined(options?.include?.allMediaVariants, defaults.include.allMediaVariants),\n mediaThumbnails: pickDefined(options?.include?.mediaThumbnails, defaults.include.mediaThumbnails),\n mediaByFilename: {\n images: pickDefined(options?.include?.mediaByFilename?.images, defaults.include.mediaByFilename.images),\n audio: pickDefined(options?.include?.mediaByFilename?.audio, defaults.include.mediaByFilename.audio),\n attachments: pickDefined(options?.include?.mediaByFilename?.attachments, defaults.include.mediaByFilename.attachments)\n },\n comments: pickDefined(options?.include?.comments, defaults.include.comments)\n },\n request: {\n maxRetries: pickDefined(options?.request?.maxRetries, defaults.request.maxRetries),\n maxConcurrent: pickDefined(options?.request?.maxConcurrent, defaults.request.maxConcurrent),\n minTime: pickDefined(options?.request?.minTime, defaults.request.minTime),\n proxy,\n userAgent: pickDefined(options?.request?.userAgent, defaults.request.userAgent)\n },\n fileExistsAction: {\n content: options?.fileExistsAction?.content || defaults.fileExistsAction.content,\n info: options?.fileExistsAction?.info || defaults.fileExistsAction.info,\n infoAPI: options?.fileExistsAction?.infoAPI || defaults.fileExistsAction.infoAPI\n },\n embedDownloaders: pickDefined(options?.embedDownloaders, defaults.embedDownloaders),\n maxVideoResolution: pickDefined(options?.maxVideoResolution, defaults.maxVideoResolution),\n dryRun: pickDefined(options?.dryRun, defaults.dryRun)\n };\n}\n\nexport function getDefaultDownloaderOutDir() {\n return DEFAULT_DOWNLOADER_INIT.outDir;\n}\n\nexport function getDefaultDownloaderOptions(): DeepRequired<DownloaderOptions> {\n return {\n ...getDownloaderInit(),\n cookie: '',\n maxVideoResolution: null,\n logger: null\n };\n}"]}
|
|
1
|
+
{"version":3,"file":"DownloaderOptions.js","sourceRoot":"","sources":["../../src/downloaders/DownloaderOptions.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAqB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGlE,MAAM,kBAAkB,GAAG,+HAA+H,CAAC;AA0G3J,MAAM,uBAAuB,GAAmB;IAC9C,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE;IACrB,cAAc,EAAE,IAAI;IACpB,MAAM,EAAE,OAAO;IACf,YAAY,EAAE,IAAI;IAClB,wBAAwB,EAAE,IAAI;IAC9B,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE;QACb,QAAQ,EAAE,uCAAuC;QACjD,OAAO,EAAE,kCAAkC;KAC5C;IACD,cAAc,EAAE;QACd,KAAK,EAAE,kBAAkB;KAC1B;IACD,OAAO,EAAE;QACP,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,KAAK;QACzB,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE;YACd,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,KAAK;QACvB,eAAe,EAAE,IAAI;QACrB,eAAe,EAAE;YACf,MAAM,EAAE,IAAI;YACZ,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI;SAClB;QACD,QAAQ,EAAE,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CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;KACtD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,OAAO,uBAAuB,CAAC,MAAM,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,GAAG,iBAAiB,EAAE;QACtB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,IAAI;QACxB,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport type Logger from '../utils/logging/Logger.js';\nimport { type DeepRequired, pickDefined } from '../utils/Misc.js';\nimport type DateTime from '../utils/DateTime.js';\n\nconst DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0';\n\n\nexport type FileExistsAction = 'overwrite' | 'skip' | 'saveAsCopy' | 'saveAsCopyIfNewer';\nexport type StopOnCondition =\n 'never'\n | 'previouslyDownloaded'\n | 'publishDateOutOfRange'\n /**\n * @deprecated\n */\n | 'postPreviouslyDownloaded'\n /**\n * @deprecated\n */\n | 'postPublishDateOutOfRange';\n\nexport interface DownloaderIncludeOptions {\n lockedContent?: boolean;\n postsWithMediaType?: Array<'image' | 'video' | 'audio' | 'attachment' | 'podcast'> | 'any' | 'none';\n postsInTier?: Array<string> | 'any';\n postsPublished?: {\n after?: DateTime | null;\n before?: DateTime | null;\n }\n productsPublished?: {\n after?: DateTime | null;\n before?: DateTime | null;\n };\n campaignInfo?: boolean;\n contentInfo?: boolean;\n previewMedia?: boolean | Array<'image' | 'video' | 'audio'>;\n contentMedia?: boolean | Array<'image' | 'video' | 'audio' | 'attachment' | 'file'>;\n protectedMedia?: boolean;\n allMediaVariants?: boolean;\n mediaThumbnails?: boolean;\n mediaByFilename?: {\n images?: string | null;\n audio?: string | null;\n attachments?: string | null;\n };\n comments?: boolean;\n}\n\nexport interface ProxyOptions {\n url: string;\n rejectUnauthorizedTLS?: boolean;\n}\n\nexport interface EmbedDownloader {\n provider: string;\n exec: string;\n}\n\nexport interface DownloaderOptions {\n cookie?: string;\n useStatusCache?: boolean;\n stopOn?: StopOnCondition;\n pathToFFmpeg?: string | null;\n pathToYouTubeCredentials?: string | null;\n pathToDeno?: string | null;\n outDir?: string;\n dirNameFormat?: {\n campaign?: string;\n content?: string;\n };\n filenameFormat?: {\n media?: string;\n }\n include?: DownloaderIncludeOptions;\n request?: {\n maxRetries?: number;\n maxConcurrent?: number;\n minTime?: number;\n proxy?: ProxyOptions | null;\n userAgent?: string;\n };\n fileExistsAction?: {\n content?: FileExistsAction;\n info?: FileExistsAction;\n infoAPI?: FileExistsAction;\n };\n embedDownloaders?: EmbedDownloader[];\n maxVideoResolution?: number | null;\n logger?: Logger | null;\n dryRun?: boolean;\n}\n\nexport type DownloaderInit = DeepRequired<Pick<DownloaderOptions,\n 'outDir' |\n 'useStatusCache' |\n 'stopOn' |\n 'pathToFFmpeg' |\n 'pathToYouTubeCredentials' |\n 'pathToDeno' |\n 'dirNameFormat' |\n 'filenameFormat' |\n 'include' |\n 'request' |\n 'fileExistsAction' |\n 'embedDownloaders' |\n 'dryRun'>> & {\n cookie?: string;\n maxVideoResolution?: number | null;\n };\n\nconst DEFAULT_DOWNLOADER_INIT: DownloaderInit = {\n outDir: process.cwd(),\n useStatusCache: true,\n stopOn: 'never',\n pathToFFmpeg: null,\n pathToYouTubeCredentials: null,\n pathToDeno: null,\n dirNameFormat: {\n campaign: '{creator.vanity}[ - ]?{campaign.name}',\n content: '{content.id}[ - ]?{content.name}'\n },\n filenameFormat: {\n media: '{media.filename}'\n },\n include: {\n lockedContent: true,\n postsWithMediaType: 'any',\n postsInTier: 'any',\n postsPublished: {\n after: null,\n before: null\n },\n productsPublished: {\n after: null,\n before: null\n },\n campaignInfo: true,\n contentInfo: true,\n previewMedia: true,\n protectedMedia: false,\n contentMedia: true,\n allMediaVariants: false,\n mediaThumbnails: true,\n mediaByFilename: {\n images: null,\n audio: null,\n attachments: null\n },\n comments: false\n },\n request: {\n maxRetries: 3,\n maxConcurrent: 10,\n minTime: 333,\n proxy: {\n url: '',\n rejectUnauthorizedTLS: true\n },\n userAgent: DEFAULT_USER_AGENT\n },\n fileExistsAction: {\n content: 'skip',\n info: 'saveAsCopyIfNewer',\n infoAPI: 'overwrite'\n },\n embedDownloaders: [],\n maxVideoResolution: null,\n dryRun: false\n};\n\nexport function getDownloaderInit(options?: DownloaderOptions): DownloaderInit {\n const defaults = DEFAULT_DOWNLOADER_INIT;\n\n let proxy: DownloaderInit['request']['proxy'] = null;\n if (options?.request?.proxy && defaults.request.proxy) {\n proxy = {\n url: options.request.proxy.url,\n rejectUnauthorizedTLS: pickDefined(options.request.proxy.rejectUnauthorizedTLS, defaults.request.proxy.rejectUnauthorizedTLS)\n };\n }\n if (!proxy?.url) {\n proxy = null;\n }\n\n return {\n cookie: options?.cookie,\n outDir: options?.outDir ? path.resolve(options.outDir) : defaults.outDir,\n useStatusCache: pickDefined(options?.useStatusCache, defaults.useStatusCache),\n stopOn: pickDefined(options?.stopOn, defaults.stopOn),\n pathToFFmpeg: pickDefined(options?.pathToFFmpeg, defaults.pathToFFmpeg),\n pathToYouTubeCredentials: pickDefined(options?.pathToYouTubeCredentials, defaults.pathToYouTubeCredentials),\n pathToDeno: pickDefined(options?.pathToDeno, defaults.pathToDeno),\n dirNameFormat: {\n campaign: options?.dirNameFormat?.campaign || defaults.dirNameFormat.campaign,\n content: options?.dirNameFormat?.content || defaults.dirNameFormat.content\n },\n filenameFormat: {\n media: options?.filenameFormat?.media || defaults.filenameFormat.media\n },\n include: {\n lockedContent: pickDefined(options?.include?.lockedContent, defaults.include.lockedContent),\n postsWithMediaType: pickDefined(options?.include?.postsWithMediaType, defaults.include.postsWithMediaType),\n postsInTier: pickDefined(options?.include?.postsInTier, defaults.include.postsInTier),\n postsPublished: {\n after: pickDefined(options?.include?.postsPublished?.after, defaults.include.postsPublished.after),\n before: pickDefined(options?.include?.postsPublished?.before, defaults.include.postsPublished.before)\n },\n productsPublished: {\n after: pickDefined(options?.include?.productsPublished?.after, defaults.include.productsPublished.after),\n before: pickDefined(options?.include?.productsPublished?.before, defaults.include.productsPublished.before)\n },\n campaignInfo: pickDefined(options?.include?.campaignInfo, defaults.include.campaignInfo),\n contentInfo: pickDefined(options?.include?.contentInfo, defaults.include.contentInfo),\n previewMedia: pickDefined(options?.include?.previewMedia, defaults.include.previewMedia),\n protectedMedia: pickDefined(options?.include?.protectedMedia, defaults.include.protectedMedia),\n contentMedia: pickDefined(options?.include?.contentMedia, defaults.include.contentMedia),\n allMediaVariants: pickDefined(options?.include?.allMediaVariants, defaults.include.allMediaVariants),\n mediaThumbnails: pickDefined(options?.include?.mediaThumbnails, defaults.include.mediaThumbnails),\n mediaByFilename: {\n images: pickDefined(options?.include?.mediaByFilename?.images, defaults.include.mediaByFilename.images),\n audio: pickDefined(options?.include?.mediaByFilename?.audio, defaults.include.mediaByFilename.audio),\n attachments: pickDefined(options?.include?.mediaByFilename?.attachments, defaults.include.mediaByFilename.attachments)\n },\n comments: pickDefined(options?.include?.comments, defaults.include.comments)\n },\n request: {\n maxRetries: pickDefined(options?.request?.maxRetries, defaults.request.maxRetries),\n maxConcurrent: pickDefined(options?.request?.maxConcurrent, defaults.request.maxConcurrent),\n minTime: pickDefined(options?.request?.minTime, defaults.request.minTime),\n proxy,\n userAgent: pickDefined(options?.request?.userAgent, defaults.request.userAgent)\n },\n fileExistsAction: {\n content: options?.fileExistsAction?.content || defaults.fileExistsAction.content,\n info: options?.fileExistsAction?.info || defaults.fileExistsAction.info,\n infoAPI: options?.fileExistsAction?.infoAPI || defaults.fileExistsAction.infoAPI\n },\n embedDownloaders: pickDefined(options?.embedDownloaders, defaults.embedDownloaders),\n maxVideoResolution: pickDefined(options?.maxVideoResolution, defaults.maxVideoResolution),\n dryRun: pickDefined(options?.dryRun, defaults.dryRun)\n };\n}\n\nexport function getDefaultDownloaderOutDir() {\n return DEFAULT_DOWNLOADER_INIT.outDir;\n}\n\nexport function getDefaultDownloaderOptions(): DeepRequired<DownloaderOptions> {\n return {\n ...getDownloaderInit(),\n cookie: '',\n maxVideoResolution: null,\n logger: null\n };\n}"]}
|
|
@@ -14,6 +14,7 @@ export default class M3U8DownloadTask extends FFmpegDownloadTaskBase<VideoMediaI
|
|
|
14
14
|
#private;
|
|
15
15
|
name: string;
|
|
16
16
|
constructor(params: M3U8DownloadTaskParams);
|
|
17
|
+
start(): Promise<void>;
|
|
17
18
|
protected resolveDestPath(signal?: AbortSignal): Promise<string>;
|
|
18
19
|
protected getFFmpegCommandParams(signal?: AbortSignal): Promise<M3U8FFmpegCommandParams>;
|
|
19
20
|
protected getTargetDuration(): number | null;
|