mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
...
This commit is contained in:
parent
7336a7a91d
commit
656f0e967e
@ -277,6 +277,8 @@ class Economist(BasicNewsRecipe):
|
|||||||
if d and isinstance(d, str):
|
if d and isinstance(d, str):
|
||||||
if d.lower().strip() == 'yes':
|
if d.lower().strip() == 'yes':
|
||||||
self.from_archive = False
|
self.from_archive = False
|
||||||
|
elif d.lower().strip() == 'no':
|
||||||
|
self.from_archive = True
|
||||||
|
|
||||||
needs_subscription = False
|
needs_subscription = False
|
||||||
|
|
||||||
@ -376,7 +378,7 @@ class Economist(BasicNewsRecipe):
|
|||||||
# data = json.loads(raw)['data']['section']
|
# data = json.loads(raw)['data']['section']
|
||||||
# else:
|
# else:
|
||||||
# data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
# data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
||||||
data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
data = json.loads(raw)['data']['section']
|
||||||
dt = datetime.fromisoformat(data['datePublished'][:-1]) + timedelta(seconds=time.timezone)
|
dt = datetime.fromisoformat(data['datePublished'][:-1]) + timedelta(seconds=time.timezone)
|
||||||
dt = dt.strftime('%b %d, %Y')
|
dt = dt.strftime('%b %d, %Y')
|
||||||
self.timefmt = ' [' + dt + ']'
|
self.timefmt = ' [' + dt + ']'
|
||||||
|
@ -277,6 +277,8 @@ class Economist(BasicNewsRecipe):
|
|||||||
if d and isinstance(d, str):
|
if d and isinstance(d, str):
|
||||||
if d.lower().strip() == 'yes':
|
if d.lower().strip() == 'yes':
|
||||||
self.from_archive = False
|
self.from_archive = False
|
||||||
|
elif d.lower().strip() == 'no':
|
||||||
|
self.from_archive = True
|
||||||
|
|
||||||
needs_subscription = False
|
needs_subscription = False
|
||||||
|
|
||||||
@ -376,7 +378,7 @@ class Economist(BasicNewsRecipe):
|
|||||||
# data = json.loads(raw)['data']['section']
|
# data = json.loads(raw)['data']['section']
|
||||||
# else:
|
# else:
|
||||||
# data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
# data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
||||||
data = json.loads(raw)['data']['canonical']['hasPart']['parts'][0]
|
data = json.loads(raw)['data']['section']
|
||||||
dt = datetime.fromisoformat(data['datePublished'][:-1]) + timedelta(seconds=time.timezone)
|
dt = datetime.fromisoformat(data['datePublished'][:-1]) + timedelta(seconds=time.timezone)
|
||||||
dt = dt.strftime('%b %d, %Y')
|
dt = dt.strftime('%b %d, %Y')
|
||||||
self.timefmt = ' [' + dt + ']'
|
self.timefmt = ' [' + dt + ']'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user