From 05c0163874a8d3986be4a6e8132d26ecc00d6678 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Sat, 10 May 2025 19:27:52 +0000 Subject: [PATCH] test: improve fetch fixture handling --- .gitattributes | 1 + .../https:dropload.iojvjwrkpijr0f.html | 44 +++++++------- .../https:dropload.iolyo2h1snpe5c.html | 44 +++++++------- ...vedeutsch29992-black-mirror-anschauen.html | 42 +++++++------- ...searchandsubactionsearchandstorytt12345678 | 32 +++++----- ...osearchandsubactionsearchandstorytt2085059 | 32 +++++----- .../https:meinecloud.clickmoviett12345678 | 0 .../https:meinecloud.clickmoviett29141112 | 18 +++--- .../https:supervideo.cc22go50mon0ke.html | 44 +++++++------- .../https:supervideo.ccq7i0sw1oytw3 | 44 +++++++------- jest.config.ts | 12 ++-- jest.setup.ts | 22 +++++++ src/embed-extractor/Dropload.ts | 30 ++++++++++ src/embed-extractor/SuperVideo.ts | 31 ++++++++++ src/embed-extractor/index.ts | 10 ++++ src/embed-extractor/types.ts | 9 +++ src/handler/KinoKiste.test.ts | 22 ++----- src/handler/KinoKiste.ts | 58 +++++++------------ src/handler/MeineCloud.test.ts | 22 ++----- src/handler/MeineCloud.ts | 42 +++++--------- src/handler/types.ts | 6 +- src/index.ts | 6 +- src/types.ts | 4 +- src/utils/embed.test.ts | 46 +++------------ src/utils/embed.ts | 40 ++----------- src/utils/fetch.test.ts | 3 +- src/utils/index.ts | 1 + 27 files changed, 332 insertions(+), 333 deletions(-) create mode 100644 .gitattributes rename {src/handler/fixtures/kinokiste => fixtures/cachedFetchText}/https:dropload.iojvjwrkpijr0f.html (76%) rename {src/handler/fixtures/meinecloud => fixtures/cachedFetchText}/https:dropload.iolyo2h1snpe5c.html (91%) rename {src/handler/fixtures/kinokiste => fixtures/cachedFetchText}/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html (98%) rename {src/handler/fixtures/kinokiste => fixtures/cachedFetchText}/https:kinokiste.liveseriendosearchandsubactionsearchandstorytt12345678 (97%) rename {src/handler/fixtures/kinokiste => fixtures/cachedFetchText}/https:kinokiste.liveseriendosearchandsubactionsearchandstorytt2085059 (97%) rename {src/handler/fixtures/meinecloud => fixtures/cachedFetchText}/https:meinecloud.clickmoviett12345678 (100%) rename {src/handler/fixtures/meinecloud => fixtures/cachedFetchText}/https:meinecloud.clickmoviett29141112 (91%) rename {src/handler/fixtures/kinokiste => fixtures/cachedFetchText}/https:supervideo.cc22go50mon0ke.html (89%) rename {src/handler/fixtures/meinecloud => fixtures/cachedFetchText}/https:supervideo.ccq7i0sw1oytw3 (89%) create mode 100644 jest.setup.ts create mode 100644 src/embed-extractor/Dropload.ts create mode 100644 src/embed-extractor/SuperVideo.ts create mode 100644 src/embed-extractor/index.ts create mode 100644 src/embed-extractor/types.ts diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8eb53ea --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/fixtures/** linguist-generated diff --git a/src/handler/fixtures/kinokiste/https:dropload.iojvjwrkpijr0f.html b/fixtures/cachedFetchText/https:dropload.iojvjwrkpijr0f.html similarity index 76% rename from src/handler/fixtures/kinokiste/https:dropload.iojvjwrkpijr0f.html rename to fixtures/cachedFetchText/https:dropload.iojvjwrkpijr0f.html index e8adf0c..39e6671 100644 --- a/src/handler/fixtures/kinokiste/https:dropload.iojvjwrkpijr0f.html +++ b/fixtures/cachedFetchText/https:dropload.iojvjwrkpijr0f.html @@ -19,10 +19,10 @@ - - - - + + + + @@ -91,11 +91,11 @@
- + - - + + +
@@ -205,13 +205,13 @@ $.cookie('aff', '2', { expires: 10 });
-
- @@ -270,7 +270,7 @@ $.cookie('aff', '2', { expires: 10 });
- - - - + - - - + + @@ -495,7 +495,7 @@ $.cookie('aff', '2', { expires: 10 }); - + diff --git a/src/handler/fixtures/meinecloud/https:dropload.iolyo2h1snpe5c.html b/fixtures/cachedFetchText/https:dropload.iolyo2h1snpe5c.html similarity index 91% rename from src/handler/fixtures/meinecloud/https:dropload.iolyo2h1snpe5c.html rename to fixtures/cachedFetchText/https:dropload.iolyo2h1snpe5c.html index b890513..f4cf045 100644 --- a/src/handler/fixtures/meinecloud/https:dropload.iolyo2h1snpe5c.html +++ b/fixtures/cachedFetchText/https:dropload.iolyo2h1snpe5c.html @@ -19,10 +19,10 @@ - - - - + + + + @@ -91,11 +91,11 @@
- + - - + + +
@@ -205,13 +205,13 @@ $.cookie('aff', '4', { expires: 10 });
-
- @@ -270,7 +270,7 @@ $.cookie('aff', '4', { expires: 10 });
- - - - + - - - + + @@ -495,7 +495,7 @@ $.cookie('aff', '4', { expires: 10 }); - + diff --git a/src/handler/fixtures/kinokiste/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html b/fixtures/cachedFetchText/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html similarity index 98% rename from src/handler/fixtures/kinokiste/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html rename to fixtures/cachedFetchText/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html index cf8c0c0..7b1b174 100644 --- a/src/handler/fixtures/kinokiste/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html +++ b/fixtures/cachedFetchText/https:kinokiste.livedeutsch29992-black-mirror-anschauen.html @@ -20,14 +20,14 @@ - - - - - - - - + + + + + + + + - +