Git Product home page Git Product logo

Comments (12)

Xraydylan avatar Xraydylan commented on June 27, 2024 1

But anyways.
I will test your solution for the problem and modify if neccessary.

If I find more issues or other bugs...
Well, I will be coming again.

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

After a bit of digging I may have found the issue.
In parser.py in the functing parse_user_page,
after stripping most user names contain the character "~" (or "!", i don't know if there are different specialcharacters) as first letter.
However, this user doesn't.
So the operation name: str = u[1:] cuts off the first character.

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

A similar bug occurs in parse_watchlist too.

from faapi.

MatteoCampinoti94 avatar MatteoCampinoti94 commented on June 27, 2024

Thank you for opening the issue!

The error occurs because apparently FA admins do not have a status character in front of their username (~, !, ∞, etc.). Unfortunately, the status character is contained in the same tag as the username (why they didn't use a child span or ::before with attr() is beyond me), so I'll have to add some code to detect admins specifically.

from faapi.

MatteoCampinoti94 avatar MatteoCampinoti94 commented on June 27, 2024

Release 3.9.3 is available :)

from faapi.

MatteoCampinoti94 avatar MatteoCampinoti94 commented on June 27, 2024

Aaaaand I forgot about the watchlists x3

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

🀣

Well, I have been working on a little fix in my project as well.
Although I have to do a little more than just correcting this but also repair my database if a user has been wrongly saved...

My idea revolves around getting the user name from the URL.
Or rather at least the first character of the username. (Since some people have doule of tipple "-" at the start of their username. That gets relevant because I found a slingle "-" to be a status as well...)

So I am getting the URL from the content of the meta tag with property="og:url.

And I have noticed that for the watchlists there is alway a separating space between the status and the username.
So I will also edit this in my solution.

from faapi.

MatteoCampinoti94 avatar MatteoCampinoti94 commented on June 27, 2024

I like the property:url solution! You should submit a PR so we can integrate it with FAAPI :)

As for watchlists: my solution detects the admin logo, but you’re right, there is a space and it would work much better by simply parsing the link URL and then looking for the status separately.

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

Oh!
And just found another error XD
User "marioea".

As I have mentioned they have "-" as status-
This gets not detected as well.

user = api.user("marioea")

if user.name gets called it returns only "-marioea", which causes and error if used to create the user object again.

As I have mentioned simply removing any leading "-" would be problemantc since some usernames have "-" amd "--" included at the beginning.

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

I will try to make a PR and try to make the code look nice πŸ˜…
I hope I am up to your standards.

from faapi.

MatteoCampinoti94 avatar MatteoCampinoti94 commented on June 27, 2024

I have checked "marioea" but there is no issue with them. The User object correctly parses their name as "marioea" and "-" as status.

api = faapi.FAAPI(cookies)
u = api.user("marioea")
print((u.name, u.status))  # ('marioea', '-')

from faapi.

Xraydylan avatar Xraydylan commented on June 27, 2024

Hmm then I must have overlooked something there πŸ€”
But in any case that entire problme has been sovled.

from faapi.

Related Issues (4)

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.