mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Update wsj.recipe
This commit is contained in:
parent
185f7b746f
commit
068f310aa3
@ -140,22 +140,22 @@ class WSJ(BasicNewsRecipe):
|
|||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
index = 'https://bartender.mobile.dowjones.io'
|
index = 'https://bartender.mobile.dowjones.io'
|
||||||
catalog = json.loads(self.index_to_soup(index + '/catalogs/v1/wsj/us/catalog.json', raw=True))
|
catalog = json.loads(self.index_to_soup(index + '/catalogs/v1/wsj/us/catalog.json', raw=True))
|
||||||
edit = [itm['key'][10:] for itm in catalog['items'] if itm['type'] == 'ITPNEXTGEN'][1:]
|
edit = [''.join([n for n in itm['key'] if n.isdigit()]) for itm in catalog['items'] if itm['type'] == 'ITP'][1:]
|
||||||
self.log('**Past Editions available :', ', '.join(edit))
|
self.log('**Past Editions available :', ', '.join(edit))
|
||||||
|
|
||||||
past_edition = self.recipe_specific_options.get('date')
|
past_edition = self.recipe_specific_options.get('date')
|
||||||
|
|
||||||
for itm in catalog['items']:
|
for itm in catalog['items']:
|
||||||
if past_edition and isinstance(past_edition, str):
|
if past_edition and isinstance(past_edition, str):
|
||||||
if itm['key'] == 'ITPNEXTGEN' + past_edition:
|
if past_edition in itm['key']:
|
||||||
key = itm['key']
|
key = itm['key']
|
||||||
manifest = itm['manifest']
|
manifest = itm['manifest']
|
||||||
date = itm['date']
|
date = itm['date']
|
||||||
break
|
break
|
||||||
elif itm['type'] == 'ITPNEXTGEN':
|
elif itm['type'] == 'TODAYSPAPER':
|
||||||
key = itm['key']
|
key = itm['key']
|
||||||
manifest = itm['manifest']
|
manifest = itm['manifest']
|
||||||
date = itm['date']
|
date = itm['updated']
|
||||||
break
|
break
|
||||||
|
|
||||||
dt = datetime.fromisoformat(date[:-1]) + timedelta(seconds=time.timezone)
|
dt = datetime.fromisoformat(date[:-1]) + timedelta(seconds=time.timezone)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user