Spaces:
Runtime error
Runtime error
thejagstudio
commited on
Commit
•
b7dc0a0
1
Parent(s):
fa839da
Upload 70 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- cloudStorage/__pycache__/__init__.cpython-311.pyc +0 -0
- cloudStorage/__pycache__/__init__.cpython-39.pyc +0 -0
- cloudStorage/__pycache__/settings.cpython-311.pyc +0 -0
- cloudStorage/__pycache__/settings.cpython-39.pyc +0 -0
- cloudStorage/__pycache__/urls.cpython-311.pyc +0 -0
- cloudStorage/__pycache__/urls.cpython-39.pyc +0 -0
- cloudStorage/__pycache__/wsgi.cpython-311.pyc +0 -0
- cloudStorage/__pycache__/wsgi.cpython-39.pyc +0 -0
- cloudStorage/settings.py +145 -142
- cloudStorage/urls.py +2 -2
- home/__pycache__/__init__.cpython-311.pyc +0 -0
- home/__pycache__/__init__.cpython-39.pyc +0 -0
- home/__pycache__/admin.cpython-311.pyc +0 -0
- home/__pycache__/admin.cpython-39.pyc +0 -0
- home/__pycache__/apps.cpython-311.pyc +0 -0
- home/__pycache__/apps.cpython-39.pyc +0 -0
- home/__pycache__/models.cpython-311.pyc +0 -0
- home/__pycache__/models.cpython-39.pyc +0 -0
- home/__pycache__/urls.cpython-311.pyc +0 -0
- home/__pycache__/urls.cpython-39.pyc +0 -0
- home/__pycache__/views.cpython-311.pyc +0 -0
- home/__pycache__/views.cpython-39.pyc +0 -0
- home/migrations/0006_movies.py +30 -0
- home/migrations/0007_movies_uploaded.py +17 -0
- home/migrations/0008_movies_casts_movies_country_movies_duration_and_more.py +57 -0
- home/migrations/0009_movies_imdbid.py +17 -0
- home/migrations/0010_alter_movies_casts_alter_movies_country_and_more.py +87 -0
- home/migrations/__pycache__/0001_initial.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0001_initial.cpython-39.pyc +0 -0
- home/migrations/__pycache__/0002_rename_data_userdata.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0002_rename_data_userdata.cpython-39.pyc +0 -0
- home/migrations/__pycache__/0003_userdata_ip.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0003_userdata_ip.cpython-39.pyc +0 -0
- home/migrations/__pycache__/0004_ip_address_remove_userdata_ip.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0004_ip_address_remove_userdata_ip.cpython-39.pyc +0 -0
- home/migrations/__pycache__/0005_remove_userdata_files.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0006_movies.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0007_movies_uploaded.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0008_movies_casts_movies_country_movies_duration_and_more.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0009_movies_imdbid.cpython-311.pyc +0 -0
- home/migrations/__pycache__/0010_alter_movies_casts_alter_movies_country_and_more.cpython-311.pyc +0 -0
- home/migrations/__pycache__/__init__.cpython-311.pyc +0 -0
- home/migrations/__pycache__/__init__.cpython-39.pyc +0 -0
- home/models.py +18 -0
- home/urls.py +19 -18
- home/views.py +302 -302
- static/demo.js +0 -0
- static/tippy.css +88 -0
- templates/godMode.html +32 -23
- templates/movie.html +167 -0
cloudStorage/__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (177 Bytes). View file
|
|
cloudStorage/__pycache__/__init__.cpython-39.pyc
ADDED
Binary file (156 Bytes). View file
|
|
cloudStorage/__pycache__/settings.cpython-311.pyc
ADDED
Binary file (3.1 kB). View file
|
|
cloudStorage/__pycache__/settings.cpython-39.pyc
ADDED
Binary file (2.88 kB). View file
|
|
cloudStorage/__pycache__/urls.cpython-311.pyc
ADDED
Binary file (1.41 kB). View file
|
|
cloudStorage/__pycache__/urls.cpython-39.pyc
ADDED
Binary file (1.08 kB). View file
|
|
cloudStorage/__pycache__/wsgi.cpython-311.pyc
ADDED
Binary file (709 Bytes). View file
|
|
cloudStorage/__pycache__/wsgi.cpython-39.pyc
ADDED
Binary file (569 Bytes). View file
|
|
cloudStorage/settings.py
CHANGED
@@ -1,142 +1,145 @@
|
|
1 |
-
"""
|
2 |
-
Django settings for cloudStorage project.
|
3 |
-
|
4 |
-
Generated by 'django-admin startproject' using Django 4.0.4.
|
5 |
-
|
6 |
-
For more information on this file, see
|
7 |
-
https://docs.djangoproject.com/en/4.0/topics/settings/
|
8 |
-
|
9 |
-
For the full list of settings and their values, see
|
10 |
-
https://docs.djangoproject.com/en/4.0/ref/settings/
|
11 |
-
"""
|
12 |
-
|
13 |
-
from pathlib import Path
|
14 |
-
import os
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
#
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
'https://
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
# Application definition
|
39 |
-
|
40 |
-
INSTALLED_APPS = [
|
41 |
-
'django.contrib.admin',
|
42 |
-
'django.contrib.auth',
|
43 |
-
'django.contrib.contenttypes',
|
44 |
-
'django.contrib.sessions',
|
45 |
-
'django.contrib.messages',
|
46 |
-
'django.contrib.staticfiles',
|
47 |
-
'home',
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
'django.
|
53 |
-
'django.middleware.
|
54 |
-
'django.middleware.
|
55 |
-
'django.
|
56 |
-
'django.contrib.
|
57 |
-
'django.middleware.
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
'
|
66 |
-
'
|
67 |
-
'
|
68 |
-
|
69 |
-
|
70 |
-
'django.template.context_processors.
|
71 |
-
'django.
|
72 |
-
'django.contrib.
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
#
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
'
|
88 |
-
'
|
89 |
-
'
|
90 |
-
'
|
91 |
-
'
|
92 |
-
|
93 |
-
}
|
94 |
-
|
95 |
-
#
|
96 |
-
#
|
97 |
-
# '
|
98 |
-
#
|
99 |
-
#
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
#
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
#
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
#
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
Django settings for cloudStorage project.
|
3 |
+
|
4 |
+
Generated by 'django-admin startproject' using Django 4.0.4.
|
5 |
+
|
6 |
+
For more information on this file, see
|
7 |
+
https://docs.djangoproject.com/en/4.0/topics/settings/
|
8 |
+
|
9 |
+
For the full list of settings and their values, see
|
10 |
+
https://docs.djangoproject.com/en/4.0/ref/settings/
|
11 |
+
"""
|
12 |
+
|
13 |
+
from pathlib import Path
|
14 |
+
import os
|
15 |
+
|
16 |
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
17 |
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
18 |
+
|
19 |
+
|
20 |
+
# Quick-start development settings - unsuitable for production
|
21 |
+
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
|
22 |
+
|
23 |
+
# SECURITY WARNING: keep the secret key used in production secret!
|
24 |
+
SECRET_KEY = 'django-insecure-f221fh+#lk4ul5x@gk7bm2x5f&+u3uhu+t-(bri%t(uh!z6gf#'
|
25 |
+
|
26 |
+
# SECURITY WARNING: don't run with debug turned on in production!
|
27 |
+
DEBUG = True
|
28 |
+
X_FRAME_OPTIONS = 'ALLOWALL'
|
29 |
+
|
30 |
+
ALLOWED_HOSTS = ['127.0.0.1', 'thejagstudio-cloudstorage.hf.space']
|
31 |
+
CORS_ALLOWED_ORIGINS = [
|
32 |
+
'https://thejagstudio-cloudstorage.hf.space',
|
33 |
+
'https://huggingface.co'
|
34 |
+
]
|
35 |
+
CORS_ALLOW_ALL_ORIGINS = True
|
36 |
+
|
37 |
+
|
38 |
+
# Application definition
|
39 |
+
|
40 |
+
INSTALLED_APPS = [
|
41 |
+
'django.contrib.admin',
|
42 |
+
'django.contrib.auth',
|
43 |
+
'django.contrib.contenttypes',
|
44 |
+
'django.contrib.sessions',
|
45 |
+
'django.contrib.messages',
|
46 |
+
'django.contrib.staticfiles',
|
47 |
+
'home',
|
48 |
+
'corsheaders'
|
49 |
+
]
|
50 |
+
|
51 |
+
MIDDLEWARE = [
|
52 |
+
'django.middleware.security.SecurityMiddleware',
|
53 |
+
'django.contrib.sessions.middleware.SessionMiddleware',
|
54 |
+
'django.middleware.common.CommonMiddleware',
|
55 |
+
'django.middleware.csrf.CsrfViewMiddleware',
|
56 |
+
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
57 |
+
'django.contrib.messages.middleware.MessageMiddleware',
|
58 |
+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
59 |
+
]
|
60 |
+
|
61 |
+
ROOT_URLCONF = 'cloudStorage.urls'
|
62 |
+
|
63 |
+
TEMPLATES = [
|
64 |
+
{
|
65 |
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
66 |
+
'DIRS': ['templates'],
|
67 |
+
'APP_DIRS': True,
|
68 |
+
'OPTIONS': {
|
69 |
+
'context_processors': [
|
70 |
+
'django.template.context_processors.debug',
|
71 |
+
'django.template.context_processors.request',
|
72 |
+
'django.contrib.auth.context_processors.auth',
|
73 |
+
'django.contrib.messages.context_processors.messages',
|
74 |
+
],
|
75 |
+
},
|
76 |
+
},
|
77 |
+
]
|
78 |
+
|
79 |
+
WSGI_APPLICATION = 'cloudStorage.wsgi.application'
|
80 |
+
|
81 |
+
|
82 |
+
# Database
|
83 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
|
84 |
+
|
85 |
+
DATABASES = {
|
86 |
+
'default': {
|
87 |
+
'ENGINE': 'django.db.backends.postgresql',
|
88 |
+
'NAME': 'postgres',
|
89 |
+
'USER': 'postgres.dfnawdyzwhxsjsyvlgbi',
|
90 |
+
'PORT': 5432,
|
91 |
+
'PASSWORD': 'luwNgwCcDNLbZ5qt',
|
92 |
+
'HOST': 'aws-0-ap-south-1.pooler.supabase.com',
|
93 |
+
}
|
94 |
+
}
|
95 |
+
# DATABASES = {
|
96 |
+
# 'default': {
|
97 |
+
# 'ENGINE': 'django.db.backends.sqlite3',
|
98 |
+
# 'NAME': BASE_DIR / 'db.sqlite3',
|
99 |
+
# }
|
100 |
+
# }
|
101 |
+
|
102 |
+
|
103 |
+
# Password validation
|
104 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
|
105 |
+
|
106 |
+
AUTH_PASSWORD_VALIDATORS = [
|
107 |
+
{
|
108 |
+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
109 |
+
},
|
110 |
+
{
|
111 |
+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
112 |
+
},
|
113 |
+
{
|
114 |
+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
115 |
+
},
|
116 |
+
{
|
117 |
+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
118 |
+
},
|
119 |
+
]
|
120 |
+
|
121 |
+
|
122 |
+
# Internationalization
|
123 |
+
# https://docs.djangoproject.com/en/4.0/topics/i18n/
|
124 |
+
|
125 |
+
LANGUAGE_CODE = 'en-us'
|
126 |
+
|
127 |
+
TIME_ZONE = 'UTC'
|
128 |
+
|
129 |
+
USE_I18N = True
|
130 |
+
|
131 |
+
USE_TZ = True
|
132 |
+
|
133 |
+
|
134 |
+
# Static files (CSS, JavaScript, Images)
|
135 |
+
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
136 |
+
|
137 |
+
STATIC_URL = '/static/'
|
138 |
+
STATICFILES_DIRS = [
|
139 |
+
BASE_DIR / "static",
|
140 |
+
]
|
141 |
+
|
142 |
+
# Default primary key field type
|
143 |
+
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
|
144 |
+
|
145 |
+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
cloudStorage/urls.py
CHANGED
@@ -14,11 +14,11 @@ Including another URLconf
|
|
14 |
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
15 |
"""
|
16 |
from django.contrib import admin
|
17 |
-
from django.urls import path,include
|
18 |
from django.conf import settings
|
19 |
from django.conf.urls.static import static
|
20 |
|
21 |
urlpatterns = [
|
22 |
path('admin/', admin.site.urls),
|
23 |
path('', include('home.urls')),
|
24 |
-
]
|
|
|
14 |
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
15 |
"""
|
16 |
from django.contrib import admin
|
17 |
+
from django.urls import path, include
|
18 |
from django.conf import settings
|
19 |
from django.conf.urls.static import static
|
20 |
|
21 |
urlpatterns = [
|
22 |
path('admin/', admin.site.urls),
|
23 |
path('', include('home.urls')),
|
24 |
+
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
home/__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (169 Bytes). View file
|
|
home/__pycache__/__init__.cpython-39.pyc
ADDED
Binary file (148 Bytes). View file
|
|
home/__pycache__/admin.cpython-311.pyc
ADDED
Binary file (707 Bytes). View file
|
|
home/__pycache__/admin.cpython-39.pyc
ADDED
Binary file (499 Bytes). View file
|
|
home/__pycache__/apps.cpython-311.pyc
ADDED
Binary file (536 Bytes). View file
|
|
home/__pycache__/apps.cpython-39.pyc
ADDED
Binary file (421 Bytes). View file
|
|
home/__pycache__/models.cpython-311.pyc
ADDED
Binary file (2.43 kB). View file
|
|
home/__pycache__/models.cpython-39.pyc
ADDED
Binary file (747 Bytes). View file
|
|
home/__pycache__/urls.cpython-311.pyc
ADDED
Binary file (1.5 kB). View file
|
|
home/__pycache__/urls.cpython-39.pyc
ADDED
Binary file (754 Bytes). View file
|
|
home/__pycache__/views.cpython-311.pyc
ADDED
Binary file (19 kB). View file
|
|
home/__pycache__/views.cpython-39.pyc
ADDED
Binary file (6.57 kB). View file
|
|
home/migrations/0006_movies.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-26 05:06
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0005_remove_userdata_files"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.CreateModel(
|
13 |
+
name="movies",
|
14 |
+
fields=[
|
15 |
+
(
|
16 |
+
"id",
|
17 |
+
models.BigAutoField(
|
18 |
+
auto_created=True,
|
19 |
+
primary_key=True,
|
20 |
+
serialize=False,
|
21 |
+
verbose_name="ID",
|
22 |
+
),
|
23 |
+
),
|
24 |
+
("movie", models.CharField(max_length=1000)),
|
25 |
+
("tmdbId", models.CharField(max_length=1000)),
|
26 |
+
("torrentLink", models.CharField(max_length=1000)),
|
27 |
+
("driveLink", models.CharField(max_length=1000)),
|
28 |
+
],
|
29 |
+
),
|
30 |
+
]
|
home/migrations/0007_movies_uploaded.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-26 05:07
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0006_movies"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.AddField(
|
13 |
+
model_name="movies",
|
14 |
+
name="uploaded",
|
15 |
+
field=models.BooleanField(default=False),
|
16 |
+
),
|
17 |
+
]
|
home/migrations/0008_movies_casts_movies_country_movies_duration_and_more.py
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-27 08:07
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0007_movies_uploaded"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.AddField(
|
13 |
+
model_name="movies",
|
14 |
+
name="Casts",
|
15 |
+
field=models.CharField(default="", max_length=1000),
|
16 |
+
),
|
17 |
+
migrations.AddField(
|
18 |
+
model_name="movies",
|
19 |
+
name="Country",
|
20 |
+
field=models.CharField(default="", max_length=1000),
|
21 |
+
),
|
22 |
+
migrations.AddField(
|
23 |
+
model_name="movies",
|
24 |
+
name="Duration",
|
25 |
+
field=models.CharField(default="", max_length=1000),
|
26 |
+
),
|
27 |
+
migrations.AddField(
|
28 |
+
model_name="movies",
|
29 |
+
name="Genre",
|
30 |
+
field=models.CharField(default="", max_length=1000),
|
31 |
+
),
|
32 |
+
migrations.AddField(
|
33 |
+
model_name="movies",
|
34 |
+
name="Production",
|
35 |
+
field=models.CharField(default="", max_length=1000),
|
36 |
+
),
|
37 |
+
migrations.AddField(
|
38 |
+
model_name="movies",
|
39 |
+
name="Released",
|
40 |
+
field=models.CharField(default="", max_length=1000),
|
41 |
+
),
|
42 |
+
migrations.AddField(
|
43 |
+
model_name="movies",
|
44 |
+
name="description",
|
45 |
+
field=models.CharField(default="", max_length=1000),
|
46 |
+
),
|
47 |
+
migrations.AddField(
|
48 |
+
model_name="movies",
|
49 |
+
name="poster",
|
50 |
+
field=models.CharField(default="", max_length=1000),
|
51 |
+
),
|
52 |
+
migrations.AddField(
|
53 |
+
model_name="movies",
|
54 |
+
name="trailer",
|
55 |
+
field=models.CharField(default="", max_length=1000),
|
56 |
+
),
|
57 |
+
]
|
home/migrations/0009_movies_imdbid.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-27 08:10
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0008_movies_casts_movies_country_movies_duration_and_more"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.AddField(
|
13 |
+
model_name="movies",
|
14 |
+
name="imdbId",
|
15 |
+
field=models.CharField(default="", max_length=1000),
|
16 |
+
),
|
17 |
+
]
|
home/migrations/0010_alter_movies_casts_alter_movies_country_and_more.py
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Generated by Django 4.1.4 on 2024-05-27 14:59
|
2 |
+
|
3 |
+
from django.db import migrations, models
|
4 |
+
|
5 |
+
|
6 |
+
class Migration(migrations.Migration):
|
7 |
+
dependencies = [
|
8 |
+
("home", "0009_movies_imdbid"),
|
9 |
+
]
|
10 |
+
|
11 |
+
operations = [
|
12 |
+
migrations.AlterField(
|
13 |
+
model_name="movies",
|
14 |
+
name="Casts",
|
15 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
16 |
+
),
|
17 |
+
migrations.AlterField(
|
18 |
+
model_name="movies",
|
19 |
+
name="Country",
|
20 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
21 |
+
),
|
22 |
+
migrations.AlterField(
|
23 |
+
model_name="movies",
|
24 |
+
name="Duration",
|
25 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
26 |
+
),
|
27 |
+
migrations.AlterField(
|
28 |
+
model_name="movies",
|
29 |
+
name="Genre",
|
30 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
31 |
+
),
|
32 |
+
migrations.AlterField(
|
33 |
+
model_name="movies",
|
34 |
+
name="Production",
|
35 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
36 |
+
),
|
37 |
+
migrations.AlterField(
|
38 |
+
model_name="movies",
|
39 |
+
name="Released",
|
40 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
41 |
+
),
|
42 |
+
migrations.AlterField(
|
43 |
+
model_name="movies",
|
44 |
+
name="description",
|
45 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
46 |
+
),
|
47 |
+
migrations.AlterField(
|
48 |
+
model_name="movies",
|
49 |
+
name="driveLink",
|
50 |
+
field=models.CharField(max_length=1000, null=True),
|
51 |
+
),
|
52 |
+
migrations.AlterField(
|
53 |
+
model_name="movies",
|
54 |
+
name="imdbId",
|
55 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
56 |
+
),
|
57 |
+
migrations.AlterField(
|
58 |
+
model_name="movies",
|
59 |
+
name="movie",
|
60 |
+
field=models.CharField(max_length=1000, null=True),
|
61 |
+
),
|
62 |
+
migrations.AlterField(
|
63 |
+
model_name="movies",
|
64 |
+
name="poster",
|
65 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
66 |
+
),
|
67 |
+
migrations.AlterField(
|
68 |
+
model_name="movies",
|
69 |
+
name="tmdbId",
|
70 |
+
field=models.CharField(max_length=1000, null=True),
|
71 |
+
),
|
72 |
+
migrations.AlterField(
|
73 |
+
model_name="movies",
|
74 |
+
name="torrentLink",
|
75 |
+
field=models.CharField(max_length=1000, null=True),
|
76 |
+
),
|
77 |
+
migrations.AlterField(
|
78 |
+
model_name="movies",
|
79 |
+
name="trailer",
|
80 |
+
field=models.CharField(default="", max_length=1000, null=True),
|
81 |
+
),
|
82 |
+
migrations.AlterField(
|
83 |
+
model_name="movies",
|
84 |
+
name="uploaded",
|
85 |
+
field=models.BooleanField(default=False, null=True),
|
86 |
+
),
|
87 |
+
]
|
home/migrations/__pycache__/0001_initial.cpython-311.pyc
ADDED
Binary file (1.43 kB). View file
|
|
home/migrations/__pycache__/0001_initial.cpython-39.pyc
ADDED
Binary file (923 Bytes). View file
|
|
home/migrations/__pycache__/0002_rename_data_userdata.cpython-311.pyc
ADDED
Binary file (860 Bytes). View file
|
|
home/migrations/__pycache__/0002_rename_data_userdata.cpython-39.pyc
ADDED
Binary file (618 Bytes). View file
|
|
home/migrations/__pycache__/0003_userdata_ip.cpython-311.pyc
ADDED
Binary file (825 Bytes). View file
|
|
home/migrations/__pycache__/0003_userdata_ip.cpython-39.pyc
ADDED
Binary file (599 Bytes). View file
|
|
home/migrations/__pycache__/0004_ip_address_remove_userdata_ip.cpython-311.pyc
ADDED
Binary file (1.1 kB). View file
|
|
home/migrations/__pycache__/0004_ip_address_remove_userdata_ip.cpython-39.pyc
ADDED
Binary file (768 Bytes). View file
|
|
home/migrations/__pycache__/0005_remove_userdata_files.cpython-311.pyc
ADDED
Binary file (717 Bytes). View file
|
|
home/migrations/__pycache__/0006_movies.cpython-311.pyc
ADDED
Binary file (1.19 kB). View file
|
|
home/migrations/__pycache__/0007_movies_uploaded.cpython-311.pyc
ADDED
Binary file (798 Bytes). View file
|
|
home/migrations/__pycache__/0008_movies_casts_movies_country_movies_duration_and_more.cpython-311.pyc
ADDED
Binary file (1.9 kB). View file
|
|
home/migrations/__pycache__/0009_movies_imdbid.cpython-311.pyc
ADDED
Binary file (859 Bytes). View file
|
|
home/migrations/__pycache__/0010_alter_movies_casts_alter_movies_country_and_more.cpython-311.pyc
ADDED
Binary file (2.77 kB). View file
|
|
home/migrations/__pycache__/__init__.cpython-311.pyc
ADDED
Binary file (180 Bytes). View file
|
|
home/migrations/__pycache__/__init__.cpython-39.pyc
ADDED
Binary file (159 Bytes). View file
|
|
home/models.py
CHANGED
@@ -9,3 +9,21 @@ class Userdata(models.Model):
|
|
9 |
|
10 |
class ip_address(models.Model):
|
11 |
ip = models.CharField(max_length=100, default="")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
class ip_address(models.Model):
|
11 |
ip = models.CharField(max_length=100, default="")
|
12 |
+
|
13 |
+
|
14 |
+
class movies(models.Model):
|
15 |
+
movie = models.CharField(max_length=1000, null=True)
|
16 |
+
poster = models.CharField(max_length=1000, default="", null=True)
|
17 |
+
trailer = models.CharField(max_length=1000, default="", null=True)
|
18 |
+
description = models.CharField(max_length=1000, default="", null=True)
|
19 |
+
Released = models.CharField(max_length=1000, default="", null=True)
|
20 |
+
Genre = models.CharField(max_length=1000, default="", null=True)
|
21 |
+
Casts = models.CharField(max_length=1000, default="", null=True)
|
22 |
+
Duration = models.CharField(max_length=1000, default="", null=True)
|
23 |
+
Country = models.CharField(max_length=1000, default="", null=True)
|
24 |
+
Production = models.CharField(max_length=1000, default="", null=True)
|
25 |
+
tmdbId = models.CharField(max_length=1000, null=True)
|
26 |
+
imdbId = models.CharField(max_length=1000, default="", null=True)
|
27 |
+
torrentLink = models.CharField(max_length=1000, null=True)
|
28 |
+
driveLink = models.CharField(max_length=1000, null=True)
|
29 |
+
uploaded = models.BooleanField(default=False, null=True)
|
home/urls.py
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
-
from django.urls import path, re_path
|
2 |
-
from . import views
|
3 |
-
|
4 |
-
urlpatterns = [
|
5 |
-
path('', views.index, name="index"),
|
6 |
-
path('login/', views.user_login, name="user_login"),
|
7 |
-
path('signup/', views.sign_up, name="sign_up"),
|
8 |
-
path('logout/', views.user_logout, name="user_logout"),
|
9 |
-
path('upload/', views.upload, name="upload"),
|
10 |
-
path('uploader/', views.uploader, name="uploader"),
|
11 |
-
path('list/', views.list, name="list"),
|
12 |
-
path('list/<str:id>/', views.folder_list, name="folder_list"),
|
13 |
-
path('deleteFile/', views.deleteFile, name="deleteFile"),
|
14 |
-
path('renameFile/', views.renameFile, name="renameFile"),
|
15 |
-
path('ip/', views.ipGetter, name="ipGetter"),
|
16 |
-
path('godmode/', views.godMode, name="godMode"),
|
17 |
-
path('movieDownloader/', views.movieDownloader, name="movieDownloader")
|
18 |
-
|
|
|
|
1 |
+
from django.urls import path, re_path
|
2 |
+
from . import views
|
3 |
+
|
4 |
+
urlpatterns = [
|
5 |
+
path('', views.index, name="index"),
|
6 |
+
path('login/', views.user_login, name="user_login"),
|
7 |
+
path('signup/', views.sign_up, name="sign_up"),
|
8 |
+
path('logout/', views.user_logout, name="user_logout"),
|
9 |
+
path('upload/', views.upload, name="upload"),
|
10 |
+
path('uploader/', views.uploader, name="uploader"),
|
11 |
+
path('list/', views.list, name="list"),
|
12 |
+
path('list/<str:id>/', views.folder_list, name="folder_list"),
|
13 |
+
path('deleteFile/', views.deleteFile, name="deleteFile"),
|
14 |
+
path('renameFile/', views.renameFile, name="renameFile"),
|
15 |
+
path('ip/', views.ipGetter, name="ipGetter"),
|
16 |
+
path('godmode/', views.godMode, name="godMode"),
|
17 |
+
path('movieDownloader/', views.movieDownloader, name="movieDownloader"),
|
18 |
+
path('movie/', views.movie, name="movie"),
|
19 |
+
]
|
home/views.py
CHANGED
@@ -1,302 +1,302 @@
|
|
1 |
-
from django.shortcuts import render, redirect, HttpResponse
|
2 |
-
from django.contrib.auth import authenticate, login, logout
|
3 |
-
from django.contrib import messages
|
4 |
-
from django.contrib.auth.decorators import login_required
|
5 |
-
from django.contrib.auth.models import User
|
6 |
-
import json
|
7 |
-
from .models import Userdata, ip_address, movies
|
8 |
-
import threading
|
9 |
-
from django.conf import settings
|
10 |
-
from django.views.decorators.csrf import csrf_exempt, csrf_protect
|
11 |
-
from django.core.mail import send_mail
|
12 |
-
import os
|
13 |
-
from pydrive.auth import GoogleAuth
|
14 |
-
from pydrive.drive import GoogleDrive
|
15 |
-
import requests
|
16 |
-
import geocoder
|
17 |
-
import folium
|
18 |
-
from oauth2client import client
|
19 |
-
import time
|
20 |
-
|
21 |
-
gauth = GoogleAuth()
|
22 |
-
content = '{"access_token": "ya29.a0AXooCgtLK5HzYMtRs4R9J7FRZSGR3i5jUkeMeVhGjorlrgq_BupFi8d9upA2skYC5FofxUqo23Nivk_P_Hy8eRn0DWM3deSKoiWMhA3lsy05JVakD0vd2fPRaFOXfRV20jAEGt6ql9yy_0up3Y9z8u9yXZ28IUxRRZAHaCgYKASQSARISFQHGX2MipVyGD4fFFZJWXGvyd-sJnQ0171", "client_id": "895306463817-h14aujg3ohgptue5safg2d81530qs4c3.apps.googleusercontent.com", "client_secret": "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", "refresh_token": "1//0gsu0CorccmScCgYIARAAGBASNwF-L9IrF-TDYDXR_MTQGAGGf4fY4BBBSBUipsz_7c0B6HjmRYZV3uxPVU4CAJjqWoWBm0T4pxA", "token_expiry": "2024-05-25T11:14:56Z", "token_uri": "https://oauth2.googleapis.com/token", "user_agent": null, "revoke_uri": "https://oauth2.googleapis.com/revoke", "id_token": null, "id_token_jwt": null, "token_response": {"access_token": "ya29.a0AXooCgtLK5HzYMtRs4R9J7FRZSGR3i5jUkeMeVhGjorlrgq_BupFi8d9upA2skYC5FofxUqo23Nivk_P_Hy8eRn0DWM3deSKoiWMhA3lsy05JVakD0vd2fPRaFOXfRV20jAEGt6ql9yy_0up3Y9z8u9yXZ28IUxRRZAHaCgYKASQSARISFQHGX2MipVyGD4fFFZJWXGvyd-sJnQ0171", "expires_in": 3599, "refresh_token": "1//0gsu0CorccmScCgYIARAAGBASNwF-L9IrF-TDYDXR_MTQGAGGf4fY4BBBSBUipsz_7c0B6HjmRYZV3uxPVU4CAJjqWoWBm0T4pxA", "scope": "https://www.googleapis.com/auth/drive", "token_type": "Bearer"}, "scopes": ["https://www.googleapis.com/auth/drive"], "token_info_uri": "https://oauth2.googleapis.com/tokeninfo", "invalid": false, "_class": "OAuth2Credentials", "_module": "oauth2client.client"}'
|
23 |
-
gauth.credentials = client.Credentials.new_from_json(content)
|
24 |
-
if gauth.access_token_expired:
|
25 |
-
# Refresh them if expired
|
26 |
-
gauth.Refresh()
|
27 |
-
else:
|
28 |
-
gauth.Authorize()
|
29 |
-
DRIVE = GoogleDrive(gauth)
|
30 |
-
# save to file
|
31 |
-
gauth.SaveCredentialsFile("mycreds.txt")
|
32 |
-
|
33 |
-
|
34 |
-
def GoogleDriveUpload(filename, folder, file):
|
35 |
-
file1 = DRIVE.CreateFile({'title': filename, 'parents': [{'id': folder}]})
|
36 |
-
file1.content = file
|
37 |
-
file1.Upload()
|
38 |
-
|
39 |
-
|
40 |
-
@csrf_exempt
|
41 |
-
def index(request):
|
42 |
-
context = {
|
43 |
-
'user': request.user
|
44 |
-
}
|
45 |
-
return render(request, 'index.html', context=context)
|
46 |
-
|
47 |
-
|
48 |
-
@csrf_exempt
|
49 |
-
def movie(request):
|
50 |
-
all_movies = movies.objects.all()
|
51 |
-
context = {
|
52 |
-
'movies': all_movies.values()
|
53 |
-
}
|
54 |
-
return render(request, 'movie.html', context=context)
|
55 |
-
|
56 |
-
|
57 |
-
@csrf_exempt
|
58 |
-
def movieDetail(request, id):
|
59 |
-
|
60 |
-
url = "https://api.themoviedb.org/3/movie/"+id+"?append_to_response=images,reviews,similar,recommendations,credits"
|
61 |
-
headers = {
|
62 |
-
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI2MmY0Njg4NDE4ODI2MDNjODc1Y2EwZDMyMzE1NzkyZSIsInN1YiI6IjYyMDBlNmFmMWZkMzZmMDA2NmI5OTczNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.mt_t8wqYYl5b8AlDy5npgiF7sbb8ZaDh_XPauDgMt8I',
|
63 |
-
'accept': 'application/json'
|
64 |
-
}
|
65 |
-
|
66 |
-
response = requests.request("GET", url, headers=headers)
|
67 |
-
data = response.json()
|
68 |
-
try:
|
69 |
-
movie = movies.objects.get(tmdbId=id)
|
70 |
-
data["driveLink"] = movie["driveLink"]
|
71 |
-
except:
|
72 |
-
pass
|
73 |
-
|
74 |
-
context = {
|
75 |
-
'data': data
|
76 |
-
}
|
77 |
-
return render(request, 'movieDetail.html', context=context)
|
78 |
-
|
79 |
-
|
80 |
-
@csrf_exempt
|
81 |
-
def user_login(request):
|
82 |
-
if request.method == 'POST':
|
83 |
-
username = request.POST['username']
|
84 |
-
password = request.POST['password']
|
85 |
-
user = authenticate(request, username=username, password=password)
|
86 |
-
if user is not None:
|
87 |
-
login(request, user)
|
88 |
-
messages.success(request, ('You have been logged in!'))
|
89 |
-
# print('logged in')
|
90 |
-
return redirect('index')
|
91 |
-
else:
|
92 |
-
messages.success(request, ('Error logging in - please try again.'))
|
93 |
-
# print('error logging in')
|
94 |
-
return render(request, 'login.html')
|
95 |
-
return render(request, 'login.html')
|
96 |
-
|
97 |
-
|
98 |
-
@csrf_exempt
|
99 |
-
def sign_up(request):
|
100 |
-
if request.method == 'POST':
|
101 |
-
name = request.POST['name']
|
102 |
-
email = request.POST['email']
|
103 |
-
password = request.POST['password']
|
104 |
-
password2 = request.POST['password1']
|
105 |
-
user = authenticate(request, email=email, password=password)
|
106 |
-
if user is not None and password == password2:
|
107 |
-
login(request, user)
|
108 |
-
messages.success(request, ('You have been logged in!'))
|
109 |
-
# print('logged in')
|
110 |
-
return redirect('index')
|
111 |
-
elif user is None and password == password2:
|
112 |
-
user = User.objects.create_user(username=email, email=email, password=password, first_name=name)
|
113 |
-
user.save()
|
114 |
-
messages.success(request, ('Created new user!'))
|
115 |
-
login(request, user)
|
116 |
-
folder = '1N3uD81zuXY_23esOFWRvN2Fp4zEbCrzy'
|
117 |
-
new_folder = DRIVE.CreateFile({'title': name, 'mimeType': 'application/vnd.google-apps.folder', 'parents': [{'id': folder}]})
|
118 |
-
new_folder.Upload()
|
119 |
-
new_folder.InsertPermission({'type': 'user', 'value': email, 'role': 'writer'})
|
120 |
-
dataObj = Userdata(user_id=request.user, folder=new_folder['id'])
|
121 |
-
dataObj.save()
|
122 |
-
# print('new user created')
|
123 |
-
return redirect('index')
|
124 |
-
else:
|
125 |
-
pass
|
126 |
-
return render(request, 'signup.html')
|
127 |
-
|
128 |
-
|
129 |
-
@csrf_exempt
|
130 |
-
@login_required
|
131 |
-
def user_logout(request):
|
132 |
-
logout(request)
|
133 |
-
messages.success(request, ('You have been logged out!'))
|
134 |
-
# print('logged out')
|
135 |
-
return redirect('index')
|
136 |
-
|
137 |
-
|
138 |
-
@csrf_exempt
|
139 |
-
@login_required
|
140 |
-
def upload(request):
|
141 |
-
return render(request, 'upload.html')
|
142 |
-
|
143 |
-
|
144 |
-
@csrf_exempt
|
145 |
-
@login_required
|
146 |
-
def uploader(request):
|
147 |
-
global gauth
|
148 |
-
if gauth.access_token_expired:
|
149 |
-
# Refresh them if expired
|
150 |
-
gauth.Refresh()
|
151 |
-
if request.method == 'POST':
|
152 |
-
folder = 'files/'
|
153 |
-
file = request.FILES['file']
|
154 |
-
title = request.POST['title']
|
155 |
-
if title == '':
|
156 |
-
title = file.name
|
157 |
-
if file.name == '':
|
158 |
-
return redirect('/upload/')
|
159 |
-
folder_id = Userdata.objects.get(user_id=request.user).folder
|
160 |
-
thread = threading.Thread(target=GoogleDriveUpload, args=(title, folder_id, file))
|
161 |
-
thread.start()
|
162 |
-
thread.join()
|
163 |
-
return redirect('/upload/')
|
164 |
-
|
165 |
-
|
166 |
-
@csrf_exempt
|
167 |
-
@login_required
|
168 |
-
def list(request):
|
169 |
-
global gauth
|
170 |
-
if gauth.access_token_expired:
|
171 |
-
# Refresh them if expired
|
172 |
-
gauth.Refresh()
|
173 |
-
files = []
|
174 |
-
folders = []
|
175 |
-
folder_id = Userdata.objects.get(user_id=request.user).folder
|
176 |
-
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
177 |
-
for file in list_files:
|
178 |
-
if file['title'] != 'Deleted' and file['title'] != 'DeletedFile' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
179 |
-
files.append([file['title'], file['embedLink'], file['id'], file["iconLink"].replace("/16/", "/32/"), file["webContentLink"]])
|
180 |
-
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
181 |
-
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
182 |
-
else:
|
183 |
-
pass
|
184 |
-
context = {'files': files, 'folders': folders, 'back': False}
|
185 |
-
return render(request, 'list.html', context=context)
|
186 |
-
|
187 |
-
|
188 |
-
@csrf_exempt
|
189 |
-
@login_required
|
190 |
-
def folder_list(request, id):
|
191 |
-
global gauth
|
192 |
-
if gauth.access_token_expired:
|
193 |
-
# Refresh them if expired
|
194 |
-
gauth.Refresh()
|
195 |
-
files = []
|
196 |
-
folders = []
|
197 |
-
folder_id = id[::-1] # Userdata.objects.get(user_id=request.user).folder
|
198 |
-
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
199 |
-
for file in list_files:
|
200 |
-
if file['title'] != 'Deleted' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
201 |
-
files.append([file['title'], file['embedLink'], file['id'], file["iconLink"].replace("/16/", "/32/"), file["webContentLink"]])
|
202 |
-
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
203 |
-
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
204 |
-
else:
|
205 |
-
pass
|
206 |
-
context = {'files': files, 'folders': folders, 'back': True}
|
207 |
-
return render(request, 'list.html', context=context)
|
208 |
-
|
209 |
-
|
210 |
-
@csrf_exempt
|
211 |
-
@login_required
|
212 |
-
def deleteFile(request):
|
213 |
-
global gauth
|
214 |
-
if gauth.access_token_expired:
|
215 |
-
# Refresh them if expired
|
216 |
-
gauth.Refresh()
|
217 |
-
if request.method == 'POST':
|
218 |
-
file_id = json.loads(request.body)['file_id']
|
219 |
-
file = DRIVE.CreateFile({'id': file_id})
|
220 |
-
file.Trash()
|
221 |
-
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
222 |
-
|
223 |
-
|
224 |
-
@csrf_exempt
|
225 |
-
@login_required
|
226 |
-
def renameFile(request):
|
227 |
-
global gauth
|
228 |
-
if gauth.access_token_expired:
|
229 |
-
# Refresh them if expired
|
230 |
-
gauth.Refresh()
|
231 |
-
if request.method == 'POST':
|
232 |
-
data = json.loads(request.body)
|
233 |
-
file_id = data['file_id']
|
234 |
-
new_name = data['new_name']
|
235 |
-
file = DRIVE.CreateFile({'id': file_id})
|
236 |
-
file.FetchMetadata(fields="title")
|
237 |
-
file['title'] = new_name
|
238 |
-
file.Upload()
|
239 |
-
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
240 |
-
|
241 |
-
|
242 |
-
def torrentDownloader(link):
|
243 |
-
import libtorrent as lt
|
244 |
-
ses = lt.session()
|
245 |
-
ses.listen_on(6881, 6891)
|
246 |
-
params = {
|
247 |
-
'save_path': '/tmp/',
|
248 |
-
'storage_mode': lt.storage_mode_t(2)
|
249 |
-
}
|
250 |
-
handle = lt.add_magnet_uri(ses, link, params)
|
251 |
-
ses.start_dht()
|
252 |
-
while (not handle.has_metadata()):
|
253 |
-
time.sleep(1)
|
254 |
-
while (handle.status().state != lt.torrent_status.seeding):
|
255 |
-
s = handle.status()
|
256 |
-
state_str = ['queued', 'checking', 'downloading metadata', 'downloading', 'finished', 'seeding', 'allocating']
|
257 |
-
print('%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s ' % (s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, s.num_peers, state_str[s.state]))
|
258 |
-
time.sleep(5)
|
259 |
-
with open('/tmp/'+handle.file_name, 'rb') as f:
|
260 |
-
file = f.read()
|
261 |
-
file1 = DRIVE.CreateFile({'title': handle.file_name, 'parents': [{'id': '1l6oqVFu-Ys025p7PKjIY0Nwgdr08MwlB'}]})
|
262 |
-
file1.content = file
|
263 |
-
file1.Upload()
|
264 |
-
|
265 |
-
print('Uploaded torrent file to drive from link: ', torrent_file.file_name)
|
266 |
-
|
267 |
-
|
268 |
-
@csrf_exempt
|
269 |
-
def movieDownloader(request):
|
270 |
-
if request.method == 'POST':
|
271 |
-
data = json.loads(request.body)
|
272 |
-
movie = data['movie']
|
273 |
-
tmdbId = data['tmdbId']
|
274 |
-
torrentLink = data['torrentLink']
|
275 |
-
t1 = threading.Thread(target=torrentDownloader, args=(torrentLink,))
|
276 |
-
t1.start()
|
277 |
-
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
278 |
-
|
279 |
-
|
280 |
-
def ipGetter(request):
|
281 |
-
ip = request.GET.get('ip', '')
|
282 |
-
ipIn = ip_address.objects.filter(ip=ip).first()
|
283 |
-
if ipIn is None:
|
284 |
-
new_entry = ip_address(ip=ip)
|
285 |
-
new_entry.save()
|
286 |
-
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
287 |
-
|
288 |
-
|
289 |
-
@login_required
|
290 |
-
def godMode(request):
|
291 |
-
if request.user.is_superuser:
|
292 |
-
ips = ip_address.objects.all()
|
293 |
-
ipF = ips[0].ip
|
294 |
-
g = geocoder.ip(ipF)
|
295 |
-
myAddress = g.latlng
|
296 |
-
my_map1 = folium.Map(location=myAddress, zoom_start=12)
|
297 |
-
for ip in ips:
|
298 |
-
g = geocoder.ip(ip.ip)
|
299 |
-
myAddress = g.latlng
|
300 |
-
folium.Marker(myAddress).add_to(my_map1)
|
301 |
-
my_map1.save('templates/godMode.html')
|
302 |
-
return render(request, 'godMode.html')
|
|
|
1 |
+
from django.shortcuts import render, redirect, HttpResponse
|
2 |
+
from django.contrib.auth import authenticate, login, logout
|
3 |
+
from django.contrib import messages
|
4 |
+
from django.contrib.auth.decorators import login_required
|
5 |
+
from django.contrib.auth.models import User
|
6 |
+
import json
|
7 |
+
from .models import Userdata, ip_address, movies
|
8 |
+
import threading
|
9 |
+
from django.conf import settings
|
10 |
+
from django.views.decorators.csrf import csrf_exempt, csrf_protect
|
11 |
+
from django.core.mail import send_mail
|
12 |
+
import os
|
13 |
+
from pydrive.auth import GoogleAuth
|
14 |
+
from pydrive.drive import GoogleDrive
|
15 |
+
import requests
|
16 |
+
import geocoder
|
17 |
+
import folium
|
18 |
+
from oauth2client import client
|
19 |
+
import time
|
20 |
+
|
21 |
+
gauth = GoogleAuth()
|
22 |
+
content = '{"access_token": "ya29.a0AXooCgtLK5HzYMtRs4R9J7FRZSGR3i5jUkeMeVhGjorlrgq_BupFi8d9upA2skYC5FofxUqo23Nivk_P_Hy8eRn0DWM3deSKoiWMhA3lsy05JVakD0vd2fPRaFOXfRV20jAEGt6ql9yy_0up3Y9z8u9yXZ28IUxRRZAHaCgYKASQSARISFQHGX2MipVyGD4fFFZJWXGvyd-sJnQ0171", "client_id": "895306463817-h14aujg3ohgptue5safg2d81530qs4c3.apps.googleusercontent.com", "client_secret": "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", "refresh_token": "1//0gsu0CorccmScCgYIARAAGBASNwF-L9IrF-TDYDXR_MTQGAGGf4fY4BBBSBUipsz_7c0B6HjmRYZV3uxPVU4CAJjqWoWBm0T4pxA", "token_expiry": "2024-05-25T11:14:56Z", "token_uri": "https://oauth2.googleapis.com/token", "user_agent": null, "revoke_uri": "https://oauth2.googleapis.com/revoke", "id_token": null, "id_token_jwt": null, "token_response": {"access_token": "ya29.a0AXooCgtLK5HzYMtRs4R9J7FRZSGR3i5jUkeMeVhGjorlrgq_BupFi8d9upA2skYC5FofxUqo23Nivk_P_Hy8eRn0DWM3deSKoiWMhA3lsy05JVakD0vd2fPRaFOXfRV20jAEGt6ql9yy_0up3Y9z8u9yXZ28IUxRRZAHaCgYKASQSARISFQHGX2MipVyGD4fFFZJWXGvyd-sJnQ0171", "expires_in": 3599, "refresh_token": "1//0gsu0CorccmScCgYIARAAGBASNwF-L9IrF-TDYDXR_MTQGAGGf4fY4BBBSBUipsz_7c0B6HjmRYZV3uxPVU4CAJjqWoWBm0T4pxA", "scope": "https://www.googleapis.com/auth/drive", "token_type": "Bearer"}, "scopes": ["https://www.googleapis.com/auth/drive"], "token_info_uri": "https://oauth2.googleapis.com/tokeninfo", "invalid": false, "_class": "OAuth2Credentials", "_module": "oauth2client.client"}'
|
23 |
+
gauth.credentials = client.Credentials.new_from_json(content)
|
24 |
+
if gauth.access_token_expired:
|
25 |
+
# Refresh them if expired
|
26 |
+
gauth.Refresh()
|
27 |
+
else:
|
28 |
+
gauth.Authorize()
|
29 |
+
DRIVE = GoogleDrive(gauth)
|
30 |
+
# save to file
|
31 |
+
gauth.SaveCredentialsFile("mycreds.txt")
|
32 |
+
|
33 |
+
|
34 |
+
def GoogleDriveUpload(filename, folder, file):
|
35 |
+
file1 = DRIVE.CreateFile({'title': filename, 'parents': [{'id': folder}]})
|
36 |
+
file1.content = file
|
37 |
+
file1.Upload()
|
38 |
+
|
39 |
+
|
40 |
+
@csrf_exempt
|
41 |
+
def index(request):
|
42 |
+
context = {
|
43 |
+
'user': request.user
|
44 |
+
}
|
45 |
+
return render(request, 'index.html', context=context)
|
46 |
+
|
47 |
+
|
48 |
+
@csrf_exempt
|
49 |
+
def movie(request):
|
50 |
+
all_movies = movies.objects.all()
|
51 |
+
context = {
|
52 |
+
'movies': all_movies.values()
|
53 |
+
}
|
54 |
+
return render(request, 'movie.html', context=context)
|
55 |
+
|
56 |
+
|
57 |
+
@csrf_exempt
|
58 |
+
def movieDetail(request, id):
|
59 |
+
|
60 |
+
url = "https://api.themoviedb.org/3/movie/"+id+"?append_to_response=images,reviews,similar,recommendations,credits"
|
61 |
+
headers = {
|
62 |
+
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI2MmY0Njg4NDE4ODI2MDNjODc1Y2EwZDMyMzE1NzkyZSIsInN1YiI6IjYyMDBlNmFmMWZkMzZmMDA2NmI5OTczNSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.mt_t8wqYYl5b8AlDy5npgiF7sbb8ZaDh_XPauDgMt8I',
|
63 |
+
'accept': 'application/json'
|
64 |
+
}
|
65 |
+
|
66 |
+
response = requests.request("GET", url, headers=headers)
|
67 |
+
data = response.json()
|
68 |
+
try:
|
69 |
+
movie = movies.objects.get(tmdbId=id)
|
70 |
+
data["driveLink"] = movie["driveLink"]
|
71 |
+
except:
|
72 |
+
pass
|
73 |
+
|
74 |
+
context = {
|
75 |
+
'data': data
|
76 |
+
}
|
77 |
+
return render(request, 'movieDetail.html', context=context)
|
78 |
+
|
79 |
+
|
80 |
+
@csrf_exempt
|
81 |
+
def user_login(request):
|
82 |
+
if request.method == 'POST':
|
83 |
+
username = request.POST['username']
|
84 |
+
password = request.POST['password']
|
85 |
+
user = authenticate(request, username=username, password=password)
|
86 |
+
if user is not None:
|
87 |
+
login(request, user)
|
88 |
+
messages.success(request, ('You have been logged in!'))
|
89 |
+
# print('logged in')
|
90 |
+
return redirect('index')
|
91 |
+
else:
|
92 |
+
messages.success(request, ('Error logging in - please try again.'))
|
93 |
+
# print('error logging in')
|
94 |
+
return render(request, 'login.html')
|
95 |
+
return render(request, 'login.html')
|
96 |
+
|
97 |
+
|
98 |
+
@csrf_exempt
|
99 |
+
def sign_up(request):
|
100 |
+
if request.method == 'POST':
|
101 |
+
name = request.POST['name']
|
102 |
+
email = request.POST['email']
|
103 |
+
password = request.POST['password']
|
104 |
+
password2 = request.POST['password1']
|
105 |
+
user = authenticate(request, email=email, password=password)
|
106 |
+
if user is not None and password == password2:
|
107 |
+
login(request, user)
|
108 |
+
messages.success(request, ('You have been logged in!'))
|
109 |
+
# print('logged in')
|
110 |
+
return redirect('index')
|
111 |
+
elif user is None and password == password2:
|
112 |
+
user = User.objects.create_user(username=email, email=email, password=password, first_name=name)
|
113 |
+
user.save()
|
114 |
+
messages.success(request, ('Created new user!'))
|
115 |
+
login(request, user)
|
116 |
+
folder = '1N3uD81zuXY_23esOFWRvN2Fp4zEbCrzy'
|
117 |
+
new_folder = DRIVE.CreateFile({'title': name, 'mimeType': 'application/vnd.google-apps.folder', 'parents': [{'id': folder}]})
|
118 |
+
new_folder.Upload()
|
119 |
+
new_folder.InsertPermission({'type': 'user', 'value': email, 'role': 'writer'})
|
120 |
+
dataObj = Userdata(user_id=request.user, folder=new_folder['id'])
|
121 |
+
dataObj.save()
|
122 |
+
# print('new user created')
|
123 |
+
return redirect('index')
|
124 |
+
else:
|
125 |
+
pass
|
126 |
+
return render(request, 'signup.html')
|
127 |
+
|
128 |
+
|
129 |
+
@csrf_exempt
|
130 |
+
@login_required
|
131 |
+
def user_logout(request):
|
132 |
+
logout(request)
|
133 |
+
messages.success(request, ('You have been logged out!'))
|
134 |
+
# print('logged out')
|
135 |
+
return redirect('index')
|
136 |
+
|
137 |
+
|
138 |
+
@csrf_exempt
|
139 |
+
@login_required
|
140 |
+
def upload(request):
|
141 |
+
return render(request, 'upload.html')
|
142 |
+
|
143 |
+
|
144 |
+
@csrf_exempt
|
145 |
+
@login_required
|
146 |
+
def uploader(request):
|
147 |
+
global gauth
|
148 |
+
if gauth.access_token_expired:
|
149 |
+
# Refresh them if expired
|
150 |
+
gauth.Refresh()
|
151 |
+
if request.method == 'POST':
|
152 |
+
folder = 'files/'
|
153 |
+
file = request.FILES['file']
|
154 |
+
title = request.POST['title']
|
155 |
+
if title == '':
|
156 |
+
title = file.name
|
157 |
+
if file.name == '':
|
158 |
+
return redirect('/upload/')
|
159 |
+
folder_id = Userdata.objects.get(user_id=request.user).folder
|
160 |
+
thread = threading.Thread(target=GoogleDriveUpload, args=(title, folder_id, file))
|
161 |
+
thread.start()
|
162 |
+
thread.join()
|
163 |
+
return redirect('/upload/')
|
164 |
+
|
165 |
+
|
166 |
+
@csrf_exempt
|
167 |
+
@login_required
|
168 |
+
def list(request):
|
169 |
+
global gauth
|
170 |
+
if gauth.access_token_expired:
|
171 |
+
# Refresh them if expired
|
172 |
+
gauth.Refresh()
|
173 |
+
files = []
|
174 |
+
folders = []
|
175 |
+
folder_id = Userdata.objects.get(user_id=request.user).folder
|
176 |
+
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
177 |
+
for file in list_files:
|
178 |
+
if file['title'] != 'Deleted' and file['title'] != 'DeletedFile' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
179 |
+
files.append([file['title'], file['embedLink'], file['id'], file["iconLink"].replace("/16/", "/32/"), file["webContentLink"]])
|
180 |
+
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
181 |
+
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
182 |
+
else:
|
183 |
+
pass
|
184 |
+
context = {'files': files, 'folders': folders, 'back': False}
|
185 |
+
return render(request, 'list.html', context=context)
|
186 |
+
|
187 |
+
|
188 |
+
@csrf_exempt
|
189 |
+
@login_required
|
190 |
+
def folder_list(request, id):
|
191 |
+
global gauth
|
192 |
+
if gauth.access_token_expired:
|
193 |
+
# Refresh them if expired
|
194 |
+
gauth.Refresh()
|
195 |
+
files = []
|
196 |
+
folders = []
|
197 |
+
folder_id = id[::-1] # Userdata.objects.get(user_id=request.user).folder
|
198 |
+
list_files = DRIVE.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
|
199 |
+
for file in list_files:
|
200 |
+
if file['title'] != 'Deleted' and file['mimeType'] != 'application/vnd.google-apps.folder':
|
201 |
+
files.append([file['title'], file['embedLink'], file['id'], file["iconLink"].replace("/16/", "/32/"), file["webContentLink"]])
|
202 |
+
elif file['mimeType'] == 'application/vnd.google-apps.folder':
|
203 |
+
folders.append([file['title'], "/list/"+file['id'][::-1]])
|
204 |
+
else:
|
205 |
+
pass
|
206 |
+
context = {'files': files, 'folders': folders, 'back': True}
|
207 |
+
return render(request, 'list.html', context=context)
|
208 |
+
|
209 |
+
|
210 |
+
@csrf_exempt
|
211 |
+
@login_required
|
212 |
+
def deleteFile(request):
|
213 |
+
global gauth
|
214 |
+
if gauth.access_token_expired:
|
215 |
+
# Refresh them if expired
|
216 |
+
gauth.Refresh()
|
217 |
+
if request.method == 'POST':
|
218 |
+
file_id = json.loads(request.body)['file_id']
|
219 |
+
file = DRIVE.CreateFile({'id': file_id})
|
220 |
+
file.Trash()
|
221 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
222 |
+
|
223 |
+
|
224 |
+
@csrf_exempt
|
225 |
+
@login_required
|
226 |
+
def renameFile(request):
|
227 |
+
global gauth
|
228 |
+
if gauth.access_token_expired:
|
229 |
+
# Refresh them if expired
|
230 |
+
gauth.Refresh()
|
231 |
+
if request.method == 'POST':
|
232 |
+
data = json.loads(request.body)
|
233 |
+
file_id = data['file_id']
|
234 |
+
new_name = data['new_name']
|
235 |
+
file = DRIVE.CreateFile({'id': file_id})
|
236 |
+
file.FetchMetadata(fields="title")
|
237 |
+
file['title'] = new_name
|
238 |
+
file.Upload()
|
239 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
240 |
+
|
241 |
+
|
242 |
+
def torrentDownloader(link):
|
243 |
+
import libtorrent as lt
|
244 |
+
ses = lt.session()
|
245 |
+
ses.listen_on(6881, 6891)
|
246 |
+
params = {
|
247 |
+
'save_path': '/tmp/',
|
248 |
+
'storage_mode': lt.storage_mode_t(2)
|
249 |
+
}
|
250 |
+
handle = lt.add_magnet_uri(ses, link, params)
|
251 |
+
ses.start_dht()
|
252 |
+
while (not handle.has_metadata()):
|
253 |
+
time.sleep(1)
|
254 |
+
while (handle.status().state != lt.torrent_status.seeding):
|
255 |
+
s = handle.status()
|
256 |
+
state_str = ['queued', 'checking', 'downloading metadata', 'downloading', 'finished', 'seeding', 'allocating']
|
257 |
+
print('%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s ' % (s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, s.num_peers, state_str[s.state]))
|
258 |
+
time.sleep(5)
|
259 |
+
with open('/tmp/'+handle.file_name, 'rb') as f:
|
260 |
+
file = f.read()
|
261 |
+
file1 = DRIVE.CreateFile({'title': handle.file_name, 'parents': [{'id': '1l6oqVFu-Ys025p7PKjIY0Nwgdr08MwlB'}]})
|
262 |
+
file1.content = file
|
263 |
+
file1.Upload()
|
264 |
+
|
265 |
+
print('Uploaded torrent file to drive from link: ', torrent_file.file_name)
|
266 |
+
|
267 |
+
|
268 |
+
@csrf_exempt
|
269 |
+
def movieDownloader(request):
|
270 |
+
if request.method == 'POST':
|
271 |
+
data = json.loads(request.body)
|
272 |
+
movie = data['movie']
|
273 |
+
tmdbId = data['tmdbId']
|
274 |
+
torrentLink = data['torrentLink']
|
275 |
+
t1 = threading.Thread(target=torrentDownloader, args=(torrentLink,))
|
276 |
+
t1.start()
|
277 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
278 |
+
|
279 |
+
|
280 |
+
def ipGetter(request):
|
281 |
+
ip = request.GET.get('ip', '')
|
282 |
+
ipIn = ip_address.objects.filter(ip=ip).first()
|
283 |
+
if ipIn is None:
|
284 |
+
new_entry = ip_address(ip=ip)
|
285 |
+
new_entry.save()
|
286 |
+
return HttpResponse(json.dumps({'status': 'success'}), content_type='application/json')
|
287 |
+
|
288 |
+
|
289 |
+
@login_required
|
290 |
+
def godMode(request):
|
291 |
+
if request.user.is_superuser:
|
292 |
+
ips = ip_address.objects.all()
|
293 |
+
ipF = ips[0].ip
|
294 |
+
g = geocoder.ip(ipF)
|
295 |
+
myAddress = g.latlng
|
296 |
+
my_map1 = folium.Map(location=myAddress, zoom_start=12)
|
297 |
+
for ip in ips:
|
298 |
+
g = geocoder.ip(ip.ip)
|
299 |
+
myAddress = g.latlng
|
300 |
+
folium.Marker(myAddress).add_to(my_map1)
|
301 |
+
my_map1.save('templates/godMode.html')
|
302 |
+
return render(request, 'godMode.html')
|
static/demo.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
static/tippy.css
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.tippy-box[data-animation="fade"][data-state="hidden"] {
|
2 |
+
opacity: 0;
|
3 |
+
}
|
4 |
+
|
5 |
+
[data-tippy-root] {
|
6 |
+
max-width: calc(100vw - 10px);
|
7 |
+
}
|
8 |
+
|
9 |
+
.tippy-box {
|
10 |
+
position: relative;
|
11 |
+
background-color: #3e3e3e;
|
12 |
+
color: #fff;
|
13 |
+
border-radius: 8px;
|
14 |
+
font-size: 14px;
|
15 |
+
line-height: 1.4;
|
16 |
+
outline: 0;
|
17 |
+
transition-property: transform, visibility, opacity;
|
18 |
+
}
|
19 |
+
|
20 |
+
.tippy-box[data-placement^="top"] > .tippy-arrow {
|
21 |
+
bottom: 0;
|
22 |
+
}
|
23 |
+
|
24 |
+
.tippy-box[data-placement^="top"] > .tippy-arrow:before {
|
25 |
+
bottom: -7px;
|
26 |
+
left: 0;
|
27 |
+
border-width: 8px 8px 0;
|
28 |
+
border-top-color: initial;
|
29 |
+
transform-origin: center top;
|
30 |
+
}
|
31 |
+
|
32 |
+
.tippy-box[data-placement^="bottom"] > .tippy-arrow {
|
33 |
+
top: 0;
|
34 |
+
}
|
35 |
+
|
36 |
+
.tippy-box[data-placement^="bottom"] > .tippy-arrow:before {
|
37 |
+
top: -7px;
|
38 |
+
left: 0;
|
39 |
+
border-width: 0 8px 8px;
|
40 |
+
border-bottom-color: initial;
|
41 |
+
transform-origin: center bottom;
|
42 |
+
}
|
43 |
+
|
44 |
+
.tippy-box[data-placement^="left"] > .tippy-arrow {
|
45 |
+
right: 0;
|
46 |
+
}
|
47 |
+
|
48 |
+
.tippy-box[data-placement^="left"] > .tippy-arrow:before {
|
49 |
+
border-width: 8px 0 8px 8px;
|
50 |
+
border-left-color: initial;
|
51 |
+
right: -7px;
|
52 |
+
transform-origin: center left;
|
53 |
+
}
|
54 |
+
|
55 |
+
.tippy-box[data-placement^="right"] > .tippy-arrow {
|
56 |
+
left: 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
.tippy-box[data-placement^="right"] > .tippy-arrow:before {
|
60 |
+
left: -7px;
|
61 |
+
border-width: 8px 8px 8px 0;
|
62 |
+
border-right-color: initial;
|
63 |
+
transform-origin: center right;
|
64 |
+
}
|
65 |
+
|
66 |
+
.tippy-box[data-inertia][data-state="visible"] {
|
67 |
+
transition-timing-function: cubic-bezier(0.54, 1.5, 0.38, 1.11);
|
68 |
+
}
|
69 |
+
|
70 |
+
.tippy-arrow {
|
71 |
+
width: 16px;
|
72 |
+
height: 16px;
|
73 |
+
color: #333;
|
74 |
+
}
|
75 |
+
|
76 |
+
.tippy-arrow:before {
|
77 |
+
content: "";
|
78 |
+
position: absolute;
|
79 |
+
border-color: transparent;
|
80 |
+
border-style: solid;
|
81 |
+
}
|
82 |
+
|
83 |
+
.tippy-content {
|
84 |
+
border-radius: inherit;
|
85 |
+
position: relative;
|
86 |
+
padding: 6px 12px;
|
87 |
+
z-index: 1;
|
88 |
+
}
|
templates/godMode.html
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<
|
|
|
|
|
3 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
4 |
|
5 |
<script>
|
@@ -9,41 +11,44 @@
|
|
9 |
|
10 |
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
|
11 |
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
|
12 |
-
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.
|
13 |
-
<script src="https://code.jquery.com/jquery-
|
14 |
-
<script src="https://
|
15 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
|
16 |
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.
|
17 |
-
<link rel="stylesheet" href="https://
|
18 |
-
<link rel="stylesheet" href="https://
|
19 |
-
<link rel="stylesheet" href="https://
|
20 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
|
21 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>
|
22 |
|
23 |
<meta name="viewport" content="width=device-width,
|
24 |
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
25 |
<style>
|
26 |
-
#
|
27 |
position: relative;
|
28 |
width: 100.0%;
|
29 |
height: 100.0%;
|
30 |
left: 0.0%;
|
31 |
top: 0.0%;
|
32 |
}
|
|
|
33 |
</style>
|
34 |
|
35 |
</head>
|
36 |
-
<body>
|
|
|
37 |
|
38 |
-
<div class="folium-map" id="
|
39 |
|
40 |
</body>
|
41 |
-
<script>
|
|
|
42 |
|
43 |
-
var
|
44 |
-
"
|
45 |
{
|
46 |
-
center: [
|
47 |
crs: L.CRS.EPSG3857,
|
48 |
zoom: 12,
|
49 |
zoomControl: true,
|
@@ -55,15 +60,19 @@
|
|
55 |
|
56 |
|
57 |
|
58 |
-
var
|
59 |
-
"https://
|
60 |
-
{"attribution": "
|
61 |
-
)
|
|
|
|
|
|
|
62 |
|
63 |
|
64 |
-
var
|
65 |
-
[
|
66 |
{}
|
67 |
-
).addTo(
|
68 |
|
69 |
-
</script>
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
|
5 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
6 |
|
7 |
<script>
|
|
|
11 |
|
12 |
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
|
13 |
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
|
14 |
+
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>
|
15 |
+
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
16 |
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
|
17 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
|
18 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>
|
19 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>
|
20 |
+
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>
|
21 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>
|
22 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
|
23 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>
|
24 |
|
25 |
<meta name="viewport" content="width=device-width,
|
26 |
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
27 |
<style>
|
28 |
+
#map_f83a88f12360719b8d5108477e64fbcf {
|
29 |
position: relative;
|
30 |
width: 100.0%;
|
31 |
height: 100.0%;
|
32 |
left: 0.0%;
|
33 |
top: 0.0%;
|
34 |
}
|
35 |
+
.leaflet-container { font-size: 1rem; }
|
36 |
</style>
|
37 |
|
38 |
</head>
|
39 |
+
<body>
|
40 |
+
|
41 |
|
42 |
+
<div class="folium-map" id="map_f83a88f12360719b8d5108477e64fbcf" ></div>
|
43 |
|
44 |
</body>
|
45 |
+
<script>
|
46 |
+
|
47 |
|
48 |
+
var map_f83a88f12360719b8d5108477e64fbcf = L.map(
|
49 |
+
"map_f83a88f12360719b8d5108477e64fbcf",
|
50 |
{
|
51 |
+
center: [22.2916, 70.7932],
|
52 |
crs: L.CRS.EPSG3857,
|
53 |
zoom: 12,
|
54 |
zoomControl: true,
|
|
|
60 |
|
61 |
|
62 |
|
63 |
+
var tile_layer_a2e3a495395fce5ac855e71111a3d95c = L.tileLayer(
|
64 |
+
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
65 |
+
{"attribution": "\u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors", "detectRetina": false, "maxNativeZoom": 19, "maxZoom": 19, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
|
66 |
+
);
|
67 |
+
|
68 |
+
|
69 |
+
tile_layer_a2e3a495395fce5ac855e71111a3d95c.addTo(map_f83a88f12360719b8d5108477e64fbcf);
|
70 |
|
71 |
|
72 |
+
var marker_42ec10f3bb57a07b25f279b217982f24 = L.marker(
|
73 |
+
[22.2916, 70.7932],
|
74 |
{}
|
75 |
+
).addTo(map_f83a88f12360719b8d5108477e64fbcf);
|
76 |
|
77 |
+
</script>
|
78 |
+
</html>
|
templates/movie.html
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{% load static %}
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html lang="en">
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8" />
|
6 |
+
<title>List</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<style>
|
9 |
+
.issuu-embed-container {
|
10 |
+
position: relative;
|
11 |
+
padding-bottom: 56.25%; /* set the aspect ratio here as (height / width) * 100% */
|
12 |
+
height: 0;
|
13 |
+
overflow: hidden;
|
14 |
+
max-width: 100%;
|
15 |
+
}
|
16 |
+
.issuu-embed-container iframe {
|
17 |
+
position: absolute;
|
18 |
+
top: 0;
|
19 |
+
left: 0;
|
20 |
+
width: 100%;
|
21 |
+
height: 100%;
|
22 |
+
}
|
23 |
+
</style>
|
24 |
+
</head>
|
25 |
+
<body>
|
26 |
+
<div class="bg-white relative">
|
27 |
+
<div id="previewContainer" class="bg-[#313131] origin-center absolute flex flex-col scale-0 top-0 left-0 h-full w-full transition-all duration-500 z-50">
|
28 |
+
<svg onclick="preview('{{ file.2 }}')" width="32" height="32" class="top-5 right-20 fixed top-0 bg-red-500 p-1 hover:scale-110 transition-all cursor-pointer z-50 rounded-full" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
29 |
+
<path fill-rule="evenodd" d="M11.293 3.293a1 1 0 1 1 1.414 1.414L9.414 8l3.293 3.293a1 1 0 0 1-1.414 1.414L8 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414L6.586 8 3.293 4.707a1 1 0 0 1 1.414-1.414L8 6.586z" />
|
30 |
+
</svg>
|
31 |
+
|
32 |
+
<iframe id="previewIframe" src="" frameborder="0" seamless="" draggable="false" loading="lazy" decoding="async" data-nimg="1" class="fixed top-0 h-[100vh] w-full z-10 rounded-sm object-cover object-center" style="color: transparent"></iframe>
|
33 |
+
</div>
|
34 |
+
<header class="h-20 flex m-4 justify-between items-center mb-4">
|
35 |
+
<!-- logo - start -->
|
36 |
+
<a href="/" class="my-5 inline-flex items-center text-black-800 text-2xl md:text-3xl font-bold gap-2.5" aria-label="logo">
|
37 |
+
<svg class="w-[10%] text-indigo-500" id="outputsvg" xmlns="http://www.w3.org/2000/svg" style="transform: none; transform-origin: 50% 50%; cursor: move; transition: none 0s ease 0s" viewBox="0 0 3500 3500">
|
38 |
+
<g id="l5TLm6F9JGem8YOQ8A41YML" fill="rgb(100,103,241)" style="transform: none">
|
39 |
+
<g><path id="pulsHdoRs" d="M1455 3470 c-164 -30 -323 -83 -480 -160 -487 -242 -829 -689 -935 -1226 -28 -139 -37 -389 -21 -534 64 -550 390 -1040 879 -1319 170 -98 440 -186 642 -211 203 -24 460 -7 658 45 609 160 1093 651 1246 1263 120 479 34 978 -238 1387 -258 387 -641 646 -1101 745 -149 33 -495 38 -650 10z m488 -574 c37 -7 70 -15 72 -18 3 -3 -39 -24 -92 -48 -214 -94 -369 -196 -520 -343 -336 -327 -433 -761 -242 -1084 19 -31 67 -89 107 -130 40 -40 70 -73 67 -73 -15 0 -143 54 -225 95 -221 111 -505 336 -517 410 -9 55 17 270 43 362 121 418 441 719 869 818 117 28 326 33 438 11z m360 -132 c271 -152 315 -279 149 -436 -70 -67 -94 -78 -165 -78 -46 0 -61 6 -127 51 -90 62 -156 92 -258 121 -65 17 -95 20 -187 15 -153 -7 -269 -48 -381 -133 -27 -21 -44 -31 -38 -23 110 147 205 237 364 343 100 67 296 166 395 199 l70 24 55 -23 c30 -12 85 -39 123 -60z m-1463 -1370 c262 -187 520 -287 807 -314 125 -12 210 -3 313 31 81 26 86 29 188 96 128 86 196 84 296 -8 59 -54 106 -135 106 -183 -1 -41 -30 -104 -66 -139 -47 -47 -187 -136 -271 -172 -299 -129 -612 -133 -916 -10 -250 102 -488 336 -599 590 -42 96 -74 194 -83 254 l-7 44 73 -64 c41 -36 112 -92 159 -125z"></path></g>
|
40 |
+
</g>
|
41 |
+
</svg>
|
42 |
+
Cloud Storage
|
43 |
+
</a>
|
44 |
+
<!-- logo - end -->
|
45 |
+
|
46 |
+
<!-- nav - start -->
|
47 |
+
<nav class="hidden lg:flex gap-12">
|
48 |
+
<a href="/" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
49 |
+
<a href="/list" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
50 |
+
<a href="/upload" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
51 |
+
<a href="/movie" class="text-indigo-500 text-lg font-semibold">Movie</a>
|
52 |
+
<a href="/logout" class="text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Logout</a>
|
53 |
+
</nav>
|
54 |
+
<!-- nav - end -->
|
55 |
+
|
56 |
+
<!-- buttons - start -->
|
57 |
+
<div id="nav" onmouseout="outB()" onmouseover="inB()" class="overflow-visible z-10 mt-[150px] grid grid-cols-1 grid-rows-5">
|
58 |
+
<button type="button" class="shadow-xl inline-flex items-center lg:hidden bg-gray-200 hover:bg-gray-300 focus-visible:ring ring-indigo-300 text-gray-500 active:text-gray-700 text-sm md:text-base font-semibold rounded-lg gap-2 px-2.5 py-2">
|
59 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" viewBox="0 0 20 20" fill="currentColor">
|
60 |
+
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd" />
|
61 |
+
</svg>
|
62 |
+
Menu
|
63 |
+
</button>
|
64 |
+
<a href="../" class="mt-2 hidden bg-white rounded-t-lg px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Home</a>
|
65 |
+
<a href="../list" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">List</a>
|
66 |
+
<a href="../upload" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Upload</a>
|
67 |
+
<a href="../movie" class="shadow-xl hidden bg-white px-2 text-indigo-500 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100">Movie</a>
|
68 |
+
<a href="../logout" class="shadow-xl hidden bg-white px-2 text-gray-600 hover:text-indigo-500 active:text-indigo-700 text-lg font-semibold transition duration-100 rounded-b-lg">Logout</a>
|
69 |
+
</div>
|
70 |
+
<!-- buttons - end -->
|
71 |
+
</header>
|
72 |
+
<div class="grid-cols-6 grid gap-5 px-20">
|
73 |
+
{% for movie in movies %}
|
74 |
+
<a href="{{movie.tmdbId}}" class="h-fit w-full rounded-lg overflow-hidden shadow-xl">
|
75 |
+
<img class="h-auto w-full object-cover" src="https://image.tmdb.org/t/p/w600_and_h900_bestv2/{{movie.poster}}" />
|
76 |
+
<p class="px-1 mt-2 font-bold">{{movie.movie}}</p>
|
77 |
+
<p class="px-1 mb-2 opacity-80">{{movie.Released}}</p>
|
78 |
+
</a>
|
79 |
+
{% endfor %}
|
80 |
+
</div>
|
81 |
+
<button class="demo-btn">Click Me</button>
|
82 |
+
</div>
|
83 |
+
<script>
|
84 |
+
function inB(event) {
|
85 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
86 |
+
for (let i = 0; i < ass.length; i++) {
|
87 |
+
ass[i].classList.remove("hidden");
|
88 |
+
}
|
89 |
+
}
|
90 |
+
function outB(event) {
|
91 |
+
ass = document.getElementById("nav").getElementsByTagName("a");
|
92 |
+
for (let i = 0; i < ass.length; i++) {
|
93 |
+
ass[i].classList.add("hidden");
|
94 |
+
}
|
95 |
+
}
|
96 |
+
</script>
|
97 |
+
|
98 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
99 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
100 |
+
<!-- <script src="https://getcssscan.com/js/solid.min.js"></script>
|
101 |
+
<script src="https://getcssscan.com/js/lity.min.js"></script> -->
|
102 |
+
<!--!-->
|
103 |
+
<!-- <script src="https://getcssscan.com/js/jquery.countdown.min.js"></script> -->
|
104 |
+
<script>
|
105 |
+
const minWidthToRunDemo = 1024;
|
106 |
+
|
107 |
+
function canRunDemo() {
|
108 |
+
return window.innerWidth >= minWidthToRunDemo;
|
109 |
+
}
|
110 |
+
|
111 |
+
function loadDemoScript() {
|
112 |
+
const demo_script = document.querySelector("#cssscan-demo-script");
|
113 |
+
const demo_loading_warning = document.querySelector(".loading-demo");
|
114 |
+
|
115 |
+
if (!demo_script) {
|
116 |
+
const script = document.createElement("script");
|
117 |
+
script.setAttribute("src", "demo-build/main.js");
|
118 |
+
script.id = "cssscan-demo-script";
|
119 |
+
document.body.appendChild(script);
|
120 |
+
|
121 |
+
script.onload = () => {
|
122 |
+
script.dataset.loaded = true;
|
123 |
+
if (demo_loading_warning && demo_loading_warning.style.display !== "") {
|
124 |
+
window.cssScanReady();
|
125 |
+
try {
|
126 |
+
demo_loading_warning.remove();
|
127 |
+
} catch (e) {}
|
128 |
+
}
|
129 |
+
};
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
if (canRunDemo()) {
|
134 |
+
loadDemoScript();
|
135 |
+
}
|
136 |
+
|
137 |
+
window.onresize = function (e) {
|
138 |
+
const demo_script = document.querySelector("#cssscan-demo-script");
|
139 |
+
|
140 |
+
if (canRunDemo() && (!demo_script || (demo_script && !demo_script.dataset.loaded))) {
|
141 |
+
loadDemoScript();
|
142 |
+
}
|
143 |
+
};
|
144 |
+
|
145 |
+
const demo_btn = document.getElementsByClassName("demo-btn");
|
146 |
+
|
147 |
+
for (var i = 0; i < demo_btn.length; i++) {
|
148 |
+
demo_btn[i].addEventListener("click", function (e) {
|
149 |
+
const demo_script = document.querySelector("#cssscan-demo-script");
|
150 |
+
const demo_loading_warning = document.querySelector(".loading-demo");
|
151 |
+
|
152 |
+
if (demo_script && !demo_script.dataset.loaded) {
|
153 |
+
if (demo_loading_warning && demo_loading_warning.style.display === "") {
|
154 |
+
demo_loading_warning.style.display = "inline-block";
|
155 |
+
}
|
156 |
+
} else if (demo_script && demo_script.dataset.loaded) {
|
157 |
+
try {
|
158 |
+
demo_loading_warning.remove();
|
159 |
+
} catch (e) {}
|
160 |
+
}
|
161 |
+
});
|
162 |
+
}
|
163 |
+
</script>
|
164 |
+
<script src="{% static 'demo.js' %}"></script>
|
165 |
+
<!-- <script src="https://getcssscan.com/demo-build/main.js" id="cssscan-demo-script" data-loaded="true"></script> -->
|
166 |
+
</body>
|
167 |
+
</html>
|