vendredi 27 novembre 2020

How can I download a file from my infinity free sever

I'm trying to do a python program that downloads a python file from my infinityfree server. So i tried this

codeurl='http://datacheck.freecluster.eu/Code/Spammer/Spammer001.py'
r = requests.get(codeurl, allow_redirects=True)
open('Spammer001.py','wb').write(r.content)

It downloads this:

<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("1beed73e028319817cbb6921f00624cf");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://datacheck.freecluster.eu/Code/Spammer/Spammer001.py?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>

Which is isn't even the code that appears on the browser.

<html data-lt-installed="true"><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">from pynput import keyboard
import pyautogui
import time 
import random 
import requests 
from bs4 import BeautifulSoup

URL1 = 'https://sites.google.com/view/checkcodepropnt/chacc'
page1 = requests.get(URL1)

soup1 = BeautifulSoup(page1.content, 'html.parser')

results1 = soup1.find(class_='CDt4Ke zfr3Q TMjjoe')

usable1 = str(results1.prettify())
usable3 = usable1.split('\n')[:2]
usabledef = usable3[1].replace(" ","")
print(usabledef)

r = requests.get()

def on_press(key):
    global break_program
    print (key)
    if key == keyboard.Key.esc:
        print ('end pressed')
        break_program = True
        return False

if (usabledef == "true"):
    print("Usable")</pre></body></html>

I only want the file, and if it isn't possible is there any way to remove all the html code and only keep the text inside?

from pynput import keyboard
    import pyautogui
    import time 
    import random 
    import requests 
    from bs4 import BeautifulSoup
    
    URL1 = 'https://sites.google.com/view/checkcodepropnt/chacc'
    page1 = requests.get(URL1)
    
    soup1 = BeautifulSoup(page1.content, 'html.parser')
    
    results1 = soup1.find(class_='CDt4Ke zfr3Q TMjjoe')
    
    usable1 = str(results1.prettify())
    usable3 = usable1.split('\n')[:2]
    usabledef = usable3[1].replace(" ","")
    print(usabledef)
    
    r = requests.get()
    
    def on_press(key):
        global break_program
        print (key)
        if key == keyboard.Key.esc:
            print ('end pressed')
            break_program = True
            return False
    
    if (usabledef == "true"):
        print("Usable")



Aucun commentaire:

Enregistrer un commentaire