Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_list_stream_videos(self):
return Video.objects.filter(
courses__course_id=self.location.course_key,
courses__is_hidden=False,
status__in=["file_complete", "file_encrypted"]
).order_by('-created', 'edx_video_id')
def get_captions_and_video_info(self, data, suffix=''):
edx_video_id = data.get('edx_video_id')
try:
video = Video.objects.get(edx_video_id=edx_video_id)
except Video.DoesNotExist:
asset = None
else:
media_service = get_media_service_client(self.location.org)
asset = media_service.get_input_asset_by_video_id(edx_video_id, 'ENCODED')
error_message = _("Target Video is no longer available on Azure or is corrupted in some way.")
captions = []
video_info = {}
asset_files = None
if asset:
locator_on_demand = media_service.get_asset_locators(asset['Id'], LocatorTypes.OnDemandOrigin)
locator_sas = media_service.get_asset_locators(asset['Id'], LocatorTypes.SAS)
if locator_on_demand:
error_message = ''
def get_captions_and_video_info(self, data, suffix=''):
edx_video_id = data.get('edx_video_id')
try:
video = Video.objects.get(edx_video_id=edx_video_id)
except Video.DoesNotExist:
asset = None
else:
media_service = get_media_service_client(self.location.org)
asset = media_service.get_input_asset_by_video_id(edx_video_id, 'ENCODED')
error_message = _("Target Video is no longer available on Azure or is corrupted in some way.")
captions = []
video_info = {}
asset_files = None
if asset:
locator_on_demand = media_service.get_asset_locators(asset['Id'], LocatorTypes.OnDemandOrigin)
locator_sas = media_service.get_asset_locators(asset['Id'], LocatorTypes.SAS)
if locator_on_demand: