diff --git a/README.md b/README.md index 101d84e7..d36a3064 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,7 @@ createDownloader({ .catch(console.error); ``` + +## Large video handling + +A large video has been replaced into a much smaller trailer for faster download of the package, get it back from [the original link](https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4) or [here](https://github.com/website-local/assets/releases/download/mdn-local/big_buck_bunny_720p_surround.mp4); diff --git a/src/mdn/process-url/redirect-download-link.ts b/src/mdn/process-url/redirect-download-link.ts index b91dcd0e..926f96de 100644 --- a/src/mdn/process-url/redirect-download-link.ts +++ b/src/mdn/process-url/redirect-download-link.ts @@ -2,6 +2,13 @@ import type {Resource} from 'website-scrap-engine/lib/resource'; import URI from 'urijs'; import {externalHosts} from './consts'; +const replacements = [ + // https://github.com/website-local/mdn-local/issues/938 + 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4', + // A much smaller file from http://download.blender.org/peach/trailer/trailer_iphone.m4v + 'https://github.com/website-local/assets/releases/download/mdn-local/trailer_iphone.mp4', +]; + export const redirectDownloadLink = (res: Resource): Resource => { const url = res.downloadLink; let uri, path; @@ -27,6 +34,9 @@ export const redirectDownloadLink = (res: Resource): Resource => { .host(externalHost.host) .path(path.slice(externalHost.pathPrefixLength)) .toString(); + if (res.downloadLink === replacements[0]) { + res.downloadLink = replacements[1]; + } return res; } }