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

solution for investiny 403 #54

Closed
ramakrishnamekala129 opened this issue Oct 18, 2022 · 9 comments · Fixed by #55
Closed

solution for investiny 403 #54

ramakrishnamekala129 opened this issue Oct 18, 2022 · 9 comments · Fixed by #55
Assignees
Labels
bug Something isn't working

Comments

@ramakrishnamekala129
Copy link

please use which is working api

import requests
from requests.structures import CaseInsensitiveDict
while True:
i=['1138417','17955','101810','160',]
for k in i:
url = f"https://tvc6.investing.com/9368e857cc51ddcae69108bd8a3b6d49/1664515691/56/56/23/history?symbol={k}&resolution=D&from=1633411692&to=1664515752"

    headers = CaseInsensitiveDict()
    headers["authority"] = "tvc4.investing.com"
    headers["accept"] = "*/*"
    headers["accept-language"] = "en-US,en;q=0.9"
    headers["content-type"] = "text/plain"
    headers["origin"] = "https://tvc-invdn-com.investing.com"
    headers["referer"] = "https://tvc-invdn-com.investing.com/"
    headers["sec-fetch-dest"] = "empty"
    headers["sec-fetch-mode"] = "cors"
    headers["sec-fetch-site"] = "same-site"
    headers["user-agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36"
    
    
    resp = requests.get(url, headers=headers)
    
    print(resp.status_code)
    time.sleep(1)
    if resp.status_code==200:
        print(resp.json())
@ramakrishnamekala129
Copy link
Author

to make reliable solution we need to switch between multi api

@ramakrishnamekala129
Copy link
Author

tvc6 is working fine they banned tvc4

@alvarobartt
Copy link
Owner

Thanks, @ramakrishnamekala129 already been fixed, and released, it's available at https://github.com/alvarobartt/investiny/releases/tag/v0.7.2, should be installable in some minutes with pip install investiny==0.7.2 🤗

@alvarobartt alvarobartt self-assigned this Oct 18, 2022
@alvarobartt alvarobartt added the bug Something isn't working label Oct 18, 2022
@alvarobartt
Copy link
Owner

alvarobartt commented Oct 18, 2022

tvc6 is working fine they banned tvc4

@ramakrishnamekala129 I know that you already shared this URL with me in the past, but where did you get that URL from? Just by randomly testing different tvc combinations, or it's just the Investing.com page from another country?

@alvarobartt
Copy link
Owner

FYI after some testing, it seems that tvc4 is working again! 🎉

@ramakrishnamekala129
Copy link
Author

Since investpy stopped working my main stopped working so I started searching backdoor in investing.com so I got tvc4 in Indian site after so made request methods which worked fine for 3 to4 days after that I sent so that repair investpy along with that after searching countries investing.com then I got tvc6 Australia which had some sharing between American investing so concluded that they work differently.

@Emmanuel1524
Copy link

Hey guys, I'm using the investpy 7.2.0 but I got the same preview error: 403.

Any clue to how deal with this problem?

@alvarobartt
Copy link
Owner

Hey guys, I'm using the investpy 7.2.0 but I got the same preview error: 403.

Any clue to how deal with this problem?

Let me check this again later, as it shouldn't happen any more as far as I could test... Can you try with investiny 0.7.1? Thanks!

@alvarobartt
Copy link
Owner

Ok already tested it @Emmanuel1524 aaaaand... bad news, all the Investing.com APIs seem to be Cloudflare protected now... let me check for alternative solutions as proposed at #56 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants