Skip to content

Commit

Permalink
fix youtube capture + bump wabac.js to 2.19.1 (#230)
Browse files Browse the repository at this point in the history
- deps: bump to wabac 2.19.1
- add new html rx rewriting (from wabca.js 2.19.x) to fix youtube
- bump to 0.12.2
  • Loading branch information
ikreymer authored Jun 21, 2024
1 parent bcf1dd7 commit 449e829
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@webrecorder/archivewebpage",
"productName": "ArchiveWeb.page",
"version": "0.12.1",
"version": "0.12.2",
"main": "index.js",
"description": "Create Web Archives directly in your browser",
"repository": "https://github.com/webrecorder/archiveweb.page",
Expand All @@ -11,7 +11,7 @@
"@fortawesome/fontawesome-free": "^5.13.0",
"@ipld/car": "^5.3.1",
"@webrecorder/awp-sw": "^0.4.4",
"@webrecorder/wabac": "^2.18.3",
"@webrecorder/wabac": "^2.19.1",
"auto-js-ipfs": "^2.3.0",
"browsertrix-behaviors": "^0.6.0",
"btoa": "^1.2.1",
Expand Down
14 changes: 8 additions & 6 deletions src/recorder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RequestResponseInfo } from "./requestresponseinfo.js";

import { baseRules as baseDSRules } from "@webrecorder/wabac/src/rewrite";
import { baseRules as baseDSRules, htmlRules as htmlDSRules } from "@webrecorder/wabac/src/rewrite";
import { rewriteDASH, rewriteHLS } from "@webrecorder/wabac/src/rewrite/rewriteVideo";
import { Buffer } from "buffer";

Expand Down Expand Up @@ -988,6 +988,8 @@ class Recorder {
let newString = null;
let string = null;

const { url, extraOpts } = reqresp;

const ct = this._getContentType(params.responseHeaders);

switch (ct) {
Expand All @@ -1007,13 +1009,13 @@ class Recorder {
case "text/javascript":
case "application/javascript":
case "application/x-javascript": {
const rw = baseDSRules.getRewriter(params.request.url);
const rules = ct === "text/html" ? htmlDSRules : baseDSRules;
const rw = rules.getRewriter(url);

if (rw !== baseDSRules.defaultRewriter) {
string = payload.toString("utf-8");
newString = rw.rewrite(string, {live: true, save: reqresp.extraOpts});
if (rw !== rules.defaultRewriter) {
string = payload.toString();
newString = rw.rewrite(string, {live: true, save: extraOpts});
}
break;
}
}

Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -984,15 +984,15 @@
uuid "^9.0.0"
warcio "^2.2.1"

"@webrecorder/wabac@^2.17.3", "@webrecorder/wabac@^2.18.1", "@webrecorder/wabac@^2.18.3":
version "2.18.3"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.18.3.tgz#eda195452a9964e8216fb0676d5da6cc69239dae"
integrity sha512-qmNLXky9QHpljt0EyEmcO6L2qFGG63mZbMYKso0MZZLFY3NeUf/ANafq9pWWm1Bw10+zoV6KRtHUin8gropccA==
"@webrecorder/wabac@^2.17.3", "@webrecorder/wabac@^2.18.1", "@webrecorder/wabac@^2.19.1":
version "2.19.1"
resolved "https://registry.yarnpkg.com/@webrecorder/wabac/-/wabac-2.19.1.tgz#ce0d609f9e90c708af99945e1fa338be0ba2b5f9"
integrity sha512-m8Fi70OkhzkicbcbN5TrrBpj5D/EZKzVp5905kGPoC2F2zLqxUDMzx1FOHt2sTO/1b9NMvBmw9Pk1JQyYEm6rA==
dependencies:
"@peculiar/asn1-ecc" "^2.3.4"
"@peculiar/asn1-schema" "^2.3.3"
"@peculiar/x509" "^1.9.2"
"@webrecorder/wombat" "^3.7.6"
"@webrecorder/wombat" "^3.7.8"
acorn "^8.10.0"
auto-js-ipfs "^2.1.1"
base64-js "^1.5.1"
Expand All @@ -1013,10 +1013,10 @@
stream-browserify "^3.0.0"
warcio "^2.2.1"

"@webrecorder/wombat@^3.7.6":
version "3.7.6"
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.7.6.tgz#e52a1bcfccd0150517989bc4310a03730a1f74e7"
integrity sha512-SA34StdLc+D60Aa8bZ2I+8PLjody1B/j9DmZ2zyXg/EZuPLSG4ec6XvMzq8QYuoGvD+hkjAf0YlUGxmI/viIcw==
"@webrecorder/wombat@^3.7.8":
version "3.7.8"
resolved "https://registry.yarnpkg.com/@webrecorder/wombat/-/wombat-3.7.8.tgz#a414278b6fbd99bc02a97e384f0373307e60d9fa"
integrity sha512-BmEHrvGLHPQtECmCK9Oz7G3p2StsyaFOlNmAMDSNK/GjqPH+UWZOqDryBkWryTh+pFZXKblqyotLtvR4YxVyeQ==
dependencies:
warcio "^2.2.0"

Expand Down

0 comments on commit 449e829

Please sign in to comment.