GithubHelp home page GithubHelp logo

furrycoders / faapi Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 6.0 1.43 MB

Python library to implement API-like functionality for the FurAffinity.net website.

License: European Union Public License 1.2

Python 100.00%
api furaffinity python3 scraper

faapi's People

Contributors

matteocampinoti94 avatar xraydylan avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

faapi's Issues

[Bug]: User name not matching

Version

3.9.2

What happened?

I have encountered a strange bug.

A username is not properly returned by the api.

For the username "ashwolves5" a user object can be created with.

user = api.user("ashwolves5")

However, the returned user name from the user object is not matching.
user.name returns only "shwolves5", which obviously causes and error when this name string is uses to creae another user object with the api.

How to reproduce the bug?

(As described)

Relevant log output

No response

[Bug]: Nothing works due to Cloudflare check

Version

3.11.3

What happened?

Hello, today I tried to use FAAPI and discovered that it stopped working.

Any request I make upon FAAPI ends with a requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: [...]1 exception. Looking into the response gotten from the server, I can see that the content of the response starts with <!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title>, which corresponds to a Cloudflare challenge.

I don't know whether this is because FA changed something in their hosting to require all visitors to pass the challenge,2 or whether FA is singling my connection for these checks, but in either case, I do think that FAAPI should at least throw a better error so the user can see that a Cloudflare check is preventing FAAPI from working because, as of now, the error thrown is a simple 403, which can mean many things.

How to reproduce the bug?

Try to do anything that sends a request to FA.

Relevant log output

No response

Footnotes

  1. [...] in excerpt signifies omisison.

  2. It seems so, because testing on my two devices, I always get the challenge when trying to access FA.

[Bug]: Does not work with Fur Affinity from 2022-11-26

The following log is from user page parsing via FALocalRepo.

Traceback (most recent call last):
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/__main__.py", line 59, in main
    exit(app.main(standalone_mode=False) or 0)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/console/download.py", line 257, in download_update
    downloader.download_users_update(list(users), list(folders), stop, deactivated, like)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/downloader.py", line 757, in download_users_update
    self._download_users(users_folders, stop)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/downloader.py", line 683, in _download_users
    err = self.download_user_page(user, stop == 1)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/downloader.py", line 613, in download_user_page
    user, err = download_catch(self.api.user, username)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/falocalrepo/downloader.py", line 108, in download_catch
    return func(*args, **kwargs), 0
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/faapi/base.py", line 211, in user
    return User(self.get_parsed(join_url("user", quote(username_url(user)))))
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/faapi/user.py", line 193, in __init__
    self.parse()
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/faapi/user.py", line 234, in parse
    parsed: dict = parse_user_page(self.user_page)
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/faapi/parse.py", line 617, in parse_user_page
    assert tag_status is not None, _raise_exception(ParsingError("Missing name tag"))
  File "/Users/matteoc/Library/Python/3.10/lib/python/site-packages/faapi/exceptions.py", line 56, in _raise_exception
    raise err
faapi.exceptions.ParsingError: Missing name tag

[Bug]: requests unable to handle cloudflare check

Version

falocalrepo 4.4.5

What happened?

Cloudflare has enabled new checkers which prevent

How to reproduce the bug?

attempt to run program and returns cloudflare check error

Relevant log output

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/falocalrepo/__main__.py", line 59, in main
    exit(app.main(standalone_mode=False) or 0)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/falocalrepo/console/download.py", line 165, in download_users
    api: FAAPI = open_api(db, ctx)
  File "/usr/local/lib/python3.10/dist-packages/falocalrepo/console/util.py", line 199, in open_api
    if check_login and not api.login_status:
  File "/usr/local/lib/python3.10/dist-packages/faapi/base.py", line 118, in login_status
    return parse_loggedin_user(self.get_parsed("login", skip_auth_check=True)) is not None
  File "/usr/local/lib/python3.10/dist-packages/faapi/base.py", line 146, in get_parsed
    response.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://www.furaffinity.net/login

[Bug]: HTML URL Encoded Usernames

Version

3.9.1

What happened?

I have been using the API for a little project of mine and encountered a problem with a certain username.

In their name ["Basque`"] they use the " ` " character. It gets encoded in the URL with %60.
(Reference for URL encoding https://www.w3schools.com/tags/ref_urlencode.ASP)

The problme is I can't get this user with the API's user() method.
It doesn't throuw an error but insteads retrieves the user named "basque" without the speical character.

How can this be adressed?

How to reproduce the bug?

Call:

api.user("Basque`")

And compare stats to user front page of path "/user/Basque%60".

Relevant log output

No response

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.