diff --git a/recipes/liberation.recipe b/recipes/liberation.recipe index cf404710f8..ce6f7e8c62 100644 --- a/recipes/liberation.recipe +++ b/recipes/liberation.recipe @@ -2,14 +2,15 @@ liberation.fr ''' -import json, base64, time, locale - -from mechanize import Request +import base64 +import json +import time from datetime import datetime, timedelta -from urllib.parse import quote, urlparse, urlencode +from urllib.parse import quote, urlencode, urlparse from calibre import browser from calibre.web.feeds.news import BasicNewsRecipe +from mechanize import Request def resize(x): @@ -24,7 +25,6 @@ def json_to_html(raw): sub = '
' + data['subheadlines']['basic'] + '
' auth = '{}
\n' - locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') dt = datetime.fromisoformat(data['last_updated_date'][:-1]) + timedelta(seconds=time.timezone) dt = dt.strftime('%b %d, %Y, %H:%M') a = [x['name'] for x in data['credits']['by']] @@ -34,7 +34,7 @@ def json_to_html(raw): auth = auth.format(dt) lede = '' - if data['promo_items']['basic'].get('type', '') == 'image': + if data['promo_items']['basic'].get('type', '') == 'image': lede = '