Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
Overview
Overview
Details
Activity
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
edx
edx-val
Commits
135b2573
Commit
135b2573
authored
Jan 31, 2018
by
Tyler Hallada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't download youtube video encodings
parent
9c73b88c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
edxval/api.py
+3
-8
No files found.
edxval/api.py
View file @
135b2573
...
@@ -795,22 +795,17 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir=
...
@@ -795,22 +795,17 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir=
}
}
)
)
for
encoded_video
in
video
.
encoded_videos
.
all
():
for
encoded_video
in
video
.
encoded_videos
.
all
():
if
video_download_dir
and
resource_fs
:
attributes
=
{
attributes
=
{
name
:
unicode
(
getattr
(
encoded_video
,
name
))
name
:
unicode
(
getattr
(
encoded_video
,
name
))
for
name
in
[
'profile
'
,
'file_size'
,
'bitrate'
]
for
name
in
[
'profile'
,
'url
'
,
'file_size'
,
'bitrate'
]
}
}
video_url
=
unicode
(
getattr
(
encoded_video
,
'url'
))
if
video_download_dir
and
resource_fs
and
unicode
(
encoded_video
.
profile
)
!=
u'youtube'
:
video_url
=
unicode
(
encoded_video
.
url
)
exported_url
=
'{}/{}'
.
format
(
video_download_dir
,
video_url
.
split
(
'/'
)[
-
1
])
exported_url
=
'{}/{}'
.
format
(
video_download_dir
,
video_url
.
split
(
'/'
)[
-
1
])
resp
=
urllib2
.
urlopen
(
video_url
)
resp
=
urllib2
.
urlopen
(
video_url
)
with
resource_fs
.
open
(
exported_url
,
'wb'
)
as
f
:
with
resource_fs
.
open
(
exported_url
,
'wb'
)
as
f
:
f
.
write
(
resp
.
read
())
f
.
write
(
resp
.
read
())
attributes
[
'url'
]
=
exported_url
attributes
[
'url'
]
=
exported_url
else
:
attributes
=
{
name
:
unicode
(
getattr
(
encoded_video
,
name
))
for
name
in
[
'profile'
,
'url'
,
'file_size'
,
'bitrate'
]
}
SubElement
(
SubElement
(
video_el
,
video_el
,
'encoded_video'
,
'encoded_video'
,
...
...
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