Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DobyTang/LazyLibrarian
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.6.0
Choose a base ref
...
head repository: DobyTang/LazyLibrarian
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 17,593 additions and 4,768 deletions.
  1. +46 −11 LazyLibrarian.py
  2. +4 −77 README.md
  3. +1 −0 data/css/summernote.css
  4. BIN data/images/ll.png
  5. BIN data/images/ll128.png
  6. BIN data/images/ll16.png
  7. BIN data/images/ll192.png
  8. BIN data/images/ll256.png
  9. BIN data/images/ll32.png
  10. BIN data/images/ll48.png
  11. BIN data/images/ll512.png
  12. BIN data/images/ll64.png
  13. +10 −12 data/images/manifest.json
  14. +44 −32 data/interfaces/bookstrap/audio.html
  15. +68 −35 data/interfaces/bookstrap/author.html
  16. +115 −42 data/interfaces/bookstrap/base.html
  17. +53 −35 data/interfaces/bookstrap/books.html
  18. +12 −3 data/interfaces/bookstrap/choosetype.html
  19. +985 −535 data/interfaces/bookstrap/config.html
  20. +49 −0 data/interfaces/bookstrap/dlresult.html
  21. +110 −95 data/interfaces/bookstrap/editbook.html
  22. +72 −17 data/interfaces/bookstrap/history.html
  23. +48 −19 data/interfaces/bookstrap/index.html
  24. +16 −13 data/interfaces/bookstrap/issues.html
  25. +6 −6 data/interfaces/bookstrap/logs.html
  26. +26 −26 data/interfaces/bookstrap/magazines.html
  27. +109 −27 data/interfaces/bookstrap/managebooks.html
  28. +4 −2 data/interfaces/bookstrap/manageissues.html
  29. +11 −3 data/interfaces/bookstrap/manualsearch.html
  30. +7 −2 data/interfaces/bookstrap/members.html
  31. +52 −0 data/interfaces/bookstrap/opds.html
  32. +6 −2 data/interfaces/bookstrap/profile.html
  33. +8 −2 data/interfaces/bookstrap/searchresults.html
  34. +24 −14 data/interfaces/bookstrap/series.html
  35. +21 −12 data/interfaces/bookstrap/users.html
  36. +5 −5 data/interfaces/legacy/base.html
  37. +96 −6 data/interfaces/legacy/config.html
  38. +2 −2 data/interfaces/legacy/managebooks.html
  39. +7,278 −0 data/js/summernote.js
  40. +11 −0 data/opensearch.template
  41. +46 −0 epubandmobi.py
  42. +19 −0 example_ebook_convert.py
  43. +162 −0 example_preprocessor.py
  44. +26 −10 init/freebsd.initd
  45. +10 −0 init/lazylibrarian.desktop
  46. +3 −0 init/lazylibrarian.sh
  47. +203 −73 lazylibrarian/__init__.py
  48. +178 −96 lazylibrarian/api.py
  49. +382 −141 lazylibrarian/bookrename.py
  50. +239 −42 lazylibrarian/bookwork.py
  51. +77 −17 lazylibrarian/cache.py
  52. +21 −51 lazylibrarian/calibre.py
  53. +331 −113 lazylibrarian/common.py
  54. +65 −29 lazylibrarian/csvfile.py
  55. +72 −63 lazylibrarian/database.py
  56. +362 −65 lazylibrarian/dbupgrade.py
  57. +117 −60 lazylibrarian/deluge.py
  58. +5 −2 lazylibrarian/directparser.py
  59. +217 −142 lazylibrarian/downloadmethods.py
  60. +101 −20 lazylibrarian/formatter.py
  61. +105 −93 lazylibrarian/gb.py
  62. +333 −151 lazylibrarian/gr.py
  63. +142 −68 lazylibrarian/grsync.py
  64. +81 −24 lazylibrarian/images.py
  65. +33 −26 lazylibrarian/importer.py
  66. +148 −97 lazylibrarian/librarysync.py
  67. +24 −30 lazylibrarian/magazinescan.py
  68. +9 −3 lazylibrarian/manualbook.py
  69. +1 −0 lazylibrarian/notifiers/androidpn.py
  70. +1 −0 lazylibrarian/notifiers/boxcar.py
  71. +15 −17 lazylibrarian/notifiers/custom_notify.py
  72. +10 −1 lazylibrarian/notifiers/email_notify.py
  73. +1 −0 lazylibrarian/notifiers/pushbullet2.py
  74. +6 −3 lazylibrarian/notifiers/slack.py
  75. +1 −0 lazylibrarian/notifiers/telegram.py
  76. +3 −5 lazylibrarian/notifiers/tweet.py
  77. +33 −25 lazylibrarian/nzbget.py
  78. +1,340 −0 lazylibrarian/opds.py
  79. +582 −375 lazylibrarian/postprocess.py
  80. +233 −67 lazylibrarian/providers.py
  81. +70 −52 lazylibrarian/qbittorrent.py
  82. +90 −46 lazylibrarian/resultlist.py
  83. +5 −6 lazylibrarian/rssfeed.py
  84. +54 −42 lazylibrarian/rtorrent.py
  85. +25 −16 lazylibrarian/sabnzbd.py
  86. +133 −94 lazylibrarian/searchbook.py
  87. +45 −35 lazylibrarian/searchmag.py
  88. +177 −25 lazylibrarian/searchrss.py
  89. +71 −13 lazylibrarian/synology.py
  90. +45 −21 lazylibrarian/torrentparser.py
  91. +112 −54 lazylibrarian/transmission.py
  92. +24 −5 lazylibrarian/utorrent.py
  93. +84 −39 lazylibrarian/versioncheck.py
  94. +1,224 −810 lazylibrarian/webServe.py
  95. +73 −3 lazylibrarian/webStart.py
  96. +2 −1 lib/deluge_client/client.py
  97. +207 −349 lib/oauth2/__init__.py
  98. +0 −48 lib/oauth2/_compat.py
  99. +0 −19 lib/oauth2/_version.py
  100. 0 lib/oauth2/clients/__init__.py
  101. +0 −40 lib/oauth2/clients/imap.py
  102. +0 −41 lib/oauth2/clients/smtp.py
  103. +5 −0 lib/oauth2/lazylibrarian.note
  104. +1 −0 lib/pythontwitter/__init__.py
  105. +17 −0 lib/tinytag.note
  106. +93 −65 lib/tinytag.py
