Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol.get_price_overview() sometimes raises an exception #17

Open
Taha-Elmi opened this issue Aug 16, 2023 · 4 comments
Open

Symbol.get_price_overview() sometimes raises an exception #17

Taha-Elmi opened this issue Aug 16, 2023 · 4 comments

Comments

@Taha-Elmi
Copy link

This method will raise this ValueError for some symbol_id(like 7598121347840396):

File "C:\Python311\Lib\site-packages\tsetmc_api\symbol\symbol.py", line 23, in get_price_overview
raw_data = _core.get_symbol_price_overview(symbol_id=self.symbol_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\tsetmc_api\symbol_core.py", line 97, in get_symbol_price_overview
r_buy_v, l_buy_v, _, r_sell_v, l_sell_v, r_buy_c, l_buy_c, _, r_sell_c, l_sell_c = data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 10, got 1)

@mahs4d
Copy link
Owner

mahs4d commented Aug 16, 2023

Thanks Taha for reporting this issue.
Symbol and market watch subpackages are still using the legacy tsetmc API (old.tsetmc.com). I'm planning to migrate them to the new API (cdn.tsetmc.com) which will address this issue.

@Taha-Elmi
Copy link
Author

Thanks Mahdi
I'm using your API in one of my projects that must be finished by this Tuesday. Can you fix this issue till Monday?

@shabane
Copy link

shabane commented Sep 27, 2023

hi, same issue.
i try to override all the old.tsetmc.com with cdn.tsetmc.com, but new error was HTTP 403
which mean that they don`t let us access the site without a browser header.
so i tried it with:

headers = {
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
    'Accept-Language': 'en-US,en;q=0.5',
    # 'Accept-Encoding': 'gzip, deflate',
    'Connection': 'keep-alive',
    'Upgrade-Insecure-Requests': '1',
}

this solves the issue of HTTP 403 but still have another problem you can see it here.

@self-ms
Copy link

self-ms commented Nov 13, 2023

This method will raise this ValueError for some symbol_id(like 7598121347840396):

File "C:\Python311\Lib\site-packages\tsetmc_api\symbol\symbol.py", line 23, in get_price_overview
raw_data = _core.get_symbol_price_overview(symbol_id=self.symbol_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\tsetmc_api\symbol_core.py", line 97, in get_symbol_price_overview
r_buy_v, l_buy_v, _, r_sell_v, l_sell_v, r_buy_c, l_buy_c, _, r_sell_c, l_sell_c = data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 10, got 1)

سلام برای استخراج و ذخیره خودکار داده‌های سهام بورس ایران مینوتید از این ریپو استفاده کنین.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants