mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #2823 (Medata from Filename) and add subtitles to Economist recipe
This commit is contained in:
parent
ee2fea02b6
commit
ece4adfab9
@ -127,7 +127,7 @@ def metadata_from_filename(name, pat=None):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
au = match.group('authors')
|
au = match.group('author')
|
||||||
aus = string_to_authors(au)
|
aus = string_to_authors(au)
|
||||||
mi.authors = aus
|
mi.authors = aus
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
@ -113,7 +113,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<item row="1" column="1" colspan="2" >
|
<item row="1" column="1" colspan="2" >
|
||||||
<widget class="QLineEdit" name="authors" >
|
<widget class="QLineEdit" name="authors" >
|
||||||
<property name="toolTip" >
|
<property name="toolTip" >
|
||||||
<string>Regular expression (?P<authors>)</string>
|
<string>Regular expression (?P<author>)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>No match</string>
|
<string>No match</string>
|
||||||
|
@ -63,6 +63,11 @@ class Economist(BasicNewsRecipe):
|
|||||||
url=a['href'].replace('displaystory', 'PrinterFriendly')
|
url=a['href'].replace('displaystory', 'PrinterFriendly')
|
||||||
if url.startswith('/'):
|
if url.startswith('/'):
|
||||||
url = 'http://www.economist.com' + url
|
url = 'http://www.economist.com' + url
|
||||||
|
try:
|
||||||
|
subtitle = tag.previousSibling.contents[0].contents[0]
|
||||||
|
text = subtitle + ': ' + text
|
||||||
|
except:
|
||||||
|
pass
|
||||||
article = dict(title=text,
|
article = dict(title=text,
|
||||||
url = url,
|
url = url,
|
||||||
description='', content='', date='')
|
description='', content='', date='')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user