I want get access to URL like this: 'http://login:password@code.ngrok.io' throw my telegram Bot.
I have code like this
import requests
import telebot
login = 'login'
password = 'pass'
code = '12312312'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36'}
main_URL = 'http://' + login + ':' + password + '@' + code + '.ngrok.io'
req_URL = 'http://' + login + ':' + password + '@' + code + '.ngrok.io/command.html'
@bot.message_handler(commands=['down'])
def down(message):
r = requests.get(main_URL, headers=headers)
bot.send_message(message.chat.id, r.status_code)
After that I get, error 403 forbidden. But .ngrok.io is in your whitelist.
Even main_URL = 'http://ngrok.io'
does not work.
requsts.post(req_URL, data=payload) # doesn't work too
But from http://google.com or other sites in your whitelist i get good answer - 200
r.status_code = 200