Git Product home page Git Product logo

ebook-collector's Introduction

yo, I'm tako

#!/usr/bin/python

class ComputerEngineer:
    def __init__(self):
        self.aliases = {"known_as": ["tako", "njl"], "dev_name": "notjl"}
        self.operating_system = None

    def about_me(self, alias="known_as", pref=0):
        """
        about_me displays what <aliases> is about and his interests.
        """

        self.real_name = "Angel G. P. C."

        self.desc = f"""
        {self.aliases[alias][pref]} is currently an engineering student attending TIP QC. Believes in F/OSS.
        """

        self.interests = [
            "machine learning / artificial intelligence",
            "game development",
            "web development",
            "learning computer languages and *languages",
            "kpop",
            "indie games",
            "f/oss",
        ]

        self.plugs = {
            "twitter": "notjl_______",
            "discord": "njl#0142",
            "mail": "[email protected]",
            # 'twitch': 'is_njl',
            "steam": "NJLisinuse",  # /id/<steam>
            "spotify": "ash",
        }

        self.langs_n_tools = {
            "operating_system": self.operating_system,
            "ide": ["VSCodium", "Vi/Vim/Neovim"],
            "prefered_lang": "python",
            "learned": [
                "c/c++ (30%)",
                "lua (20%)",
                "kotlin/android native (40%)",
                "fastapi (60%)",
            ],
            "to_learn": ["html", "css", "js", "rust", "nextjs", "reactjs", "golang"],
        }

        self.projects = ["E-book Collector", "BioPIn"]
        self.goals = "learn how to properly code, make more software (especially TUIs), and contribute to open source and advocate F/OSS"

    def currently_doing(self, status):
        return status


tako = ComputerEngineer()
tako.operating_system("EndeavourOS")
print(tako.currently_doing('Learning Machine Learning'))

๐Ÿ“œ Github Stats

๐Ÿ”— Connect with me

Twitter Discord Protonmail Twitch Protonmail Spotify

Discord

๐Ÿ“‚ Workspace / Projects (Archived ๐Ÿ”’)

ebook-collector's People

Contributors

blurene97 avatar hakushiii avatar notjl avatar qjabparas avatar

Watchers

 avatar

ebook-collector's Issues

VirusTotal API closes file-like objects

Trying to upload a file in commit 5722d3a, resulting in a traceback of:

Traceback (most recent call last):
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\uvicorn\protocols\http\httptools_impl.py", line 404, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\uvicorn\middleware\proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\fastapi\applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\middleware\exceptions.py", line 75, in __call__
    raise exc
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\middleware\exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\starlette\routing.py", line 65, in app
    response = await func(request)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\fastapi\routing.py", line 231, in app
    raw_response = await run_endpoint_function(
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\fastapi\routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\.\backend\routers\library.py", line 31, in upload
    return await handler.upload_ebook(
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\.\backend\handlers\lib_handlers.py", line 55, in upload_ebook
    await grid_in.write(tmp_file.file)
  File "C:\Users\ktako\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\ktako\OneDrive\Documents\Repositories\ebook-collector\__pypackages__\3.10\lib\gridfs\grid_file.py", line 375, in write
    to_write = read(self.chunk_size)
  File "C:\Users\ktako\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 747, in read
    return self._file.read(*args)
ValueError: I/O operation on closed file.

This won't show if your file already exists in VT database, since it checks for hash.

Possible solution:
Create a temporary file and copy uploaded file object to temporary file. Use temporary file for analysis and upload original file.

graph TD;
    og_file-->tmp_file;
    tmp_file-->virustotal;
    virustotal-->tmp_file.close;
    og_file-->gridfs;
    gridfs_write-->og_file.close;

[Feature] Limit specific file types for upload

PyMuPDF can handle specific file types and can be used to limit the files stored in the library system.

With PyMuPDF you can access files with extensions like .pdf, .xps, .oxps, .cbz, .fb2 or .epub. In addition, about 10 popular image formats can also be handled like documents: .png, .jpg, .bmp, .tiff, etc.
[Source PyMuPDF]

[Feature] File approval system

vt-py is not working as intended and makes scanning files difficult. To supplement the need for security, apply a approval system for files for public viewing by the admin. The admin will manually check if the file is up to "standard" and clean before upstreaming it to public viewing

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.