Spaces:
Runtime error
Runtime error
thejagstudio
commited on
Commit
•
bc76f09
1
Parent(s):
cceef76
Update home/views.py
Browse files- home/views.py +11 -5
home/views.py
CHANGED
@@ -64,17 +64,23 @@ def movieDetail(request, id):
|
|
64 |
response = requests.request("GET", url, headers=headers)
|
65 |
data = response.json()
|
66 |
try:
|
67 |
-
movie = movies.objects.
|
68 |
-
data["driveLink"] = movie
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
context = {
|
73 |
'data': data
|
74 |
}
|
75 |
return render(request, 'movieDetail.html', context=context)
|
76 |
|
77 |
-
|
78 |
@csrf_exempt
|
79 |
def user_login(request):
|
80 |
if request.method == 'POST':
|
|
|
64 |
response = requests.request("GET", url, headers=headers)
|
65 |
data = response.json()
|
66 |
try:
|
67 |
+
movie = movies.objects.filter(tmdbId=id).first()
|
68 |
+
data["driveLink"] = movie.driveLink
|
69 |
+
url = "https://drive.google.com/get_video_info?docid="+movie.driveLink + "&drive_originator_app=303"
|
70 |
+
|
71 |
+
response = requests.request("GET", url, headers=headers)
|
72 |
+
urlData = response.text
|
73 |
+
parsed_url = urlparse("https://drive.google.com/?"+urlData)
|
74 |
+
urlData = json.loads(parse_qs(parsed_url.query)["player_response"][0])
|
75 |
+
data["watchLink"] = urlData
|
76 |
+
except Exception as e:
|
77 |
+
print(e)
|
78 |
|
79 |
context = {
|
80 |
'data': data
|
81 |
}
|
82 |
return render(request, 'movieDetail.html', context=context)
|
83 |
|
|
|
84 |
@csrf_exempt
|
85 |
def user_login(request):
|
86 |
if request.method == 'POST':
|