diff --git a/couchpotato/core/plugins/trailer/__init__.py b/couchpotato/core/plugins/trailer/__init__.py index e4c51bd1..d8496b30 100644 --- a/couchpotato/core/plugins/trailer/__init__.py +++ b/couchpotato/core/plugins/trailer/__init__.py @@ -29,7 +29,7 @@ config = [{ 'label': 'Naming', 'default': '-trailer', 'advanced': True, - 'description': 'Use to use above settings.' + 'description': 'Use <filename> to use above settings.' }, ], }, diff --git a/couchpotato/core/plugins/trailer/main.py b/couchpotato/core/plugins/trailer/main.py index 4ab51e78..1a8955fb 100644 --- a/couchpotato/core/plugins/trailer/main.py +++ b/couchpotato/core/plugins/trailer/main.py @@ -22,10 +22,15 @@ class Trailer(Plugin): return False for trailer in trailers.get(self.conf('quality'), []): - filename = self.conf('name').replace('', group['filename']) + ('.%s' % getExt(trailer)) + + ext = getExt(trailer) + filename = self.conf('name').replace('', group['filename']) + ('.%s' % ('mp4' if len(ext) > 5 else ext)) destination = os.path.join(group['destination_dir'], filename) if not os.path.isfile(destination): - fireEvent('file.download', url = trailer, dest = destination, urlopen_kwargs = {'headers': {'User-Agent': 'Quicktime'}}, single = True) + trailer_file = fireEvent('file.download', url = trailer, dest = destination, urlopen_kwargs = {'headers': {'User-Agent': 'Quicktime'}}, single = True) + if os.path.getsize(trailer_file) < (1024 * 1024): # Don't trust small trailers (1MB), try next one + os.unlink(trailer_file) + continue else: log.debug('Trailer already exists: %s', destination)