Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Using proxies in libs where you can send data is usually done by specifying the address in the parameter in the correct format, here is an example for requests:
import requests
proxies = {"https": "socks4://212.200.118.98:1080"}
...
resp = requests.post(tg_url, files=files, data=data, proxies=proxies)
import requests
proxies = {"https": "socks4://212.200.118.98:1080"} #Сербская прокся, отправляет через раз
tg_token = 'xxxxxxxxxxx'
tg_url = "https://api.telegram.org/bot" + tg_token + "/sendPhoto"
tg_chat_id = "@groupity1"
caption = 'yyyyyy yyyy yyyy'
files = {'photo': open('d://photo1.png', 'rb')}
data = {'chat_id' : tg_chat_id, 'caption': caption}
resp = requests.post(tg_url, files=files, data=data, proxies=proxies)
print(resp)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question