Python "Unable to resolve" hatası

russian.pancake

Centipat
Katılım
14 Ekim 2020
Mesajlar
498
Kod:
#-Modules import----------
from time import sleep #We import sleep function to use pauses.
from getpass import getpass #We import getpass function to get a password without echoing it.
import httplib #We use httplib to deal with data requests.
from pyamf import AMF3 #We import the AMF3 variable.
from pyamf import remoting #We import the remoting submodule to deal with AMF3 data.

#-Get login informations----------
print("----------1337 hax0r client by artania----------") #To get a nice render.
print("")
print("")
print("")
print("Enter your login :")
login = raw_input() #Put login in login variable.
password = getpass("Enter your password :") #Put password in password variable using non-echoing function.

#-Connect to MovieStarPlanet----------
headers = { "Host":"ws.moviestarplanet.fr", "Origin":"https://cdn.moviestarplanet.fr", "X-Requested-With":"ShockwaveFlash/17.0.0.188", "User-Agent":"Chrome/43.0.2357.81", "Content-Type":"application/x-amf", "Accept":"*/*" } #Headers for the request.
host = "ws.moviestarplanet.fr" #Set the connect host.

requestTarget = "MovieStarPlanet.WebService.User.AMFUserServiceWeb.Login" #Set the request target to login.
loginInfo = [ login, password, [ 1234567890.0 ], None ] #Put the login informations in an array named loginInfo.
message = remoting.Envelope(amfVersion=AMF3) #Set the AMF version to 3
message['/1'] = remoting.Request(target=requestTarget, body=loginInfo) #Add the login informations and target to the AMF message.

body = remoting.encode(message).getvalue() #Encode the message (output a byte stream) read bytes and put them in body variable.
connection = httplib.HTTPConnection(host) #Start the connection to the host.
connection.request("POST", "/Gateway.aspx", body, headers) #Send the request made previously.
response = connection.getresponse() #Get the response from the server.

if (response.status == 200):
 data = response.read() #Read the response.
connection.close() #Stop the connection.
print("Successfully connected to the server") #Let's print a little message.

print("Error")

#-Get player id and ticket----------
decoded = remoting.decode(data) #Decode data in decoded.
playerId = decoded['/1'].body.get('loginStatus').get('actor').get('ActorId') #Store player id.
ticket = decoded['/1'].body.get('loginStatus').get('ticket') #Store ticket.
print("Player ID : " + str(playerId)) #Print player id.
print("Ticket : " + str(ticket)) #Print ticket.

#-Starcoins rain----------
movieId = 20036930 #The movie id that we got earlier.
fames = 0 #Number of fames gained.
starcoins = 0 #Number of starcoins gained.
while True: #Let's loop forever !
 requestTarget = "MovieStarPlanet.WebService.MovieService.AMFMovieService.MovieWatched" #Set the request to watch a movie.
watchInfo = [ { 'Ticket' : ticket + 'fa83a11a198d5a7f0bf77a1987bcd006383430', 'anyAttribute' : None }, movieId, playerId ] #Put the informations into a watchInfo array (Ticket = ticket got earlier + hash found at the same place in recorded MovieWatched)
message = remoting.Envelope(amfVersion=AMF3) #Set the AMF version to 3
message['/1'] = remoting.Request(target=requestTarget, body=watchInfo) #Add the watch information and the target to the AMF message.

body = remoting.encode(message).getvalue() #Encode the message and put it in body.
connection = httplib.HTTPConnection(host) #Start connection to the host set earlier.
connection.request("POST", "/Gateway.aspx", body, headers) #Send the request to the host using headers set earlier.
response = connection.getresponse() #Get the response from the server.

if (response.status == 200):
 data = response.read()
 connection.close()
else:
 print("Error")

decoded = remoting.decode(data) #Decode data.
print("+ " + str(decoded['/1'].body.get('awardedFame')) + " fames") #Print fames earned.
fames += decoded['/1'].body.get('awardedFame') #Add the fames earned.

sleep(5) #Wait five seconds.

requestTarget = "MovieStarPlanet.WebService.MovieService.AMFMovieService.RateMovie" #Set the request to rate a movie.
rateInfo = [ { 'Ticket' : ticket + '92fb0c6d1758261f10d052e6e2c1123c383531', 'anyAttribute' : None }, { 'Comment' : '', 'Score' : 4, 'MovieId' : movieId, 'RateMovieId' : 0, 'RateDate' : '2016-04-13 17:29:40.346000', 'ActorId' : playerId } ] #Put the informations into a rateInfo array (Ticket = ticket got earlier + hash found at the same place in recorded RateMovie)
message = remoting.Envelope(amfVersion=AMF3) #Set the AMF version to 3
message['/1'] = remoting.Request(target=requestTarget, body=rateInfo) #Add the rate information and the target to the AMF message.

body = remoting.encode(message).getvalue() #Encode the message and put it in body.
connection = httplib.HTTPConnection(host) #Start connection to the host set earlier.
connection.request("POST", "/Gateway.aspx", body, headers) #Send the request to the host using headers set earlier.
response = connection.getresponse()

if (response.status == 200):
 data = response.read()
 connection.close()
else:
 print("Error")

decoded = remoting.decode(data) #Decode data.
print("+ " + str(decoded['/1'].body.get('awardedFame')) + " fames") #Print fames earned.
print("+ " + str(decoded['/1'].body.get('awardedStarCoins')) + " starcoins") #Print starcoins earned.
fames += decoded['/1'].body.get('awardedFame') #Add the fames earned.
starcoins += decoded['/1'].body.get('awardedStarCoins') #Add the starcoins earned.
print("S : " + str(starcoins) + " | F : " + str(fames)) #Print everything.

movieId += 1 #Increment movie id.
sleep(5) #Sleep again five seconds.

input() #Wait for an input.

Elimde böyle bir kod var ama hatalı.
Oyunda basit autograph yapıyor.

Hata 1:
Önem derecesi kod açıklama proje dosya çizgi gizleme durumu.
Uyarı unable to Resolve 'httplib'. Intellisense may be missing for this module. Pythonapplication1 C:\Users\xxt\source\repos\PythonApplication1\PythonApplication1\PythonApplication1.py 4

Hata 2:
Önem derecesi kod açıklama proje dosya çizgi gizleme durumu.
Uyarı unable to Resolve 'pyamf'. Intellisense may be missing for this module. Pythonapplication1 C:\Users\xxt\source\repos\PythonApplication1\PythonApplication1\PythonApplication1.py 5

Hata 3:
Önem derecesi kod açıklama proje dosya çizgi gizleme durumu.
Uyarı unable to Resolve 'pyamf'. Intellisense may be missing for this module. Pythonapplication1 C:\Users\xxt\source\repos\PythonApplication1\PythonApplication1\PythonApplication1.py 6
 
Son düzenleme:
Uyarı! Bu konu 5 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Technopat Haberler

Yeni konular

Geri
Yukarı