From 07bfbcd15b31bc9131ffc759e496118182307760 Mon Sep 17 00:00:00 2001 From: Twin Karmakharm Date: Wed, 26 Jun 2024 18:13:58 +0100 Subject: [PATCH 1/8] Comment out html tree map expansion --- .../AssistantScrapeResults/assistantUtils.jsx | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/assistantUtils.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/assistantUtils.jsx index ac656344a..deb09bfd5 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/assistantUtils.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/assistantUtils.jsx @@ -10,20 +10,20 @@ function treeMapToElementsRecursive( if ("span" in treeElem) { const span = treeElem.span; if (spanHighlightIndices === null) { - console.log("No span highlight: ", text.substring(span.start, span.end)); + // console.log("No span highlight: ", text.substring(span.start, span.end)); childElems.push(text.substring(span.start, span.end)); } else { - console.log("Span highlight: ", text.substring(span.start, span.end)); + // console.log("Span highlight: ", text.substring(span.start, span.end)); let currentIndex = span.start; for (let i = 0; i < spanHighlightIndices.length; i++) { const hSpan = spanHighlightIndices[i]; - console.log( - "Matching span", - span.start, - span.end, - hSpan.indices[0], - hSpan.indices[1], - ); + // console.log( + // "Matching span", + // span.start, + // span.end, + // hSpan.indices[0], + // hSpan.indices[1], + // ); const hSpanStart = hSpan.indices[0]; const hSpanEnd = hSpan.indices[1]; if ( @@ -31,13 +31,13 @@ function treeMapToElementsRecursive( (span.start <= hSpanEnd && hSpanEnd <= span.end) ) { //If there's an overlap - console.log( - "Found lapping span ", - span.start, - span.end, - hSpanStart, - hSpanEnd, - ); + // console.log( + // "Found lapping span ", + // span.start, + // span.end, + // hSpanStart, + // hSpanEnd, + // ); // If span doesn't start before the current index if (hSpanStart > currentIndex) { @@ -48,15 +48,15 @@ function treeMapToElementsRecursive( hSpanStart < span.start ? span.start : hSpanStart; const boundedEnd = hSpanEnd > span.end ? span.end : hSpanEnd; if (wrapFunc) { - console.log("Wrapping: ", text.substring(boundedStart, boundedEnd)); + // console.log("Wrapping: ", text.substring(boundedStart, boundedEnd)); childElems.push( wrapFunc(text.substring(boundedStart, boundedEnd), hSpan), ); } else { - console.log( - "Not wrapping: ", - text.substring(boundedStart, boundedEnd), - ); + // console.log( + // "Not wrapping: ", + // text.substring(boundedStart, boundedEnd), + // ); childElems.push(text.substring(boundedStart, boundedEnd)); } From b79075255a1dd2fd47d4f9f3f3184592fce8b913 Mon Sep 17 00:00:00 2001 From: Twin Karmakharm Date: Wed, 26 Jun 2024 18:15:42 +0100 Subject: [PATCH 2/8] Stop embedding tiktok video --- .../Assistant/AssistantScrapeResults/AssistantVideoResult.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx index 3fcfc9d44..dfbd63106 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx @@ -83,6 +83,9 @@ const AssistantVideoResult = () => { "embed/" + embedURL.slice(positionOne); break; + case KNOWN_LINKS.TIKTOK: + embedURL = null; + break; default: return embedURL; } From d1ea9283d8dee351d7b80b4fe170ab9f4eeba8e6 Mon Sep 17 00:00:00 2001 From: Twin Karmakharm Date: Wed, 26 Jun 2024 18:16:35 +0100 Subject: [PATCH 3/8] Remove video analysis, keyframe and video rights service for twitter/x --- .../NavItems/Assistant/AssistantRuleBook.jsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/NavItems/Assistant/AssistantRuleBook.jsx b/src/components/NavItems/Assistant/AssistantRuleBook.jsx index 10f6cf5dd..b87cbe60c 100644 --- a/src/components/NavItems/Assistant/AssistantRuleBook.jsx +++ b/src/components/NavItems/Assistant/AssistantRuleBook.jsx @@ -113,11 +113,7 @@ export const ASSISTANT_ACTIONS = [ { title: "navbar_analysis_video", icon: analysisIconOff, - linksAccepted: [ - KNOWN_LINKS.YOUTUBE, - KNOWN_LINKS.FACEBOOK, - KNOWN_LINKS.TWITTER, - ], + linksAccepted: [KNOWN_LINKS.YOUTUBE, KNOWN_LINKS.FACEBOOK], cTypes: [CONTENT_TYPE.VIDEO], exceptions: [], useInputUrl: true, @@ -142,7 +138,6 @@ export const ASSISTANT_ACTIONS = [ linksAccepted: [ KNOWN_LINKS.YOUTUBE, KNOWN_LINKS.FACEBOOK, - KNOWN_LINKS.TWITTER, KNOWN_LINKS.DAILYMOTION, KNOWN_LINKS.VIMEO, KNOWN_LINKS.YOUTUBE, @@ -196,11 +191,7 @@ export const ASSISTANT_ACTIONS = [ { title: "navbar_rights", icon: videoRightsIconOff, - linksAccepted: [ - KNOWN_LINKS.YOUTUBE, - KNOWN_LINKS.FACEBOOK, - KNOWN_LINKS.TWITTER, - ], + linksAccepted: [KNOWN_LINKS.YOUTUBE, KNOWN_LINKS.FACEBOOK], cTypes: [CONTENT_TYPE.VIDEO], exceptions: [], useInputUrl: true, From 71325c0d2d1b104c0d34a6b835328b118a413b6b Mon Sep 17 00:00:00 2001 From: Twin Karmakharm Date: Wed, 26 Jun 2024 18:49:42 +0100 Subject: [PATCH 4/8] Remove video rights service from facebook --- src/components/NavItems/Assistant/AssistantRuleBook.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NavItems/Assistant/AssistantRuleBook.jsx b/src/components/NavItems/Assistant/AssistantRuleBook.jsx index b87cbe60c..14fe05315 100644 --- a/src/components/NavItems/Assistant/AssistantRuleBook.jsx +++ b/src/components/NavItems/Assistant/AssistantRuleBook.jsx @@ -191,7 +191,7 @@ export const ASSISTANT_ACTIONS = [ { title: "navbar_rights", icon: videoRightsIconOff, - linksAccepted: [KNOWN_LINKS.YOUTUBE, KNOWN_LINKS.FACEBOOK], + linksAccepted: [KNOWN_LINKS.YOUTUBE], cTypes: [CONTENT_TYPE.VIDEO], exceptions: [], useInputUrl: true, From f92e32285f0f460b75687a1e6e2e414469a54d16 Mon Sep 17 00:00:00 2001 From: Twin Karmakharm Date: Thu, 27 Jun 2024 18:27:16 +0100 Subject: [PATCH 5/8] Disable instagram video services. Add service testing --- .../NavItems/Assistant/AssistantRuleBook.jsx | 1 - .../AssistantProcessUrlActions.jsx | 5 +++- .../AssistantVideoResult.jsx | 14 +++++++-- .../Shared/ImageGridList/ImageGridList.jsx | 2 ++ .../Shared/VideoGridList/VideoGridList.jsx | 1 + tests/e2e/assistant.spec.js | 29 +++++++++++++++++++ 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/components/NavItems/Assistant/AssistantRuleBook.jsx b/src/components/NavItems/Assistant/AssistantRuleBook.jsx index 14fe05315..0d4f09e2f 100644 --- a/src/components/NavItems/Assistant/AssistantRuleBook.jsx +++ b/src/components/NavItems/Assistant/AssistantRuleBook.jsx @@ -144,7 +144,6 @@ export const ASSISTANT_ACTIONS = [ KNOWN_LINKS.YOUTUBESHORTS, KNOWN_LINKS.LIVELEAK, KNOWN_LINKS.OWN, - KNOWN_LINKS.INSTAGRAM, ], cTypes: [CONTENT_TYPE.VIDEO], exceptions: [], diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantProcessUrlActions.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantProcessUrlActions.jsx index 2376f6942..194909596 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantProcessUrlActions.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantProcessUrlActions.jsx @@ -75,7 +75,10 @@ const AssistantProcessUrlActions = () => { - + {keyword(action.title)} diff --git a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx index dfbd63106..291346b90 100644 --- a/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx +++ b/src/components/NavItems/Assistant/AssistantScrapeResults/AssistantVideoResult.jsx @@ -51,6 +51,11 @@ const AssistantVideoResult = () => { let stringToMatch = ""; let positionOne = 0; + // Don't embed blob links, they are url for cached in-memory video + if (embedURL.startsWith("blob:")) { + return null; + } + switch (input_url_type) { case KNOWN_LINKS.YOUTUBE: if (!embedURL.includes("/embed/")) { @@ -98,7 +103,7 @@ const AssistantVideoResult = () => { return ( - + {useIframe() && preprocessLinkForEmbed(processUrl) && (