fallaciousreasoning / calibrelibgenstore Goto Github PK
View Code? Open in Web Editor NEWA Libgen Fiction store plugin for Calibre
License: MIT License
A Libgen Fiction store plugin for Calibre
License: MIT License
ModuleNotFoundError: No module named 'urllib2'
Can see the store in Calibre but search doesn't return any titles.
Hi,
I'm glad you worked on this plugin.
Could you please create one for Sci-Tech part of libgen ?
Thanks
Hello,
Don't know if I'm the only one to have this error when loading the plugin but I keep getting this error.
I've also tried to unistall and reinstall it and to package it myself but it doesn't work.
Any idea?
`calibre, version 4.23.0
ERROR: Unhandled exception: InvalidPlugin:The plugin in u'/Users/johndoe/Downloads/CalibreLibgenStore-0.3.zip' is invalid. It does not contain a top-level init.py file
calibre 4.23 embedded-python: True is64bit: True
Darwin-18.7.0-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '18.7.0', 'Darwin Kernel Version 18.7.0: Thu Jun 18 20:50:10 PDT 2020; root:xnu-4903.278.43~1/RELEASE_X86_64')
Python 2.7.16
OSX: ('10.14.6', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: Libgen Fiction (0, 1, 0) && The Eye (0, 1, 0)
Traceback (most recent call last):
File "site-packages/calibre/gui2/preferences/plugins.py", line 317, in add_plugin
File "site-packages/calibre/customize/ui.py", line 472, in add_plugin
File "site-packages/calibre/customize/ui.py", line 61, in load_plugin
File "site-packages/calibre/customize/zipplugin.py", line 194, in load
File "site-packages/calibre/customize/zipplugin.py", line 292, in _locate_code
InvalidPlugin: The plugin in u'/Users/johndoe/Downloads/CalibreLibgenStore-0.3.zip' is invalid. It does not contain a top-level init.py file
`
Thanks
With CalibreLibgenStore 0.4 and Using Calibre 5 running on Docker linux container and also on OSX I get this error when trying to search Libgen.
I get this when navigating Get Books -> Stores -> Libgen Fiction
Previously this has worked by opening up Libgen in an external browser window but now this error results:
Linux:
calibre, version 5.3.0
ERROR: Unhandled exception: <b>AttributeError</b>:'LibgenStore' object has no attribute 'libgen'
calibre 5.3 embedded-python: True is64bit: True
Linux-4.4.59+-x86_64-with-glibc2.2.5 Linux ('64bit', '')
('Linux', '4.4.59+', '#25426 SMP PREEMPT Wed Jul 8 03:21:27 CST 2020')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Libgen Fiction (0, 4, 0)
Traceback (most recent call last):
File "calibre/gui2/actions/store.py", line 131, in open_store
File "calibre_plugins.libgen_fiction.__init__", line 80, in open
else self.libgen.base_url
AttributeError: 'LibgenStore' object has no attribute 'libgen'
OSX:
calibre, version 5.7.2
ERROR: Unhandled exception: <b>AttributeError</b>:'LibgenStore' object has no attribute 'libgen'
calibre 5.7.2 embedded-python: True is64bit: True
macOS-10.15.6-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '19.6.0', 'Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64')
Python 3.8.5
OSX: ('10.15.6', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: Libgen Fiction (0, 4, 0)
Traceback (most recent call last):
File "calibre/gui2/actions/store.py", line 131, in open_store
File "calibre_plugins.libgen_fiction.__init__", line 80, in open
else self.libgen.base_url
AttributeError: 'LibgenStore' object has no attribute 'libgen'
It looks like it's trying to open the browser before initializing the LibgenFiction object attached by calling the genesis()
method. Adding a attribute check before opening the url fixes this (for me at least)
Calibre 5 migrated from Python 2.7 to Python 3. I'm unsure whether this plugin still works.
Just installed your plugin, the search works but the download often goes in timeout
calibre, version 5.34.0 (linux, embedded-python: False)
Failed to download e-book: Failed: Downloading Il lupo della steppa (Italian, 94Kb).epub
Starting job: Downloading Il lupo della steppa (Italian, 94Kb).epub
Job: "Downloading Il lupo della steppa (Italian, 94Kb).epub" failed with error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/mechanize/_urllib2_fork.py", line 1236, in do_open
h.request(str(req.get_method()), str(req.get_selector()), req.data,
File "/usr/lib/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/lib/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/lib/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connessione scaduta
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/threaded_jobs.py", line 83, in start_work
self.result = self.func(*self.args, **self.kwargs)
File "/usr/lib/calibre/calibre/gui2/ebook_download.py", line 85, in __call__
dfilename = self._download(cookie_file, url, filename, save_loc, add_to_lib, create_browser)
File "/usr/lib/calibre/calibre/gui2/ebook_download.py", line 101, in _download
return download_file(url, cookie_file, filename, create_browser=create_browser)
File "/usr/lib/calibre/calibre/gui2/ebook_download.py", line 68, in download_file
with closing(br.open(url)) as r:
File "/usr/lib/python3/dist-packages/mechanize/_mechanize.py", line 257, in open
return self._mech_open(url_or_request, data, timeout=timeout)
File "/usr/lib/python3/dist-packages/mechanize/_mechanize.py", line 287, in _mech_open
response = UserAgentBase.open(self, request, data)
File "/usr/lib/python3/dist-packages/mechanize/_opener.py", line 193, in open
response = urlopen(self, req, data)
File "/usr/lib/python3/dist-packages/mechanize/_urllib2_fork.py", line 425, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3/dist-packages/mechanize/_urllib2_fork.py", line 414, in _call_chain
result = func(*args)
File "/usr/lib/python3/dist-packages/mechanize/_urllib2_fork.py", line 1258, in http_open
return self.do_open(HTTPConnection, req)
File "/usr/lib/python3/dist-packages/mechanize/_urllib2_fork.py", line 1240, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connessione scaduta>
Called with args: (<calibre.gui2.ui.Main object at 0x7f6b2e7ec5e0>, None, 'http://31.42.184.140/fiction/1605000/eb5e708377e7bc317ca62aa1554b1e19.epub/Hesse%2C%20Hermann%20-%20Il%20lupo%20della%20steppa.epub', 'Il lupo della steppa (Italian, 94Kb).epub', '', True, [], <bound method StorePlugin.create_browser of <calibre_plugins.libgen_fiction.LibgenStore object at 0x7f6b2b66feb0>>) {'notifications': <queue.Queue object at 0x7f6b28321a30>, 'abort': <threading.Event object at 0x7f6b22574520>, 'log': <calibre.utils.logging.GUILog object at 0x7f6b22574700>}
I noticed that even in the browser sometimes the download take an incredible amount of time, it's not slow ... the download didn't even start for a few minutes then starts and ends in less than a second.
Can you set an higher timeout or use a configurable parameter?
The plugin isn't currently working for me, and the mirrors in your code are not the same as those in pylibgen
's.
Could you consider adding a minimal configuration UI for at least adding new mirrors without having to redownload or unzip, modify, rezip, and reimport the plugin? Thanks!
It looks like libgen.rs and .is may have changed the format of the data they're outputting slightly, as no results are being found.
I've fiddleed with the parsing of the Title text in the XPATH data, and gotten it to return SOME results, but download seems to be broken as well.
I'm looking for a way to filter results by language and/or format. I've tried the following:
def search(self, query): url = self.base_url query_params = { 'q': query, 'criteria': '', 'language': 'English', 'format': 'epub', }
As well as the following in def parse:
if language != "English": return None
I'm wondering if pagination is the issue as usually the first page of search results for libgen.is at least doesn't have English (or French) results. As you can probably tell, I'm not super familiar with python (much more familiar with Java) and am a beginner programmer. I'll keep trying to work it out on my own and will post the solution if I work it out. As far as I can tell, the first option should work.
I'm consistently getting download fail errors.
Starting job: Downloading War and Peace (English, 1.71Mb).epub
Job: "Downloading War and Peace (English, 1.71Mb).epub" failed with error:
Traceback (most recent call last):
File "calibre/gui2/threaded_jobs.py", line 83, in start_work
File "calibre/gui2/ebook_download.py", line 85, in __call__
File "calibre/gui2/ebook_download.py", line 97, in _download
Exception: No file specified to download.
Called with args: (<calibre.gui2.ui.Main object at 0x1189e0160>, None, None, 'War and Peace (English, 1.71Mb).epub', '', True, [], <bound method StorePlugin.create_browser of <calibre_plugins.libgen_fiction.LibgenStore object at 0x134bdc970>>) {'notifications': <queue.Queue object at 0x134883700>, 'abort': <threading.Event object at 0x134883820>, 'log': <calibre.utils.logging.GUILog object at 0x134883760>}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.