@@ -72,7 +72,7 @@ func TestRewriteYoutubeVideoLink(t *testing.T) {
7272 controlEntry := & model.Entry {
7373 URL : "https://www.youtube.com/watch?v=1234" ,
7474 Title : `A title` ,
75- Content : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/1234" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video Description` ,
75+ Content : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/1234" allowfullscreen></iframe><br>Video Description` ,
7676 }
7777 testEntry := & model.Entry {
7878 URL : "https://www.youtube.com/watch?v=1234" ,
@@ -92,7 +92,7 @@ func TestRewriteYoutubeShortLink(t *testing.T) {
9292 controlEntry := & model.Entry {
9393 URL : "https://www.youtube.com/shorts/1LUWKWZkPjo" ,
9494 Title : `A title` ,
95- Content : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/1LUWKWZkPjo" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video Description` ,
95+ Content : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/1LUWKWZkPjo" allowfullscreen></iframe><br>Video Description` ,
9696 }
9797 testEntry := & model.Entry {
9898 URL : "https://www.youtube.com/shorts/1LUWKWZkPjo" ,
@@ -140,7 +140,7 @@ func TestRewriteYoutubeLinkAndCustomEmbedURL(t *testing.T) {
140140 controlEntry := & model.Entry {
141141 URL : "https://www.youtube.com/watch?v=1234" ,
142142 Title : `A title` ,
143- Content : `<iframe width="650" height="350" frameborder="0" src="https://invidious.custom/embed/1234" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video Description` ,
143+ Content : `<iframe width="650" height="350" frameborder="0" src="https://invidious.custom/embed/1234" allowfullscreen></iframe><br>Video Description` ,
144144 }
145145 testEntry := & model.Entry {
146146 URL : "https://www.youtube.com/watch?v=1234" ,
@@ -159,7 +159,7 @@ func TestRewriteYoutubeVideoLinkUsingInvidious(t *testing.T) {
159159 controlEntry := & model.Entry {
160160 URL : "https://www.youtube.com/watch?v=1234" ,
161161 Title : `A title` ,
162- Content : `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/1234" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video Description` ,
162+ Content : `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/1234" allowfullscreen></iframe><br>Video Description` ,
163163 }
164164 testEntry := & model.Entry {
165165 URL : "https://www.youtube.com/watch?v=1234" ,
@@ -179,7 +179,7 @@ func TestRewriteYoutubeShortLinkUsingInvidious(t *testing.T) {
179179 controlEntry := & model.Entry {
180180 URL : "https://www.youtube.com/shorts/1LUWKWZkPjo" ,
181181 Title : `A title` ,
182- Content : `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/1LUWKWZkPjo" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video Description` ,
182+ Content : `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/1LUWKWZkPjo" allowfullscreen></iframe><br>Video Description` ,
183183 }
184184 testEntry := & model.Entry {
185185 URL : "https://www.youtube.com/shorts/1LUWKWZkPjo" ,
@@ -199,16 +199,16 @@ func TestAddYoutubeVideoFromId(t *testing.T) {
199199
200200 scenarios := map [string ]string {
201201 // Test with single YouTube ID
202- `Some content with youtube ID <script type="text/javascript" data-reactid="6">window.__APOLLO_STATE__ = {youtube_id: "9uASADiYe_8"}</script>` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/9uASADiYe_8" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Some content with youtube ID <script type="text/javascript" data-reactid="6">window.__APOLLO_STATE__ = {youtube_id: "9uASADiYe_8"}</script>` ,
202+ `Some content with youtube ID <script type="text/javascript" data-reactid="6">window.__APOLLO_STATE__ = {youtube_id: "9uASADiYe_8"}</script>` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/9uASADiYe_8" allowfullscreen></iframe><br>Some content with youtube ID <script type="text/javascript" data-reactid="6">window.__APOLLO_STATE__ = {youtube_id: "9uASADiYe_8"}</script>` ,
203203
204204 // Test with multiple YouTube IDs
205- `Content with youtube_id: "dQw4w9WgXcQ" and youtube_id: "jNQXAC9IVRw"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br><iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/jNQXAC9IVRw" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Content with youtube_id: "dQw4w9WgXcQ" and youtube_id: "jNQXAC9IVRw"` ,
205+ `Content with youtube_id: "dQw4w9WgXcQ" and youtube_id: "jNQXAC9IVRw"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br><iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/jNQXAC9IVRw" allowfullscreen></iframe><br>Content with youtube_id: "dQw4w9WgXcQ" and youtube_id: "jNQXAC9IVRw"` ,
206206
207207 // Test with YouTube ID using equals sign
208- `Some content with youtube_id = "dQw4w9WgXcQ"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Some content with youtube_id = "dQw4w9WgXcQ"` ,
208+ `Some content with youtube_id = "dQw4w9WgXcQ"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>Some content with youtube_id = "dQw4w9WgXcQ"` ,
209209
210210 // Test with spaces around delimiters
211- `Some content with youtube_id : "dQw4w9WgXcQ"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Some content with youtube_id : "dQw4w9WgXcQ"` ,
211+ `Some content with youtube_id : "dQw4w9WgXcQ"` : `<iframe width="650" height="350" frameborder="0" src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>Some content with youtube_id : "dQw4w9WgXcQ"` ,
212212
213213 // Test with YouTube ID without quotes (regex requires quotes)
214214 `Some content with youtube_id: dQw4w9WgXcQ and more` : `Some content with youtube_id: dQw4w9WgXcQ and more` ,
@@ -245,7 +245,7 @@ func TestAddYoutubeVideoFromIdWithCustomEmbedURL(t *testing.T) {
245245 }
246246
247247 input := `Some content with youtube_id: "dQw4w9WgXcQ"`
248- expected := `<iframe width="650" height="350" frameborder="0" src="https://invidious.custom/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Some content with youtube_id: "dQw4w9WgXcQ"`
248+ expected := `<iframe width="650" height="350" frameborder="0" src="https://invidious.custom/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>Some content with youtube_id: "dQw4w9WgXcQ"`
249249
250250 actual := addYoutubeVideoFromId (input )
251251 if actual != expected {
@@ -260,35 +260,35 @@ func TestAddInvidiousVideo(t *testing.T) {
260260 // Test with various Invidious instances
261261 "https://invidious.io/watch?v=dQw4w9WgXcQ" : {
262262 "Some video content" ,
263- `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Some video content` ,
263+ `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>Some video content` ,
264264 },
265265 "https://yewtu.be/watch?v=jNQXAC9IVRw" : {
266266 "Another video description" ,
267- `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/jNQXAC9IVRw" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Another video description` ,
267+ `<iframe width="650" height="350" frameborder="0" src="https://yewtu.be/embed/jNQXAC9IVRw" allowfullscreen></iframe><br>Another video description` ,
268268 },
269269 "http://invidious.snopyta.org/watch?v=dQw4w9WgXcQ" : {
270270 "HTTP instance test" ,
271- `<iframe width="650" height="350" frameborder="0" src="https://invidious.snopyta.org/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>HTTP instance test` ,
271+ `<iframe width="650" height="350" frameborder="0" src="https://invidious.snopyta.org/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>HTTP instance test` ,
272272 },
273273 "https://youtube.com/watch?v=dQw4w9WgXcQ" : {
274274 "YouTube URL (also matches regex)" ,
275- `<iframe width="650" height="350" frameborder="0" src="https://youtube.com/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>YouTube URL (also matches regex)` ,
275+ `<iframe width="650" height="350" frameborder="0" src="https://youtube.com/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>YouTube URL (also matches regex)` ,
276276 },
277277 "https://example.org/watch?v=dQw4w9WgXcQ" : {
278278 "Any domain with watch pattern" ,
279- `<iframe width="650" height="350" frameborder="0" src="https://example.org/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Any domain with watch pattern` ,
279+ `<iframe width="650" height="350" frameborder="0" src="https://example.org/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>Any domain with watch pattern` ,
280280 },
281281
282282 // Test with query parameters
283283 "https://invidious.io/watch?v=dQw4w9WgXcQ&t=30s" : {
284284 "Video with timestamp" ,
285- `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ?t=30s" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video with timestamp` ,
285+ `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ?t=30s" allowfullscreen></iframe><br>Video with timestamp` ,
286286 },
287287
288288 // Test with more complex query parameters
289289 "https://invidious.io/watch?v=dQw4w9WgXcQ&t=30s&autoplay=1" : {
290290 "Video with multiple parameters" ,
291- `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ?autoplay=1&t=30s" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>Video with multiple parameters` ,
291+ `<iframe width="650" height="350" frameborder="0" src="https://invidious.io/embed/dQw4w9WgXcQ?autoplay=1&t=30s" allowfullscreen></iframe><br>Video with multiple parameters` ,
292292 },
293293
294294 // Test with non-matching URLs (should return content unchanged)
@@ -308,7 +308,7 @@ func TestAddInvidiousVideo(t *testing.T) {
308308 // Test with empty content
309309 "https://empty.invidious.io/watch?v=dQw4w9WgXcQ" : {
310310 "" ,
311- `<iframe width="650" height="350" frameborder="0" src="https://empty.invidious.io/embed/dQw4w9WgXcQ" allowfullscreen referrerpolicy="strict-origin-when-cross-origin" ></iframe><br>` ,
311+ `<iframe width="650" height="350" frameborder="0" src="https://empty.invidious.io/embed/dQw4w9WgXcQ" allowfullscreen></iframe><br>` ,
312312 },
313313 }
314314
0 commit comments