Git Product home page Git Product logo

e621's People

Contributors

eoan-ermine avatar hmiku8338 avatar n8deathrider avatar

Stargazers

 avatar  avatar

Watchers

 avatar

e621's Issues

Posts on pools max out at 75 posts.

return self.e621api.posts.search(tags=f"id:{','.join(map(str, self.post_ids))}")

I'm not sure why this isn't set up as:

class _PostsGetterMixin:
    @cached_property
    def posts(self: _HasPostIdsAndE621API) -> List[Post]:
        return self.e621api.posts.search(
            tags=f"id:{','.join(map(str, self.post_ids))}",
            ignore_pagination=True,
            limit=len(self.post_ids),
        )

Which seems to max out at 100 posts but even simpler would be:

class _PostsGetterMixin:
    @cached_property
    def posts(self: _HasPostIdsAndE621API) -> List[Post]:
        return self.e621api.posts.get(self.post_ids)

Which but even this still maxes out at 100 posts.

The pool I'm using as a test has 297 posts at this moment.

TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'NoneType'

Hey, I'm trying to get e926 to work and I am getting.

>>> from e621 import E926
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\e621\__init__.py", line 1, in <module>
    from .api import E621, E926
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\e621\api.py", line 3, in <module>
    from . import endpoints
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\e621\endpoints.py", line 28, in <module>
    from .models import (
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\e621\models.py", line 405, in <module>
    class Post(BaseModel):
  File "pydantic\main.py", line 188, in pydantic.main.ModelMetaclass.__new__
  File "pydantic\typing.py", line 419, in pydantic.typing.resolve_annotations
    def Union(self, parameters):
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\typing.py", line 277, in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\typing.py", line 533, in _evaluate
    eval(self.__forward_code__, globalns, localns),
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'NoneType'

Thanks

Errors when working with posting posts

I fixed the code as soon as I could, everything seemed to start working. Here are my edits (endpoints.py )

  1. "upload[source]": ",".join(sources), - source, not sources
  2. r = self._api.session.post("uploads", files=files, data=params) - There was an error "File not provided" or something like that
  3. I also specified the post in uploads, and not in posts, based on the documentation on the site.

I tried to load the content to e621ng (repo), which I launched locally. I used the library to overload art with e621.net on a local installation

Cannot search for posts when logged in

Affected Version

  • Python 3.10
  • e621-stable 1.0.4

How to Reproduce

Code:

login=('my user id', 'my api key') # for illustration
api = E621(login)
print(api.logged_in())
print('Posting search requiest...')
print(api.posts.search(''female", page=1, limit=1)[0])

Result

True
Posting search requiest...
Traceback (most recent call last):
  File "h:\ttkkp\horny doge\e621_download.py", line 29, in <module>
    posts = api.posts.search(tag_entry, limit=1, page=1)
  File "C:\Users\TowardTheStars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\e621\endpoints.py", line 224, in search
    posts = self._default_search({"tags": tags}, limit, page, ignore_pagination)
  File "C:\Users\TowardTheStars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\e621\endpoints.py", line 120, in _default_search
    resp = self._api.session.get(self._url, params=params)
  File "C:\Users\TowardTheStars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 601, in get
    return self.request("GET", url, **kwargs)
  File "C:\Users\TowardTheStars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\e621\session.py", line 33, in request
    r.raise_for_status()
  File "C:\Users\TowardTheStars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://e621.net/posts.json?tags=female&limit=1&page=1

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.