plutopluto

git clone https://git.ce9e.org/plutopluto.git

commit
a59dac605a97b533beea5a8acd3f0cc7c0e51233
parent
9e60a38c6f7be3d62ee659418918378f444b430a
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-07-19 18:28
adapt server to youtube api change

Diffstat

M plutopluto/__init__.py 11 ++++++-----

1 files changed, 6 insertions, 5 deletions


diff --git a/plutopluto/__init__.py b/plutopluto/__init__.py

@@ -48,11 +48,12 @@ def parse(url):
   48    48 		d['title'] = item.get('title')
   49    49 		d['link'] = item.get('link')
   50    50 		d['source'] = feed.feed.get('title')
   51    -1 		if 'gdata.youtube' in url:
   52    -1 			tree = BeautifulSoup(item.get('description'))
   53    -1 			head = tree.find_all('a')[1]
   54    -1 			img = tree.find_all('a')[0]
   55    -1 			d['content'] = strip_atts(unicode(head) + ' ' + unicode(img))
   -1    51 		if 'youtube' in url:
   -1    52 			template = u'<img alt="%s" src="%s" />\n<div>%s</div>'
   -1    53 			d['content'] = strip_atts(template % (
   -1    54 				item['media_content'][0]['url'],
   -1    55 				item['media_thumbnail'][0]['url'],
   -1    56 				item['media_description']))
   56    57 		elif 'content' in item:
   57    58 			d['content'] = strip_atts(item['content'][0]['value'])
   58    59 		else: