mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
68e3787076
@ -140,20 +140,18 @@ class WSJ(BasicNewsRecipe):
|
||||
def parse_index(self):
|
||||
index = 'https://bartender.mobile.dowjones.io'
|
||||
catalog = json.loads(self.index_to_soup(index + '/catalogs/v1/wsj/us/catalog.json', raw=True))
|
||||
edit = [''.join([n for n in itm['key'] if n.isdigit()]) 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))
|
||||
|
||||
past_edition = self.recipe_specific_options.get('date')
|
||||
|
||||
for itm in catalog['items']:
|
||||
if past_edition and isinstance(past_edition, str):
|
||||
if itm['key'] == 'ITPNEXTGEN' + past_edition:
|
||||
key = itm['key']
|
||||
if past_edition in itm['key']:
|
||||
manifest = itm['manifest']
|
||||
date = itm['date']
|
||||
break
|
||||
elif itm['type'] == 'ITPNEXTGEN':
|
||||
key = itm['key']
|
||||
elif itm['type'] == 'ITP':
|
||||
manifest = itm['manifest']
|
||||
date = itm['date']
|
||||
break
|
||||
@ -183,7 +181,7 @@ class WSJ(BasicNewsRecipe):
|
||||
for art in data:
|
||||
title = data[art]['headline']
|
||||
desc = data[art]['summary']
|
||||
url = index + '/contents/v1/wsj/us/' + key + '/' + data[art]['filename']
|
||||
url = index + manifest.rsplit('/', 1)[0] + '/' + data[art]['filename']
|
||||
self.log(' ', title, '\n\t', desc)
|
||||
articles.append({'title': title, 'description':desc, 'url': url})
|
||||
feeds.append((section, articles))
|
||||
|
@ -111,7 +111,6 @@ class WSJ(BasicNewsRecipe):
|
||||
for itm in catalog['items']:
|
||||
if itm['type'] == 'MAG':
|
||||
date = itm['date']
|
||||
key = itm['key']
|
||||
manifest = itm['manifest']
|
||||
self.title = 'WSJ. Magazine: ' + itm['label']
|
||||
|
||||
@ -140,14 +139,14 @@ class WSJ(BasicNewsRecipe):
|
||||
for art in data:
|
||||
title = data[art]['headline']
|
||||
desc = data[art]['summary']
|
||||
url = index + '/contents/v1/wsj/us/' + key + '/' + data[art]['filename']
|
||||
url = index + manifest.rsplit('/', 1)[0] + '/' + data[art]['filename']
|
||||
self.log(' ', title, '\n\t', desc)
|
||||
articles.append({'title': title, 'description':desc, 'url': url})
|
||||
data = sec_parse['decos']
|
||||
for art in data:
|
||||
title = data[art]['headline']
|
||||
desc = data[art]['summary']
|
||||
url = index + '/contents/v1/wsj/us/' + key + '/' + data[art]['filename']
|
||||
url = index + manifest.rsplit('/', 1)[0] + '/' + data[art]['filename']
|
||||
self.log(' ', title, '\n\t', desc)
|
||||
articles.append({'title': title, 'description':desc, 'url': url})
|
||||
feeds.append((section, articles))
|
||||
|
@ -150,7 +150,6 @@ class WSJ(BasicNewsRecipe):
|
||||
catalog = json.loads(self.index_to_soup(index + '/catalogs/v1/wsj/us/catalog.json', raw=True))
|
||||
for itm in catalog['items']:
|
||||
if itm['key'] == 'NOW':
|
||||
key = itm['key']
|
||||
manifest = itm['manifest']
|
||||
break
|
||||
|
||||
@ -177,7 +176,7 @@ class WSJ(BasicNewsRecipe):
|
||||
continue
|
||||
title = data[art]['headline']
|
||||
desc = data[art]['summary']
|
||||
url = index + '/contents/v1/wsj/us/' + key + '/' + data[art]['filename']
|
||||
url = index + manifest.rsplit('/', 1)[0] + '/' + data[art]['filename']
|
||||
self.log(' ', title, '\n\t', desc)
|
||||
articles.append({'title': title, 'description':desc, 'url': url})
|
||||
feeds.append((section, articles))
|
||||
|
Loading…
x
Reference in New Issue
Block a user