2 from archive.tasks import AudioFormatTask
3 from .models import YouTube
6 class YouTubeTask(AudioFormatTask):
10 def encode(self, in_paths, out_path):
11 self.audiobook.project.youtube.prepare_file(in_paths, out_path)
13 def set_tags(self, audiobook, filename):
17 def save(cls, audiobook, file_name):
18 """We do not save the video files."""
21 def put(self, user, audiobook, filename):
22 audiobook.project.youtube.publish(audiobook, filename)
24 def get_source_file_paths(self, audiobook):
25 if not audiobook.youtube_volume:
26 return [audiobook.source_file.path]
29 for a in type(audiobook)
31 slug=audiobook.slug, youtube_volume=audiobook.youtube_volume