From e41dc403794391f9c2dc028628deb347fa18b4a0 Mon Sep 17 00:00:00 2001 From: Steve Yonkeu Date: Mon, 5 Feb 2024 01:56:53 +0000 Subject: [PATCH] refactor: changes from youtube to no-cookies (#1080) * refactor: changes from youtube to no-cookies * feat: add no cookies to normal youtube --- .gitignore | 2 +- zubhub_backend/Makefile | 2 +- zubhub_frontend/zubhub/src/components/input/inputScripts.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 73f4af548..0ef0d53cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -pre-commit-venv +pre-commit-venv \ 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..d743cdc09 100644 --- a/zubhub_frontend/zubhub/src/components/input/inputScripts.js +++ b/zubhub_frontend/zubhub/src/components/input/inputScripts.js @@ -1,10 +1,11 @@ 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.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')) {