mirror of
https://github.com/taroved/pol
synced 2025-05-21 08:30:24 -07:00
remove try catch
This commit is contained in:
parent
ed50a76498
commit
27de6c7363
5
feed.py
5
feed.py
@ -31,7 +31,6 @@ def save_post(conn, created, feed_id, post_fields):
|
||||
print(cur._last_executed)
|
||||
|
||||
def fill_time(feed_id, items):
|
||||
try:
|
||||
if not items:
|
||||
return []
|
||||
for item in items:
|
||||
@ -69,8 +68,6 @@ def fill_time(feed_id, items):
|
||||
item['time'] = cur_time
|
||||
save_post(db, cur_time, feed_id, item)
|
||||
cur_time -= datetime.timedelta(minutes=POST_TIME_DISTANCE)
|
||||
except Exception as ex:
|
||||
sys.stderr.write('\n'.join([str(datetime.datetime.now()), "Feed exception:" +str(ex)]))
|
||||
|
||||
|
||||
def decode(text, encoding): # it's strange but true
|
||||
@ -90,7 +87,7 @@ def element_to_unicode(element, encoding):
|
||||
|
||||
def _build_link(html, doc_url, url):
|
||||
base_url = w3lib.html.get_base_url(html, doc_url)
|
||||
return w3lib.url.urljoin_rfc(base_url, url)
|
||||
return w3lib.url.urljoin_rfc(base_url, url).decode('utf-8')
|
||||
|
||||
def buildFeed(response, feed_config):
|
||||
response.selector.remove_namespaces()
|
||||
|
Loading…
x
Reference in New Issue
Block a user