goopypanther / saucebot-discord

17 stars 13 forks source link

Obsolete code for pixivpy #9

Open jmattousey opened 4 years ago

jmattousey commented 4 years ago

https://github.com/upbit/pixivpy per pixivpy documentation the pixiv login information is no longer required I have tested it on my own and it works this way. It actually does not work anymore if I try and login with my credentials given to the bot.

bootresha commented 4 years ago

Hey, I got some time to finally try this out today. Are you sure it's working? I applied your changes, and I got this error message:

Ignoring exception in on_message Traceback (most recent call last): File "C:\Python\Python38\lib\site-packages\discord\client.py", line 270, in _run_event await coro(*args, **kwargs) File ".\saucebot-discord.py3", line 237, in on_message pixivapi.auth() File "C:\Python\Python38\lib\site-packages\pixivpy3\api.py", line 110, in auth raise PixivError('[ERROR] auth() but no password or refresh_token is set.') pixivpy3.utils.PixivError: [ERROR] auth() but no password or refresh_token is set.

So I figured that maybe I just need to disable the code in line 237 (which is "pixivapi.auth()"), and then the error message this time seems to be very certain that you actually need to provide it with login

Ignoring exception in on_message Traceback (most recent call last): File "C:\Python\Python38\lib\site-packages\discord\client.py", line 270, in _run_event await coro(*args, **kwargs) File ".\saucebot-discord.py3", line 242, in on_message pixiv_result = pixivapi.illust_detail(pixiv_id) File "C:\Python\Python38\lib\site-packages\pixivpy3\aapi.py", line 146, in illust_detail r = self.no_auth_requests_call('GET', url, params=params, req_auth=req_auth) File "C:\Python\Python38\lib\site-packages\pixivpy3\aapi.py", line 40, in no_auth_requests_call self.require_auth() File "C:\Python\Python38\lib\site-packages\pixivpy3\api.py", line 52, in require_auth raise PixivError('Authentication required! Call login() or set_auth() first!') pixivpy3.utils.PixivError: Authentication required! Call login() or set_auth() first!

jmattousey commented 4 years ago

Yes this is working on my own version did you pull in both changed I unfortunately forgot a piece of code for my first portion so I had to make a second update? Although perhaps there is another issue because I am using aiohttp?

goopypanther commented 4 years ago

I haven't had success with this either. I'm pretty sure that at least some of API is accessible without authentication but I doubt you can access content that is set to normally require authentication to view.