57 changes: 46 additions & 11 deletions LazyLibrarian.py
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
import sys
import threading
import time
import shutil

import lazylibrarian
from lazylibrarian import webStart, logger, versioncheck, dbupgrade
@@ -113,7 +114,7 @@ def main():
# This is the "emergency recovery" update in case lazylibrarian won't start.
# Set up some dummy values for the update as we have not read the config file yet
lazylibrarian.CONFIG['GIT_PROGRAM'] = ''
lazylibrarian.CONFIG['GIT_USER'] = 'dobytang'
lazylibrarian.CONFIG['GIT_USER'] = 'lazylibrarian'
lazylibrarian.CONFIG['GIT_REPO'] = 'lazylibrarian'
lazylibrarian.CONFIG['LOGLIMIT'] = 2000
versioncheck.getInstallType()
@@ -165,32 +166,62 @@ def main():
# There is no point putting in any logging above this line, as its not set till after initialize.
lazylibrarian.initialize()

# Set the install type (win,git,source) &
# check the version when the application starts
versioncheck.checkForUpdates()

logger.debug('Current Version [%s] - Latest remote version [%s] - Install type [%s]' % (
lazylibrarian.CONFIG['CURRENT_VERSION'], lazylibrarian.CONFIG['LATEST_VERSION'],
lazylibrarian.CONFIG['INSTALL_TYPE']))

if lazylibrarian.CONFIG['VERSIONCHECK_INTERVAL'] == 0:
logger.debug('Automatic update checks are disabled')
# pretend we're up to date so we don't keep warning the user
# version check button will still override this if you want to
lazylibrarian.CONFIG['LATEST_VERSION'] = lazylibrarian.CONFIG['CURRENT_VERSION']
lazylibrarian.CONFIG['COMMITS_BEHIND'] = 0
else:
# Set the install type (win,git,source) &
# check the version when the application starts
versioncheck.checkForUpdates()

