Skip to content

Commit

Permalink
Fix dumb mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
younesaassila committed Dec 22, 2023
1 parent 7c9ed15 commit d87d42c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/page/getFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export function getFetch(options: FetchOptions): typeof fetch {

// Video Weaver requests.
if (host != null && videoWeaverHostRegex.test(host)) {
console.debug(`[TTV LOL PRO] 🥅 Caught Video Weaver request '${url}'.`);
// TODO: Implement replacement limit if the ad is a preroll to avoid infinite loops.
let videoWeaverUrl = url;
if (replacementVideoWeaverUrls != null) {
Expand Down Expand Up @@ -278,6 +279,10 @@ export function getFetch(options: FetchOptions): typeof fetch {
// Usher responses.
if (host != null && usherHostRegex.test(host)) {
responseBody = await readResponseBody();
currentVideoWeaverUrls = responseBody
.split("\n")
.filter(line => videoWeaverUrlRegex.test(line));
replacementVideoWeaverUrls = null;
console.debug("[TTV LOL PRO] 🥅 Caught Usher response.");
const videoWeaverUrls = responseBody
.split("\n")
Expand All @@ -297,10 +302,7 @@ export function getFetch(options: FetchOptions): typeof fetch {
// Video Weaver responses.
if (host != null && videoWeaverHostRegex.test(host)) {
responseBody = await readResponseBody();
currentVideoWeaverUrls = responseBody
.split("\n")
.filter(line => videoWeaverUrlRegex.test(line));
replacementVideoWeaverUrls = null;

// Check if response contains ad.
if (responseBody.includes("stitched-ad")) {
console.log(
Expand Down

0 comments on commit d87d42c

Please sign in to comment.