Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cp_video_dokku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Dzehil
cp_video_dokku
Commits
1853625e
Commit
1853625e
authored
Mar 28, 2023
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add generate video thumbnail
parent
5ee715e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
utils.cpython-39.pyc
apps/core/__pycache__/utils.cpython-39.pyc
+0
-0
tasks.py
apps/core/tasks.py
+7
-1
No files found.
apps/core/__pycache__/utils.cpython-39.pyc
View file @
1853625e
No preview for this file type
apps/core/tasks.py
View file @
1853625e
...
@@ -5,7 +5,7 @@ from django.conf import settings
...
@@ -5,7 +5,7 @@ from django.conf import settings
from
.models
import
Video
,
READY
,
FAIL
from
.models
import
Video
,
READY
,
FAIL
from
.s3_uploader
import
upload_file
from
.s3_uploader
import
upload_file
from
.utils
import
add_video_to_playlist
from
.utils
import
add_video_to_playlist
,
generate_thumbnail
from
cp_video.celery
import
app
from
cp_video.celery
import
app
from
cp_video.utils
import
asset_upload
from
cp_video.utils
import
asset_upload
...
@@ -27,6 +27,12 @@ def send_video_to_s3(video_id=None):
...
@@ -27,6 +27,12 @@ def send_video_to_s3(video_id=None):
response
=
requests
.
get
(
file_path
)
response
=
requests
.
get
(
file_path
)
content
=
response
.
content
content
=
response
.
content
try
:
local_video
.
thumbnail
=
generate_thumbnail
(
file_path
,
video_name
)
except
Exception
as
e
:
log
.
error
(
e
)
log
.
info
(
'Thumbnail generation failed!'
)
local_video
.
s3_file
=
upload_file
(
content
,
key
,
'video/mp4'
)
local_video
.
s3_file
=
upload_file
(
content
,
key
,
'video/mp4'
)
local_video
.
status
=
READY
local_video
.
status
=
READY
local_video
.
local_file
=
None
local_video
.
local_file
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment