JustPaste.it

 <center><img src='https://drive.google.com/uc?export=view&id=1w4Wrp4RNpAYCElg773KPr87P0TR419cc' height="100" /> </center>  # <center> **Indrajith's OnaHuptak Downloader**  <center><b><h1>ඉන්ද්‍රජිත්ගේ ඕනහුප්ටක් ඩවුන්ලෝඩර් එක</b></h2></center> <center><h2>ඕනම direct link එකක්, කීපයක්, TS හෝ m3u8 stream එකක්, torrent එකක් හෝ mega.co.nz ලින්ක් එකක් තමන්ගේ Google drive එකට බා ගන්න මේකෙන් පුළුවන්.</h2></center> <justify><h8>මේකට ඉතින් උඹේ google drive එකට sign in වෙලා ඉන්න ඕන. උඹේ drive එකට <b>mount කරද්දී Google Drive එකට write access අවසර ඉල්ලනවා. (warning : not authored by Google කියලා. එතන run anyway කරහන්.)</b> ඒ ගැන බය වෙන්න එපා. කැමති අයට code එක බලන්න පුළුවන්. කිසිම privacy අවුලක් නෑ, උඹලා බාන දේවල් මටවත්, කාටවත් පේන්නේ නැහැ. පැය 12 කින් Disconnect වුණ ගමන් access අයින් වෙනවා. කැමති නම් කලින්ම runtime ගිහින් disconnect කරපන්. <b>Privacy අවුල්ම නම් මේකෙන් බාන්නම කියලා වෙනම google account එකක් හදා ගනින්.</b></h8></justify></br> <justify><h8><br>මේකේ location හෝ path කියලා තියෙන්නේ බාන්න අවශ්‍ය තැන. content/drive/My Drive/ වලට බෑවාම කෙළින්ම google drive ගිය ගමන් පේන තැනට බෑවෙනවා. එහෙම අකැමති නම් folder හදලා ඒවායේ path දාපන්. උදා : Torrents කියලා folder එකක් තියෙනවා නම් content/drive/My Drive/Torrents/. <b>folder නිසා අන්තිමට slash ( / ) එකක් තියෙන්න ඕන.</b> </h8></justify><br> <justify><h8><br>දාන දේවල් දාලා <b>ඊතලෙන් පෙන්නලා තියෙන තැන තියෙන play වගේ button එක ඔබලා run කරාම හරි</b>. ඉවර වෙලා යටින් හරියක් වැටුණාම වැඩේ ඉවරයි. කැමති නම් ඉවර වෙනකල්ම බලාගෙන ඉන්නත් පුළුවන්, හැබැයි එහෙම ඕනෙම නෑ. <b>Run වෙන්න ගත්තාට පස්සේ මේකෙන් අයින් වුණත් download වෙලා උඹේ drive එකට ෆයිල් එක බෑවිලා තියෙයි.</b></h8></justify><br> <justify><h8><br>මොකක් හරි අපැහැදිලි තැනක් තිබුණොත් මම fb ඉන්නවා. මේක හදපු busyindrajith777@gmail.com මගේම email එක. ඔය දෙවිදිහෙන් මාව contact කරපන්.</b></h8></justify><br> <center><h3>එහෙනම් මේක පාවිච්චි කරලා ඕන හුප්ටක් බා ගනින්. බුදු සරණයි!! </h3><br>    #@title ← Run Direct Downloader<center>  ලින්ක් එකකුයි, නමකුයි (අවශ්‍ය නම් location) දාලා run කරපන් </center> { display-mode: "form" } import os Download_link = "" #@param {type:"string"} File_name = "" #@param {type:"string"} Location = "/content/drive/My Drive/" #@param {type:"string"}   from google.colab import drive drive.mount("/content/drive/")  !wget --no-use-server-timestamps -O "$Location$File_name" "$Download_link"   #@title ← Run Accelerated Downloader with Resume<center>  ලින්ක් එකකුයි, නමකුයි (අවශ්‍ය නම් location) දාලා, connection ගාණක් තෝරලා run කරපන් </center> { display-mode: "form" } import os from google.colab.output import eval_js eval_js('google.colab.output.setIframeHeight("150")')  Download_link = "" #@param {type:"string"} File_name = "" #@param {type:"string"} Location = "drive/MyDrive/" #@param {type:"string"} Connections = "32" #@param [1, 2, 4, 8, 16, 32, 64] {allow-input: true} Connections = int(Connections)  from google.colab import drive drive.mount("/content/drive/")   !sudo apt update --assume-yes axel > /dev/null 2>&1 !sudo apt install --assume-yes axel > /dev/null 2>&1 print("Downloading...") !axel -n $Connections -o "$Location$File_name" "$Download_link" print("දැන් හරි. Drive එකේ බලපන්.")  #@title ← Run Aria2c Downloader with Resume<center>  ලින්ක් එකකුයි, නමකුයි (අවශ්‍ය නම් location) දාලා, connection ගාණක් තෝරලා run කරපන් </center> { display-mode: "form" } import os  Download_link = "" #@param {type:"string"} File_name = "" #@param {type:"string"} Location = "drive/MyDrive/" #@param {type:"string"} Connections = "16" #@param [1, 2, 4, 8, 12, 16] {allow-input: false} Connections = int(Connections)  from google.colab import drive drive.mount("/content/drive/")  !sudo apt-get install aria2 > /dev/null 2>&1 !aria2c -x$Connections "$Download_link" -d "$Location" -o "$File_name" --summary-interval=5 --seed-time=0  print("දැන් හරි. Drive එකේ බලපන්.")  from google.colab import drive drive.mount('/content/drive')  #@title ← Run TS or m3u8 Downloader <center> </font>  TS හෝ m3u8 Stream එකේ ලින්ක් එක, නමක් (සහ අවශ්‍ය නම් location) දාල run කරපන් </center> { display-mode: "form" } import os Download_link = "" #@param {type:"string"} File_name = "" #@param {type:"string"} Location = "drive/My Drive/" #@param {type:"string"}   !apt-get install ffmpeg !ffmpeg -i "$Download_link" -c copy -bsf:a aac_adtstoasc "$File_name" !mv "$File_name" "$Location"  #@title ← Run Torrent Downloader<center>  Magnet ලින්ක් එක (අවශ්‍ය නම් location) දාලා run කරපන් </center> { display-mode: "form" } import os  !pip install libtorrent  import libtorrent as lt import warnings warnings.filterwarnings("ignore", category=DeprecationWarning)  ses = lt.session() ses.listen_on(6881, 6891) downloads = []  from google.colab import drive drive.mount("/content/drive")  Magnet_link = "" #@param {type:"string"} Location = "/content/drive/My Drive/" #@param {type:"string"}  params = {"save_path": Location}   magnet_link = Magnet_link print("Downloading to ", Location) downloads.append(         lt.add_magnet_uri(ses, magnet_link, params) )  import time  from IPython.display import display import ipywidgets as widgets  state_str = [     "queued",     "checking",     "downloading metadata",     "downloading",     "finished",     "seeding",     "allocating",     "checking fastresume", ]  layout = widgets.Layout(width="auto") style = {"description_width": "initial"} download_bars = [     widgets.FloatSlider(         step=0.01, disabled=True, layout=layout, style=style     )     for _ in downloads ] display(*download_bars)  while downloads:     next_shift = 0     for index, download in enumerate(downloads[:]):         bar = download_bars[index + next_shift]         if not download.is_seed():             s = download.status()              bar.description = " ".join(                 [                     download.name(),                     str(s.download_rate / 1000),                     "kB/s",                     state_str[s.state],                 ]             )             bar.value = s.progress * 100         else:             next_shift -= 1             ses.remove_torrent(download)             downloads.remove(download)             bar.close()              download_bars.remove(bar)             print("Downloading වෙලා ඉවරයි. විනාඩි දෙකකින් විතර Google Drive එක බලපන්")     time.sleep(1) magnet_link = ""   #@title ← Run Torrent File Downloader<center> අවශ්‍ය නම් Location දාලා මේක run කරලා, prompt එක ආවාම browse/choose files ඔබලා, torrent file එක තෝරපන් </center> { display-mode: "form" } import os  !pip install libtorrent  import libtorrent as lt import warnings warnings.filterwarnings("ignore", category=DeprecationWarning)  ses = lt.session() ses.listen_on(6881, 6891) downloads = []  from google.colab import drive drive.mount("/content/drive")  Location = "/content/drive/My Drive/" #@param {type:"string"}  from google.colab import files  source = files.upload() params = {     "save_path": "/content/drive/My Drive/Torrent",     "ti": lt.torrent_info(list(source.keys())[0]), } downloads.append(ses.add_torrent(params))  import time  from IPython.display import display import ipywidgets as widgets  state_str = [     "queued",     "checking",     "downloading metadata",     "downloading",     "finished",     "seeding",     "allocating",     "checking fastresume", ]  layout = widgets.Layout(width="auto") style = {"description_width": "initial"} download_bars = [     widgets.FloatSlider(         step=0.01, disabled=True, layout=layout, style=style     )     for _ in downloads ] display(*download_bars)  while downloads:     next_shift = 0     for index, download in enumerate(downloads[:]):         bar = download_bars[index + next_shift]         if not download.is_seed():             s = download.status()              bar.description = " ".join(                 [                     download.name(),                     str(s.download_rate / 1000),                     "kB/s",                     state_str[s.state],                 ]             )             bar.value = s.progress * 100         else:             next_shift -= 1             ses.remove_torrent(download)             downloads.remove(download)             bar.close()              download_bars.remove(bar)             print("Downloading වෙලා ඉවරයි. විනාඩි දෙකකින් විතර Google Drive එක බලපන්")     time.sleep(1) magnet_link = ""   #@title ← Run Multy Torrent Downloader <center> </font>  මේකෙන් කැමති Torrent ගාණක් එකපාර බාපන් </center> { display-mode: "form" } #@markdown #####_කැමති location එකක් දාලා Run කරාම අහන ප්‍රශ්නවලට අනුව Torrent ගාණ දාලා enter කරපන්.._ #@markdown #####_ඊට පස්සේ එකෙන් එකට Magnet ලින්ක් ටික දාගෙන යන්න තියෙන්නෙ._ #@markdown #####_දාලා ඉවර වුණාම එක දිගට සේරම බෑවෙනවා. තත්පර දහයෙන් දහයට torrent එකේ status update එයි._ import os  from google.colab import drive drive.mount("/content/drive/") Location = "drive/MyDrive/" #@param {type:"string"}  total = input("Torrent කීයක්ද මචන්? (ඉලක්කමක් දාලා enter කරපන්) : ") total = int(total) link = [""]*total Templink = "" for i in range (total):   print ("Torrent අංක", i+1)   link[i] = input("Magnet link එක දාලා enter ගහපන් : ")   print ("හරි, දැන් ඊළඟ එක..")  !sudo apt-get install aria2 > /dev/null 2>&1  for j in range (total):   Templink = link[j]   print("දැන් බාන්නෙ :", j+1, "වන Torrent එක")   print(Templink)   !aria2c -x16 "$Templink" -d "$Location" --summary-interval=10 --seed-time=0   print("මේක බාලා ඉවරයි. Drive එකේ බලපන්.")  print("වැඩේ හරි, උඹ දාපු Torrent ", total, "ම බාලා ඉවරයි.")  #@title ← Run Multy Downloader <center> </font>  මේකෙන් කැමති ලින්ක් ගාණක් එකපාර බාපන් </center> { display-mode: "form" } #@markdown #####_Run කරාම අහන ප්‍රශ්නවලට අනුව ලින්ක් ගාණ දාලා enter කරපන්.._ #@markdown #####_ඊට පස්සේ එකෙන් එකට ලින්ක් ටිකයි, ෆයිල් නම් ටිකයි දාගෙන යන්න තියෙන්නෙ._ #@markdown #####_දාලා ඉවර වුණාම එක දිගට සේරම බෑවෙනවා._  from google.colab import drive drive.mount("/content/drive/") total = input("ලින්ක් කීයක්ද මචන්? (ඉලක්කමක් දාලා enter කරපන්) : ") total = int(total) link = [""]*total name = [""]*total for i in range (total):   print ("ෆයිල් අංක", i+1)   link[i] = input("ලින්ක් එක දාලා enter ගහපන් : ")   name[i] = input("නමක් දාලා enter ගහපන් : ")   print ("හරි, දැන් ඊළඟ එක..")  import urllib.request import shutil import sys import time  def reporthook(count, block_size, total_size):     global start_time     if count == 0:         start_time = time.time()         return     duration = time.time() - start_time     progress_size = int(count * block_size)     speed = int(progress_size / (1024 * duration))     percent = int(count * block_size * 100 / total_size)     step = int(percent/2)     eta = (total_size/speed/1024)     done = "░"     for i in range (step):       done+="░"     sys.stdout.write("\r%d%%, %d MB of %d MB, at %d KB/s, time elapsed = %ds, ETA = %ds %s" %                     (percent, progress_size / (1024 * 1024), total_size / (1024 * 1024), speed, duration, eta, done))   def save(url, filename):     urllib.request.urlretrieve(url, filename, reporthook)  for j in range (total):   print("දැන් බාන්නෙ :", name[j])   save(link[j], name[j])   shutil.move(name[j], "/content/drive/My Drive/")   print("")   print(name[j], "මේක බාලා ඉවරයි. Drive එකේ බලපන්.")  print("වැඩේ හරි, උඹ දාපු ලින්ක් ", total, "ම බාලා ඉවරයි.")  from google.colab import drive drive.mount("/content/drive/")  import sys, os, urllib.request import time import subprocess import contextlib from IPython.display import clear_output #@markdown <center><h3>Mega.nz ලින්ක් එකක් (අවශ්‍ය නම් location) දාලා Run කරපන් </h2></center><br> HOME = os.path.expanduser("~") if not os.path.exists(f"{HOME}/.ipython/ocr.py"):     hCode = "https://raw.githubusercontent.com/biplobsd/" \                 "OneClickRun/master/res/ocr.py"     urllib.request.urlretrieve(hCode, f"{HOME}/.ipython/ocr.py")  from ocr import (     runSh,     loadingAn, ) #@title ← Run Mega Downloader URL = "" #@param {type:"string"} OUTPUT_PATH = "/content/drive/My Drive/" #@param {type:"string"} #@markdown #####_*සමහර වෙලාවට මේක ඉබේ නතර වෙන්නේ නැහැ. එහෙම වුණොත් stop කරපන්_ if not OUTPUT_PATH:   os.makedirs("downloads", exist_ok=True)   OUTPUT_PATH = "downloads" # MEGAcmd installing if not os.path.exists("/usr/bin/mega-cmd"):     loadingAn()     print("Installing MEGA ...")     runSh('sudo apt-get -y update')     runSh('sudo apt-get -y install libmms0 libc-ares2 libc6 libcrypto++6 libgcc1 libmediainfo0v5 libpcre3 libpcrecpp0v5 libssl1.1 libstdc++6 libzen0v5 zlib1g apt-transport-https')     runSh('sudo curl -sL -o /var/cache/apt/archives/MEGAcmd.deb https://mega.nz/linux/MEGAsync/Debian_9.0/amd64/megacmd-Debian_9.0_amd64.deb', output=True)     runSh('sudo dpkg -i /var/cache/apt/archives/MEGAcmd.deb', output=True)     print("MEGA is installed.")     clear_output()  # Unix, Windows and old Macintosh end-of-line newlines = ['\n', '\r\n', '\r']  def unbuffered(proc, stream='stdout'):     stream = getattr(proc, stream)     with contextlib.closing(stream):         while True:             out = []             last = stream.read(1)             # Don't loop forever             if last == '' and proc.poll() is not None:                 break             while last not in newlines:                 # Don't loop forever                 if last == '' and proc.poll() is not None:                     break                 out.append(last)                 last = stream.read(1)             out = ''.join(out)             yield out   def transfar():     import codecs     decoder = codecs.getincrementaldecoder("UTF-8")()     cmd = ["mega-get", URL, OUTPUT_PATH]     proc = subprocess.Popen(         cmd,         stdout=subprocess.PIPE,         stderr=subprocess.STDOUT,         # Make all end-of-lines '\n'         universal_newlines=True,     )     for line in unbuffered(proc):         print(line)            transfar()