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

fix support for upload of google drive video #890

Merged
merged 1 commit into from
Sep 10, 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 backend/translation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TranslationAdmin(admin.ModelAdmin):
"id",
"status",
)
list_filter = ("task", "transcript", "target_language", "translation_type")
list_filter = ("task", "transcript", "target_language", "translation_type", "video")
search_fields = ("task", "transcript", "target_language", "translation_type")
ordering = ("-updated_at",)

Expand Down
12 changes: 6 additions & 6 deletions backend/video/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from googleapiclient.discovery import build
import re

ydl = YoutubeDL({"format": "best*[acodec!=none]"})
ydl = YoutubeDL({"format": "best"})

# Declare a global variable to save the object for Google Drive ID extraction
drive_info_extractor = get_info_extractor("GoogleDrive")()
Expand Down Expand Up @@ -526,11 +526,11 @@ def get_video_func(request):
status=status.HTTP_400_BAD_REQUEST,
)

if title[-4:] == ".mp4" and "youtube.com" not in normalized_url:
return Response(
{"message": "Invalid file type. Mp4 is not supported"},
status=status.HTTP_400_BAD_REQUEST,
)
# if title[-4:] == ".mp4" and "youtube.com" not in normalized_url:
# return Response(
# {"message": "Invalid file type. Mp4 is not supported"},
# status=status.HTTP_400_BAD_REQUEST,
# )
# Create a new DB entry if URL does not exist, else return the existing entry
if create:
video = Video.objects.create(
Expand Down
Loading