Skip to content

Commit

Permalink
PLAT-10319
Browse files Browse the repository at this point in the history
  • Loading branch information
kalturaguy committed Nov 20, 2019
1 parent c081a07 commit 61a2974
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions liveRecorder/Tasks/ConcatinationTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import m3u8

Flavor = collections.namedtuple('Flavor', 'url language bandwidth')
Flavor = collections.namedtuple('Flavor', 'url language bandwidth audio_language_track')

from Iso639Wrapper import Iso639Wrapper

Expand Down Expand Up @@ -64,7 +64,8 @@ def extract_flavor_dict(self):
flavors_list.append(Flavor(
url=element.absolute_uri,
bandwidth=element.stream_info.bandwidth,
language='und'
language='und',
audio_language_track=False
))

for element in m3u8_obj.media:
Expand All @@ -74,8 +75,9 @@ def extract_flavor_dict(self):
language = self.iso639_wrapper.convert_language_to_iso639_3(unicode(language))
flavors_list.append(Flavor(
url=element.absolute_uri,
bandwidth=element.stream_info.bandwidth,
language=language
bandwidth=10000000, #this is so this track will be first
language=language,
audio_language_track=True
))
return flavors_list

Expand Down Expand Up @@ -140,6 +142,9 @@ def run(self):
flavors_list.sort(key=lambda flavor: flavor.bandwidth, reverse=True)

for obj in flavors_list:
if obj.audio_language_track and self.entry_config["upload_only_source"]:
continue

url_postfix = obj.url.rsplit('/', 1)[1]
flavor_id = self.get_flavor_id(url_postfix)
if flavor_id is None:
Expand Down

0 comments on commit 61a2974

Please sign in to comment.