From 5b1556320de60b8c606c0e3de468116966e8ac9f Mon Sep 17 00:00:00 2001 From: Steve Yonkeu Date: Fri, 5 Jan 2024 14:13:31 +0000 Subject: [PATCH 1/2] refactor: changes from youtube to no-cookies --- .gitignore | 1 + zubhub_backend/Makefile | 2 +- zubhub_frontend/zubhub/src/components/input/inputScripts.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 73f4af548..a5b05fe08 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ pre-commit-venv +.idea/ \ No newline at end of file diff --git a/zubhub_backend/Makefile b/zubhub_backend/Makefile index e8e2ad446..49273425e 100644 --- a/zubhub_backend/Makefile +++ b/zubhub_backend/Makefile @@ -98,7 +98,7 @@ default-theme: docker-compose -f docker-compose.yml exec web bash -c "python zubhub/manage.py create_default_theme" .PHONY: default-theme -init: .env start migrate admin-user add-theme ## Initialize docker-compose containers +init: .env start migrate admin-user default-theme ## Initialize docker-compose containers .PHONY: init search-index: diff --git a/zubhub_frontend/zubhub/src/components/input/inputScripts.js b/zubhub_frontend/zubhub/src/components/input/inputScripts.js index 093d92db5..6600bfee4 100644 --- a/zubhub_frontend/zubhub/src/components/input/inputScripts.js +++ b/zubhub_frontend/zubhub/src/components/input/inputScripts.js @@ -4,7 +4,7 @@ export const refactorVideoUrl = url => { return url.replace('watch?v=', 'embed/'); } else { if (url.includes('youtu.be')) { - return 'https://www.youtube.com/embed/'.concat(url.split('/')[3]); + return 'https://www.youtube-nocookie.com/embed/'.concat(url.split('/')[3]); } if (url.includes('drive.google.com')) { if (url.includes('/view')) { From e2445e249c88d401857d7d7fac3441fb37661d72 Mon Sep 17 00:00:00 2001 From: Steve Yonkeu Date: Mon, 15 Jan 2024 07:33:41 +0000 Subject: [PATCH 2/2] feat: add no cookies to normal youtube --- .gitignore | 3 +-- zubhub_frontend/zubhub/src/components/input/inputScripts.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a5b05fe08..0ef0d53cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -pre-commit-venv -.idea/ \ No newline at end of file +pre-commit-venv \ No newline at end of file diff --git a/zubhub_frontend/zubhub/src/components/input/inputScripts.js b/zubhub_frontend/zubhub/src/components/input/inputScripts.js index 6600bfee4..d743cdc09 100644 --- a/zubhub_frontend/zubhub/src/components/input/inputScripts.js +++ b/zubhub_frontend/zubhub/src/components/input/inputScripts.js @@ -1,7 +1,8 @@ export const refactorVideoUrl = url => { if (url.includes('youtube.com')) { url = url.split('&')[0]; - return url.replace('watch?v=', 'embed/'); + url = url.replace('watch?v=', 'embed/'); + return url.replace('youtube.com', 'youtube-nocookie.com'); } else { if (url.includes('youtu.be')) { return 'https://www.youtube-nocookie.com/embed/'.concat(url.split('/')[3]);