mpoquet / poe-stash-api

Simple Python code to retrieve Path of Exile stash information from GGG's API
MIT License
2 stars 2 forks source link

Any help apprecaited #1

Closed gwntd541 closed 1 year ago

gwntd541 commented 1 year ago

I'm writing this on the off chance anyone reads this. I'm trying to learn some development for poe, but am having a hard time accessing the poe stash tabs. When I try to run the example prophecies_counter script with my username/possessid added to it, I get a 404 error. Thanks if anyone actually read this, I'd be suprised, since it's such an old repo. lol

(Pdb) l
 38         }
 39         headers = {
 40             'user-agent': 'poe-stash-api/0.1.0 simple python gemail@gmail.com'
 41         }
 42         breakpoint()
 43  ->     r = requests.post(url, data=data, cookies=cookies, headers=headers)
 44         if not r.ok:
 45             error_text = f'Got HTTP status {r.status_code}: {r.reason}'
 46             if r.status_code == 404:
 47                 raise ResourceNotFoundFTException(error_text)
 48             raise HTTPErrorFTException(error_text)
(Pdb) c
Traceback (most recent call last):
  File "C:\Users\gwntd\Documents\POE_Scripts\poe-stash-api-master\examples\prophecies_counter.py", line 12, in <module>
    tabs = stash.fetch_all_tabs(league, realm, os.getenv('POEACCOUNT'), os.getenv('POESESSID'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gwntd\AppData\Local\Programs\Python\Python311\Lib\site-packages\poe_stash_api\stash.py", line 67, in fetch_all_tabs
    tabs.append(fetch_tab(league, realm, account_name, poe_sessid, 0))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gwntd\AppData\Local\Programs\Python\Python311\Lib\site-packages\poe_stash_api\stash.py", line 47, in fetch_tab
    raise ResourceNotFoundFTException(error_text)
poe_stash_api.stash.ResourceNotFoundFTException: Got HTTP status 404: Not Found
PS C:\Users\gwntd\Documents\POE_Scripts\poe-stash-api-master\examples>
gwntd541 commented 1 year ago

Figured it out, I had no stash tabs in the last league. lol

mpoquet commented 1 year ago

Hi! Thanks for your interest in this project.

I seized the opportunity to test whether fetching tabs still work. Everything seems fine from a quick test (I just called stash.fetch_tab('Kalandra', 'pc', poeaccount, poesessid, tab_id) to get various tabs and it worked).