Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: changes from youtube to no-cookies #1080

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]);
yokwejuste marked this conversation as resolved.
Show resolved Hide resolved
}
if (url.includes('drive.google.com')) {
if (url.includes('/view')) {
Expand Down