logger.debug('Current Version [%s] - Latest remote version [%s] - Install type [%s]' % (
lazylibrarian.CONFIG['CURRENT_VERSION'], lazylibrarian.CONFIG['LATEST_VERSION'],
lazylibrarian.CONFIG['INSTALL_TYPE']))

if check_int(lazylibrarian.CONFIG['GIT_UPDATED'], 0) == 0:
if lazylibrarian.CONFIG['CURRENT_VERSION'] == lazylibrarian.CONFIG['LATEST_VERSION']:
if lazylibrarian.CONFIG['INSTALL_TYPE'] == 'git' and lazylibrarian.CONFIG['COMMITS_BEHIND'] == 0:
lazylibrarian.CONFIG['GIT_UPDATED'] = str(int(time.time()))
logger.debug('Setting update timestamp to now')

version_file = os.path.join(lazylibrarian.PROG_DIR, 'version.txt')
# flatpak insists on PROG_DIR being read-only so we have to move version.txt into CACHEDIR
old_file = os.path.join(lazylibrarian.PROG_DIR, 'version.txt')
version_file = os.path.join(lazylibrarian.CACHEDIR, 'version.txt')
if os.path.isfile(old_file):
if not os.path.isfile(version_file):
try:
with open(old_file, 'r') as s:
with open(version_file, 'w') as d:
d.write(s.read())
except OSError:
logger.warn("Unable to copy version.txt")
try:
os.remove(old_file)
except OSError:
pass

# for dockers that haven't updated correctly from github to gitlab, force source install
if lazylibrarian.CONFIG['CURRENT_VERSION'] != lazylibrarian.CONFIG['LATEST_VERSION']:
if lazylibrarian.CONFIG['INSTALL_TYPE'] == 'git' and lazylibrarian.CONFIG['COMMITS_BEHIND'] == 0:
if os.path.exists('/app/lazylibrarian/.git'):
os.remove(version_file)
shutil.rmtree('/app/lazylibrarian/.git')
lazylibrarian.CONFIG['INSTALL_TYPE'] = 'source'
lazylibrarian.CONFIG['GIT_USER'] = 'LazyLibrarian'
lazylibrarian.CONFIG['GIT_HOST'] = 'gitlab.com'
lazylibrarian.CONFIG['GITLAB_TOKEN'] = 'gitlab+deploy-token-26212:Hbo3d8rfZmSx4hL1Fdms@gitlab.com'
lazylibrarian.config_write('Git')

if not os.path.isfile(version_file) and lazylibrarian.CONFIG['INSTALL_TYPE'] == 'source':
# User may be running an old source zip, so force update
# User may be running an old source zip, so try to force update
lazylibrarian.CONFIG['COMMITS_BEHIND'] = 1
lazylibrarian.SIGNAL = 'update'
# but only once in case the update fails, don't loop
with open(version_file, 'w') as f:
f.write("UNKNOWN SOURCE")

if lazylibrarian.CONFIG['COMMITS_BEHIND'] <= 0 and lazylibrarian.SIGNAL == 'update':
lazylibrarian.SIGNAL = None
@@ -222,6 +253,10 @@ def main():
'https_enabled': lazylibrarian.CONFIG['HTTPS_ENABLED'],
'https_cert': lazylibrarian.CONFIG['HTTPS_CERT'],
'https_key': lazylibrarian.CONFIG['HTTPS_KEY'],
'opds_enabled': lazylibrarian.CONFIG['OPDS_ENABLED'],
'opds_authentication': lazylibrarian.CONFIG['OPDS_AUTHENTICATION'],
'opds_username': lazylibrarian.CONFIG['OPDS_USERNAME'],
'opds_password': lazylibrarian.CONFIG['OPDS_PASSWORD'],
})

