Lu-Yi-Hsun / iqoptionapi

IQ Option API
372 stars 289 forks source link

Cannot login #59

Closed jimmylai-hk closed 5 years ago

jimmylai-hk commented 5 years ago

Hi,

I download the latest code and try to use the following code to login.

import time from iqoptionapi.stable_api import IQ_Option I_want_money=IQ_Option("username","password")

Below is the error code.

ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed.

JafferWilson commented 5 years ago

@jimmylai-hk Try re-login at least 4 to 5 times. It sometimes happen that IQoption do not allow access. If the problem still remains, then try re-login through browser. If it is successful then surely it will work using the library. If you are not able to login through the browser, then I am afraid your IP is banned by the IQOption.

jimmylai-hk commented 5 years ago

Dear JafferWilson, Thanks for your comments. I tried again using the method you suggest. However, the same error occur. I have no issuer login using the browser as well as the IQ option application on Windows.

Below is the code.

from iqoptionapi.stable_api import IQ_Option import logging import time logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(message)s') retry_max_count = 4 retry=1 while (retry <= retry_max_count): try : I_want_money=IQ_Option("username","password") break except: print("Retry count :",retry) retry=retry+1 print(I_want_money.version)

Lu-Yi-Hsun commented 5 years ago

@jimmylai-hk i think that is websocket-client version problem

READ THE DOCUMENT :https://github.com/Lu-Yi-Hsun/iqoptionapi#can-not-loging-problem

if that can not help ,please give me log file

jimmylai-hk commented 5 years ago

Dear Lu-Yi-Husn, I reinstall websocket-client-0.47.0 as suggested but the issue still there.

pip3 install websocket-client==0.47.0 Collecting websocket-client==0.47.0 Using cached https://files.pythonhosted.org/packages/9d/fb/f51a03e232e00d6c504 dfe815aed090c894ba3f8d3f7fd9612f3e227bf24/websocket_client-0.47.0-py2.py3-none-a ny.whl Requirement already satisfied: six in e:\anaconda3\lib\site-packages (from webso cket-client==0.47.0) (1.11.0) Installing collected packages: websocket-client Successfully installed websocket-client-0.47.0

DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"47fe4cf8c40f734457b9242cea15da93"}} DEBUG:iqoptionapi.api:{'Server': 'nginx', 'Date': 'Wed, 28 Nov 2018 12:06:05 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Origin': '', 'Set-Cookie': 'ssid=47fe4cf8c40f734457b9242cea15da93; Path=/; Domain=iqoption.com; Max-Age=2592000; Secure', 'Strict-Transport-Security': 'max-age=15555600', 'X-Content-Type-Options': 'nosniff'} DEBUG:iqoptionapi.api:<RequestsCookieJar[<Cookie ssid=47fe4cf8c40f734457b9242cea15da93 for .iqoption.com/>]> ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed. DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"db26e956f467335c70625c1f4b57e5c3"}} DEBUG:iqoptionapi.api:{'Server': 'nginx', 'Date': 'Wed, 28 Nov 2018 12:06:07 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Origin': '', 'Set-Cookie': 'ssid=db26e956f467335c70625c1f4b57e5c3; Path=/; Domain=iqoption.com; Max-Age=2592000; Secure', 'Strict-Transport-Security': 'max-age=15555600', 'X-Content-Type-Options': 'nosniff'} DEBUG:iqoptionapi.api:<RequestsCookieJar[<Cookie ssid=db26e956f467335c70625c1f4b57e5c3 for .iqoption.com/>]> ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed. DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"a023e3cdde5176b0efa5b30c31bc0bd4"}} DEBUG:iqoptionapi.api:{'Server': 'nginx', 'Date': 'Wed, 28 Nov 2018 12:06:09 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Origin': '', 'Set-Cookie': 'ssid=a023e3cdde5176b0efa5b30c31bc0bd4; Path=/; Domain=iqoption.com; Max-Age=2592000; Secure', 'Strict-Transport-Security': 'max-age=15555600', 'X-Content-Type-Options': 'nosniff'} DEBUG:iqoptionapi.api:<RequestsCookieJar[<Cookie ssid=a023e3cdde5176b0efa5b30c31bc0bd4 for .iqoption.com/>]> ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed. DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"ad86ea4c283ceb8fa2f4d552786cc5b3"}} DEBUG:iqoptionapi.api:{'Server': 'nginx', 'Date': 'Wed, 28 Nov 2018 12:06:11 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Origin': '', 'Set-Cookie': 'ssid=ad86ea4c283ceb8fa2f4d552786cc5b3; Path=/; Domain=iqoption.com; Max-Age=2592000; Secure', 'Strict-Transport-Security': 'max-age=15555600', 'X-Content-Type-Options': 'nosniff'} DEBUG:iqoptionapi.api:<RequestsCookieJar[<Cookie ssid=ad86ea4c283ceb8fa2f4d552786cc5b3 for .iqoption.com/>]> ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed. DEBUG:iqoptionapi.api:https://auth.iqoption.com/api/v1.0/login DEBUG:iqoptionapi.api:<Response [200]> DEBUG:iqoptionapi.api:{"data":{"ssid":"dbd3c17f019cb8dc2401f9d1b964b188"}} DEBUG:iqoptionapi.api:{'Server': 'nginx', 'Date': 'Wed, 28 Nov 2018 12:06:13 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '52', 'Connection': 'keep-alive', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Accept, Accept-Language, Content-Type, YourOwnHeader', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Origin': '*', 'Set-Cookie': 'ssid=dbd3c17f019cb8dc2401f9d1b964b188; Path=/; Domain=iqoption.com; Max-Age=2592000; Secure', 'Strict-Transport-Security': 'max-age=15555600', 'X-Content-Type-Options': 'nosniff'} DEBUG:iqoptionapi.api:<RequestsCookieJar[<Cookie ssid=dbd3c17f019cb8dc2401f9d1b964b188 for .iqoption.com/>]> ERROR:iqoptionapi.ws.client:[WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call DEBUG:iqoptionapi.ws.client:Websocket connection closed. ERROR:root:error reconnect() too many time please look log file

Lu-Yi-Hsun commented 5 years ago

@jimmylai-hk

try this :https://github.com/websocket-client/websocket-client/issues/370

jimmylai-hk commented 5 years ago

Dear Lu-Yi-Hsun,

Many thx for your help. The issue was fixed after I upgrade the python to 3.6.7.