Git Product home page Git Product logo

libgenbulkupload's Introduction

LibgenBulkUpload

bulk upload files to https://library.bz/main/upload/

Usage

./upload.bash file_to_upload title language_code main_or_fiction

Specifying additional metadata

Example

isbn=9783868386066 authors='Feser, Edward' ./upload.bash Immortal_Souls.pdf 'Immortal Souls: A Treatise on Human Nature' eng main

Batch with GNU parallel

This GNU parallel command uploads (one-at-a-time) all the PDFs in the current directory, assigns their Libgen metadata author to the PDF filename (sans suffix), and sets the language to English:

parallel -j1 ./upload.bash {} {.} eng main ::: *.pdf

Metadata

The following metadata can be optionally passed as an environment variable to the script:

  • asin, authors, bookmarks, city, cleaned, colored, cover, ddc, description, doi, dpi, dpi_select, edition, file_commentary, file_source, file_source_issue, gb_id, isbn, issn, language, language_options, lbc, lcc, metadata_query, metadata_source, ol_id, page_orientation, pages, paginated, periodical, publisher, scan, series, sfearchable, tags, title, toc, topic, udc, volume, year

Calibre

If you export a CSV catalog from Calibre, you can use it with calibre.py to feed in the metadata for bulk book uploads, automatically.

Your Calibre catalog CSV file can have the following headings (in any order), including the custom ones (which begin with '#'):

  • #amazon, #doi, #google, #issn, #lcn, #pubyear, authors, comments, isbn, languages, publisher, series, series_index, tags, title

The specified "files to upload" directory is expected to contain symlinks to the files in your Calibre library.

To setup the symlinks, execute a command like this in your upload directory:

for i in `cat ../formats.txt`;
do
    find ~/Calibre\ Library/ -type f -iname "*.$i" -print0 | \
        xargs -0 -I{} sh -c 'filename=`basename "{}"`;
            random_part=$(mktemp -u XXXXXX);
            suffix=".${filename##*.}";
            newname="${filename%.*}-${random_part}${suffix}";
            ln -sv "{}" "$newname";'
done 

calibre.py is a similar script to the old upload.py Selenium script.

libgenbulkupload's People

Contributors

geremia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

loayamin mmogang

libgenbulkupload's Issues

Feature_Request-Autofill metadata from ISBN code

I humbly request the metadata auto-completion function from the book's ISBN.
In the upload channel "https://library.bz/main/upload/" of the same libgen portal, after uploading an ebook, it is possible to auto-fill the book's metadata from its ISBN through some search engines, such as amazon or goodreaders, googlebooks and others...

Thus, it would be very useful for the project to gain the function that, if the ISBN is entered in the file name, the metadata search is performed and the ebook comes up not only with author and title data, but several others. (year, language, edition, cover, publisher...)

Ex:
Title - Author - ISBN.ext
Sapiens A Brief History of Humankind - Yuval Noah Harari - 0062316095.pdf

Program does not work :/

Specified directories:
/home/mble/Downloads/Books/
/home/mble/Downloads/Books/uploaded/
/home/mble/Downloads/Books/rejected/

Traceback (most recent call last):
  File "/home/mble/.local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mble/Downloads/../Code/repos/misc/LibgenBulkUpload/upload.py", line 57, in <module>
    login()
  File "/home/mble/Downloads/../Code/repos/misc/LibgenBulkUpload/upload.py", line 36, in login
    driver = webdriver.Firefox()
  File "/home/mble/.local/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 176, in __init__
    self.service.start()
  File "/home/mble/.local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.