degiro-connector
degiro-connector copied to clipboard
CRITICAL:degiro_connector.quotecast.tools.ticker_fetcher:A new "session_id" is required.
Hi need some help.
I have been using the API for many years now though a Google Cloud fucntion, always working perfectly. Recently updated the code to 3.0.22, but I couldn't make the quotecast login to work. The code used is below, almost exactly the same as the examples provided for realtime_one_shot.py
# REAL TIME PRICE
logging.basicConfig(level=logging.INFO)
logger = TickerFetcher.build_logger()
session = TickerFetcher.build_session()
ticker_to_df = TickerToDF()
ticker_request = TickerRequest(
request_type="subscription",
request_map={
pdt_vwdId: [
"LastDate",
"LastTime",
"LastPrice",
"LastVolume",
],
},
)
# FETCH METRICS
session_id_rt = TickerFetcher.get_session_id(user_token=user_token)
if session_id_rt is None:
raise TypeError("`session_id_rt` is None")
else:
print("Get real-time session_id_rt:", session_id_rt)
TickerFetcher.subscribe(
ticker_request=ticker_request,
session_id=session_id_rt,
session=session,
logger=logger,
)
ticker = TickerFetcher.fetch_ticker(
session_id=session_id_rt,
session=session,
logger=logger,
)
if ticker is None:
raise TypeError("`ticker` is None")
The error is the one in the subject issue, here the logs (session ID seems ok, the xxx are masked):
INFO:degiro_connector.quotecast.tools.ticker_fetcher:get_session_id:response_dict: {'sessionId': '8f784c1f-48fd-43e6-9787-xxxxxxxx'}
Get real-time session_id_rt: 8f784c1f-48fd-43e6-9787-xxxxxxxx
INFO:degiro_connector.quotecast.tools.ticker_fetcher:subscribe:data {"controlData":"a_req(485013849.LastDate);a_req(485013849.LastTime);a_req(485013849.LastPrice);a_req
CRITICAL:degiro_connector.quotecast.tools.ticker_fetcher:A new "session_id" is required.
CRITICAL:degiro_connector.quotecast.tools.ticker_fetcher:A new "session_id" is required.
Any ideas? many thanks