0c3298a6959436df816f26dfcf4d6f91ce1ba0f1
[audio.git] / src / youtube / tasks.py
1 from archive.tasks import AudioFormatTask
2 from .models import YouTube
3
4
5 class YouTubeTask(AudioFormatTask):
6     ext = 'mkv'
7     prefix = 'youtube'
8
9     def encode(self, in_path, out_path):
10         YouTube.objects.first().prepare_file(in_path, out_path)
11
12     def set_tags(self, audiobook, filename):
13         pass
14
15     @classmethod
16     def save(cls, audiobook, file_name):
17         """We do not save the video files."""
18         pass
19
20     def put(self, user, audiobook, filename):
21         YouTube.objects.first().publish(audiobook, filename)