|
13 | 13 | from django.utils import timezone as django_timezone
|
14 | 14 | from .serializers import QuestionSerializer, QuizApiSerializer, QuizSerializer, MonsterHunterSerializer
|
15 | 15 | from .models import Subject, Quiz, Questions
|
16 |
| -import yt_dlp as youtube_dl |
| 16 | +# import yt_dlp as youtube_dl |
17 | 17 |
|
18 | 18 | User = get_user_model()
|
19 | 19 |
|
@@ -426,36 +426,36 @@ def load_questions_from_json_view(request):
|
426 | 426 | return HttpResponse("All Questions Added")
|
427 | 427 |
|
428 | 428 |
|
429 |
| -class GetZoloVideos(APIView): |
430 |
| - authentication_classes = [TokenAuthentication] |
| 429 | +# class GetZoloVideos(APIView): |
| 430 | +# authentication_classes = [TokenAuthentication] |
431 | 431 |
|
432 |
| - def get(self, request): |
433 |
| - # Retrieve ZoloVideos instance for the current user |
434 |
| - zolo_videos = ZoloVideos.objects.get(user=request.user) |
| 432 | +# def get(self, request): |
| 433 | +# # Retrieve ZoloVideos instance for the current user |
| 434 | +# zolo_videos = ZoloVideos.objects.get(user=request.user) |
435 | 435 |
|
436 |
| - # Get the unwatched video URLs based on the user's country |
437 |
| - unwatched_urls = zolo_videos.get_videos_by_country() |
| 436 | +# # Get the unwatched video URLs based on the user's country |
| 437 | +# unwatched_urls = zolo_videos.get_videos_by_country() |
438 | 438 |
|
439 |
| - # Get the streaming URL for each video URL |
440 |
| - stream_urls = [get_stream_url(url) for url in unwatched_urls] |
| 439 | +# # Get the streaming URL for each video URL |
| 440 | +# stream_urls = [get_stream_url(url) for url in unwatched_urls] |
441 | 441 |
|
442 |
| - # Return your response or render the template with the stream URLs |
443 |
| - return Response({"urls": stream_urls}, status=status.HTTP_200_OK) |
| 442 | +# # Return your response or render the template with the stream URLs |
| 443 | +# return Response({"urls": stream_urls}, status=status.HTTP_200_OK) |
444 | 444 |
|
445 | 445 |
|
446 |
| -def get_stream_url(video_url): |
447 |
| - # Create youtube_dl options dictionary |
448 |
| - ydl_opts = { |
449 |
| - 'format': 'best', |
450 |
| - 'quiet': True |
451 |
| - } |
| 446 | +# def get_stream_url(video_url): |
| 447 | +# # Create youtube_dl options dictionary |
| 448 | +# ydl_opts = { |
| 449 | +# 'format': 'best', |
| 450 | +# 'quiet': True |
| 451 | +# } |
452 | 452 |
|
453 |
| - # Create youtube_dl extractor |
454 |
| - with youtube_dl.YoutubeDL(ydl_opts) as ydl: |
455 |
| - info_dict = ydl.extract_info(video_url, download=False) |
456 |
| - stream_url = info_dict['url'] |
| 453 | +# # Create youtube_dl extractor |
| 454 | +# with youtube_dl.YoutubeDL(ydl_opts) as ydl: |
| 455 | +# info_dict = ydl.extract_info(video_url, download=False) |
| 456 | +# stream_url = info_dict['url'] |
457 | 457 |
|
458 |
| - return stream_url |
| 458 | +# return stream_url |
459 | 459 |
|
460 | 460 |
|
461 | 461 | class ZoloVideoApi(APIView):
|
|
0 commit comments