if lazylibrarian.CONFIG['LAUNCH_BROWSER'] and not options.nolaunch:
81 changes: 4 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,82 +2,9 @@
LazyLibrarian is a program to follow authors and grab metadata for all your digital reading needs.
It uses a combination of [Goodreads](https://www.goodreads.com/) [Librarything](https://www.librarything.com/) and optionally [GoogleBooks](https://www.googleapis.com/books/v1/) as sources for author info and book info. License: GNU GPL v3

Right now it's capable of the following:
* Import an existing calibre library (optional)
* Find authors and add them to the database
* List all books of an author and mark ebooks or audiobooks as 'wanted'.
* LazyLibrarian will search for a nzb-file or a torrent or magnet link for that book
* If a nzb/torrent/magnet is found it will be sent to a download client or saved in a black hole where your download client can pick it up.
* Currently supported download clients for usenet are :
- sabnzbd (versions later than 0.7.x preferred)
- nzbget
- synology_downloadstation
* Currently supported download clients for torrent and magnets are:
- deluge
- transmission
- utorrent
- qbittorrent
- rtorrent
- synology_downloadstation
* When processing the downloaded books it will save a cover picture (if available) and save all metadata into metadata.opf next to the bookfile (calibre compatible format)
* The new theme for the site allows it to be accessed (and usable) from devices with a smaller screen (such as an iPad)
* AutoAdd feature for book management tools like Calibre which must have books in flattened directory structure, or use calibre to import your books into an existing calibre library
* LazyLibrarian can also be used to search for and download magazines, and monitor for new issues
##

## Screenshots
<img src="http://i.imgur.com/O8awy.png" width="600">
<img src="http://i.imgur.com/fr0yE.png" width="600">
<img src="http://i.imgur.com/AOgh1.png" width="600">
Current source repo is [LazyLibrarian](https://gitlab.com/LazyLibrarian/LazyLibrarian.git)

## Install:
LazyLibrarian runs by default on port 5299 at http://localhost:5299

Linux / Mac OS X:

* Install Python 2 v2.6 or higher, or Python 3 v3.5 or higher
* Git clone/extract LL wherever you like
* Run "python LazyLibrarian.py -d" to start in daemon mode
* Fill in all the config (see [Configuration Wiki](https://github.com/DobyTang/LazyLibrarian/wiki/Configuration) for full configuration)

* Start in daemon mode with `python LazyLibrarian.py -daemon`

## Documentation:
Fairly limited so far (any help appreciated)
There is a wiki at https://github.com/DobyTang/LazyLibrarian/wiki
and a reddit at https://www.reddit.com/r/LazyLibrarian/

## Minimal Configuration (uTorrent):
This is the bare minimum to get you up and running. For more options see the [Configuration Wiki](https://github.com/DobyTang/LazyLibrarian/wiki/Configuration).

### Downloaders
- Open localhost:5299/config
- Select Downloaders tab and check the uTorrent box.
- Host: localhost
- Port: Found in "uTorrent | Options Menu | Preferences | Connections | Port used for incoming connections"
- In "uTorrent settings | Advanced | WebUI" check Enable WebUI and make a username and password. Fill that username and password in to LazyLibrarian.
- In Download Settings Directory in Lazylibrarian change the path to where uTorrent keeps your completed downloads.
Found in "uTorrent Settings | Directories | Move completed downloads to"

### Providers
Check some or all of the torrent provider boxes.

### Processing
In "Folders | Base Destination Folder" type the directory where you want to keep the books LazyLib downloads. For example putting a books folder in Documents. The system documents folder for windows is "C:\Users\USERNAME\Documents\Books\" where USERNAME is your Windows User Name.

### Usage
Open localhost:5299/home or click the LazyLibrarian icon in the top left. Type a book or author name into the top right search bar. Then on the search results screen select "Add Book" to make LazyLib start searching for the book. Not all books can be found instantly, but LazyLib will keep searching!


## Update
Auto update available via interface from master for git and source installs

## Packages
rpm deb and snap packages here : https://github.com/DobyTang/LazyLibrarian/releases
The snap package is confined to users home directory, so all books and downloads need to be accessible from there too.
Install the snap package with flags --dangerous --devmode
AUR package available here: https://aur.archlinux.org/packages/lazylibrarian/

## Docker packages
armhf version here : https://hub.docker.com/r/lsioarmhf/lazylibrarian/
x64 version here : https://hub.docker.com/r/linuxserver/lazylibrarian/
with calibredb here: https://hub.docker.com/r/thraxis/lazylibrarian-calibre/
All open issues have been moved over to [LazyLibrarian Issues](https://gitlab.com/LazyLibrarian/LazyLibrarian/issues)
Please open any new issues on the new repo as the old one is no longer maintained, thanks
Loading