Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit d91e7b8

Browse files
Update views.py
1 parent 6444e6d commit d91e7b8

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

rewards/views.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from django.utils import timezone as django_timezone
1414
from .serializers import QuestionSerializer, QuizApiSerializer, QuizSerializer, MonsterHunterSerializer
1515
from .models import Subject, Quiz, Questions
16-
import yt_dlp as youtube_dl
16+
# import yt_dlp as youtube_dl
1717

1818
User = get_user_model()
1919

@@ -426,36 +426,36 @@ def load_questions_from_json_view(request):
426426
return HttpResponse("All Questions Added")
427427

428428

429-
class GetZoloVideos(APIView):
430-
authentication_classes = [TokenAuthentication]
429+
# class GetZoloVideos(APIView):
430+
# authentication_classes = [TokenAuthentication]
431431

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)
435435

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()
438438

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]
441441

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)
444444

445445

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+
# }
452452

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']
457457

458-
return stream_url
458+
# return stream_url
459459

460460

461461
class ZoloVideoApi(APIView):

0 commit comments

Comments
 (0)