Skip to content

Commit

Permalink
refactor: changes from youtube to no-cookies (#1080)
Browse files Browse the repository at this point in the history
* refactor: changes from youtube to no-cookies

* feat: add no cookies to normal youtube
  • Loading branch information
yokwejuste authored Feb 5, 2024
1 parent 684dbf7 commit e41dc40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pre-commit-venv
pre-commit-venv
2 changes: 1 addition & 1 deletion zubhub_backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions zubhub_frontend/zubhub/src/components/input/inputScripts.js
Original file line number Diff line number Diff line change
@@ -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')) {
Expand Down

0 comments on commit e41dc40

Please sign in to comment.