From 45890416c94d42cb1ab2650f86492c9ae38e568e Mon Sep 17 00:00:00 2001 From: Thomas Gideon Date: Sat, 7 Jun 2014 17:44:05 -0400 Subject: [PATCH] Trim description to allowed length. --- append.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/append.py b/append.py index 09d2eac..5dbaa2b 100755 --- a/append.py +++ b/append.py @@ -128,6 +128,8 @@ def __append_itunes(config, entry, output, suffix, base_url): description = __description(config, entry.content) soup = BeautifulSoup(description) summary = '\n\n'.join([''.join(p.findAll(text=True)) for p in soup.findAll('p')]) + if len(summary) > 4000: + summary = summary[:4000] (url, mime_type, size) = __enclosure(config, entry.enclosures, base_url, suffix) if size == 0: raise Exception('Couldn not find media, %s.' % (url))