<jupyter_start><jupyter_text>**☄ Files To Drive**-> upload any file to your Google drive -> if you want more storage in colab change runtime type to gpumade by *Shinas* with ♥ 1.First run this<jupyter_code>from google.colab import drive #this code will connect your Gdrive with colab
drive.mount('/content/drive')<jupyter_output>Mounted at /content/drive<jupyter_text>2.now this:<jupyter_code>#this will install required tools
!python -m pip install --upgrade pip setuptools wheel && python -m pip install lbry-libtorrent && apt install python3-libtorrent<jupyter_output><empty_output><jupyter_text>3.and this<jupyter_code>#main code for Torrent to Gdrive 
import libtorrent as lt
import time
import datetime

def download_torrent():
    ses = lt.session()
    ses.listen_on(6881, 6891)
    link = input("Input Torrent Link or Magnet and Press Enter: ")
    print(link)

    handle = lt.add_magnet_uri(ses, link, params)
    handle.set_sequential_download(0) #change 0 to 1 if you want download in sequential order(only if you want to download in .zip format)

    ses.start_dht()
    begin = time.time()
    print(datetime.datetime.now())

    print('[*]Downloading Metadata')
    while not handle.has_metadata():
        time.sleep(1)
    print('[*]Starting Torrent Download')

    print("Starting", handle.name())

    while handle.status().state != lt.torrent_status.seeding:   #simple Downloading status code
        s = handle.status()
        state_str = ['queued', 'checking', 'downloading metadata',
                     'downloading', 'finished', 'seeding', 'allocating']
        print('%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s ' % \
              (s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \
               s.num_peers, state_str[s.state]))
        time.sleep(5)

    end = time.time()
    print(handle.name(), "COMPLETE")

    print("Elapsed Time: ", int((end - begin) // 60), "min :", int((end - begin) % 60), "sec")

    print(datetime.datetime.now())


zipp = input("if you want to zip the file,input 'y' else leave blank and Press Enter:")

if zipp == 'Y' or zipp == 'y': #zip you file
    zip_name = input("Input a name for the zip file: ")
    import shutil

    params = {
        'save_path': '/content/temp/',
        'storage_mode': lt.storage_mode_t(2),
    }
    download_torrent()

    print("now time to zip")

    print("Zipping ...")
    final_zip_directory = '/content/drive/MyDrive/Torrent/' + zip_name
    shutil.make_archive(final_zip_directory, 'zip', '/content/temp/')
    shutil.rmtree('/content/temp/')

else:
    params = {
        'save_path': '/content/drive/MyDrive/Torrent/', #change paths where you want to store 
        'storage_mode': lt.storage_mode_t(2),
    }
    download_torrent()

print('\n[*]ALL DONE!')<jupyter_output><empty_output><jupyter_text>Direct link to G Drive :<jupyter_code>#main code for Link to Gdrive by making use of Wget
link = input("[*]Input Direct link and Press Enter: ")
!wget -c $link -p "/content/drive/MyDrive/Torrent/"#change output path if you want to<jupyter_output><empty_output><jupyter_text>**speed test 💥:**<jupyter_code>pip install speedtest-cli >> /dev/null #module for speed test
#main code for speed test 
import speedtest as st
speed_test = st.Speedtest()
speed_test.get_best_server()

    # Get ping (miliseconds)
ping = speed_test.results.ping
    # Perform download and upload speed tests (bits per second)
download = speed_test.download()
upload = speed_test.upload()

    # Convert download and upload speeds to megabits per second
download_mbs = round(download / (10**6), 2)
upload_mbs = round(upload / (10**6), 2)
print("[*]Ping :",ping)
print("[*]Download in Bits:",download)
print("[*]Upload in Bits:",upload)
print("[*]Download in Mb:",download_mbs)
print("[*]Upload  in Mb:",upload_mbs)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13559761472647136, 'fraction_numerical': 0.011667098781436349, 'mean_word_length': 3.8467336683417086, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '335001', 'license': 'MIT', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1253, 'n_words': 358, 'path': 'FToG.ipynb', 'repo_name': 'shinas101/LToG', 'size': '3857'}