-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding:utf-8 -*- | ||
from urlopener import UrlOpener as Browser | ||
WebEngineBrowser = Browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding:utf-8 -*- | ||
# License: GPL v3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net> | ||
#使用urlopener模拟calibre的qt WebEngineBrowser | ||
def read_url(storage, url, timeout=60, as_html=True): | ||
from urlopener import UrlOpener | ||
raw_bytes = UrlOpener().open_novisit(url, timeout=timeout).read() | ||
if not as_html: | ||
return raw_bytes | ||
from calibre.ebooks.chardet import xml_to_unicode | ||
return xml_to_unicode(raw_bytes, strip_encoding_pats=True)[0] | ||
|
||
def cleanup_overseers(): | ||
return lambda : 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters