mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix WSJ recipe
This commit is contained in:
parent
5423801c2e
commit
3cf7c5f572
@ -111,7 +111,7 @@ def get_metadata(stream, stream_type='lrf', use_libprs_metadata=False):
|
|||||||
return base
|
return base
|
||||||
|
|
||||||
def get_comic_cover(stream, type):
|
def get_comic_cover(stream, type):
|
||||||
extract_first = zip_extract_first if type == 'zip' else rar_extract_first
|
extract_first = zip_extract_first if type.lower() == 'cbz' else rar_extract_first
|
||||||
ret = extract_first(stream)
|
ret = extract_first(stream)
|
||||||
if ret is not None:
|
if ret is not None:
|
||||||
path, data = ret
|
path, data = ret
|
||||||
|
@ -42,7 +42,7 @@ def extract(filename, dir):
|
|||||||
"""
|
"""
|
||||||
zf = zipfile.ZipFile( filename )
|
zf = zipfile.ZipFile( filename )
|
||||||
zf.extractall(dir)
|
zf.extractall(dir)
|
||||||
|
|
||||||
def extract_member(filename, match=re.compile(r'\.(jpg|jpeg|gif|png)\s*$', re.I)):
|
def extract_member(filename, match=re.compile(r'\.(jpg|jpeg|gif|png)\s*$', re.I)):
|
||||||
zf = zipfile.ZipFile(filename)
|
zf = zipfile.ZipFile(filename)
|
||||||
names = zf.namelist()
|
names = zf.namelist()
|
||||||
|
@ -27,8 +27,8 @@ class WallStreetJournal(BasicNewsRecipe):
|
|||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser()
|
br = BasicNewsRecipe.get_browser()
|
||||||
if self.username is not None and self.password is not None:
|
if self.username is not None and self.password is not None:
|
||||||
br.open('http://online.wsj.com/login')
|
br.open('http://commerce.wsj.com/auth/login')
|
||||||
br.select_form(name='login_form')
|
br.select_form(nr=0)
|
||||||
br['user'] = self.username
|
br['user'] = self.username
|
||||||
br['password'] = self.password
|
br['password'] = self.password
|
||||||
br.submit()
|
br.submit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user