plutopluto

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

commit
d647a2feab5a08e2d9062312910d6711e663f411
parent
7cf6eb1b1063ef402cb23e1cdd81052f96e9889c
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-10-23 19:11
generate less parsing errors

Diffstat

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

1 files changed, 6 insertions, 6 deletions


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

@@ -41,17 +41,17 @@ def parse(url):
   41    41 		d = dict()
   42    42 		d['dt'] = (mktime(item['published_parsed']) if 'published_parsed' in item
   43    43 			else int(time()))
   44    -1 		d['id'] = item['id']
   45    -1 		d['title'] = item['title']
   46    -1 		d['link'] = item['link']
   47    -1 		d['source'] = feed.feed['title']
   -1    44 		d['id'] = item.get('id')
   -1    45 		d['title'] = item.get('title')
   -1    46 		d['link'] = item.get('link')
   -1    47 		d['source'] = feed.feed.get('title')
   48    48 		if 'gdata.youtube' in url:
   49    -1 			tree = BeautifulSoup(item['description'])
   -1    49 			tree = BeautifulSoup(item.get('description'))
   50    50 			head = tree.find_all('a')[1]
   51    51 			img = tree.find_all('a')[0]
   52    52 			d['content'] = strip_atts(unicode(head) + ' ' + unicode(img))
   53    53 		else:
   54    -1 			d['content'] = strip_atts(item['description'])
   -1    54 			d['content'] = strip_atts(item.get('description'))
   55    55 		return d
   56    56 
   57    57 	return {