Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: utf-8
- require 'rubygems'
- require 'mechanize'
- require 'pathname'
- $folder = ARGV[0]
- $foldercaps = $folder.upcase
- if ARGV.length > 1 and not (ARGV[1] == "-F" or ARGV[1] == "-f")
- $imdblink = ARGV[1]
- else
- $imdblink = ""
- end
- if ARGV.length > 3
- print("Too many arguments given. Ignoring them.")
- end
- # Do not use directories with spaces in them.
- # Path for all the files
- $fpath = "C:/something/" !!!!!!!!!!
- # Temporary path
- $tpath = $fpath + $folder + "-temp12345/"
- # Path where to put torrent files
- $torpath = "C:/something/" !!!!!!!!!!
- # Path for 7-Zip
- $zpath = "C:/something/7z.exe" !!!!!!!!!!
- # Path to Mediainfo Command Line version
- $mpath = "C:/something/Mediainfo_CLI/mediainfo.exe" !!!!!!!!!!
- # Tracker url
- $trackerurl = ""
- # Command line for your torrent creator
- $torrentword_general = "py3createtorrent.py -P -f --exclude-pattern \"(\\.jpg|\\.rar|\\.sfv|\\.r..|\\.message)$\" -o " + $torpath + " " + $fpath + $folder + " tc"
- $torrentword_encode = "py3createtorrent.py -P -f --exclude-pattern \"(\\.m2ts|\\.jpg|\\.rar|\\.sfv|\\.r..|\\.message)$\" -o " + $torpath + " " + $fpath + $folder + " tc"
- # If files might contain rared content
- $archives = 1
- # 1 if windows, 0 if linux
- $os_windows = 1
- # 1 if you wish to be warned about possible duplicates
- $check_for_duplicates = 1
- # 1 if you wish not to upload adult content
- $no_adult = 1
- # Logins
- $username = "" !!!!!!!!!!
- $password = "" !!!!!!!!!!
- # FORCE UPLOAD
- if ARGV.include?("-f") or ARGV.include?("-F")
- $no_adult = 0
- $check_for_duplicates = 0
- end
- # Banned groups
- $banlist = []
- $banlist.push("aXXo", "DEViSE", "FLAWL3SS", "FZHD", "KingBen", "KLAXXON")
- $banlist.push("LTRG", "NhaNc3", "PRODJi", "SANTi", "VAMPS", "WHiiZz")
- # Scenelist
- $scenelist = []
- $scenelist.push("7SinS","8BaLLRiPS")
- $scenelist.push("AN0NYM0US","ALLiANCE","AEN","aBD","AMIABLE","AiRLiNE","aAF","ARC","AFO","AEROHOLiCS")
- $scenelist.push("ARTHOUSE")
- $scenelist.push("BAND1D0S","BRMP","BiQ","BOV")
- $scenelist.push("COCAIN","CQF","CiNEFiLE","CMBHD","CoWRY","Counterfeit","CROKY")
- $scenelist.push("D3Si","DAA","DoNE","DEiMOS","DeBTXViD","DEMENTED","DEFiNiTE")
- $scenelist.push("EXVID","EwDp","ESPiSE","EXViDiNT","ERODELUXE","ETM","EPiSODE")
- $scenelist.push("FiCO","FLAiR","FUTIL","FAiLED","FRAGMENT")
- $scenelist.push("GECKOS","GERUDO","GALT","GxP","GeT")
- $scenelist.push("HD4U","HAGGiS","HLS","hV")
- $scenelist.push("iNFAMOUS","INSECTS","iGNiTiON","iNVANDRAREN","iND","IGUANA","IcHoR","iTCH","IMDBFIXTERMINATOR")
- $scenelist.push("iNVENTiONAL","ilLG","iNjECTiON","iMSORNY")
- $scenelist.push("Japhson","JETSET")
- $scenelist.push("KAFFEREP","KaKa","KiNOBOX","KYR")
- $scenelist.push("Ltu","LiViDiTY","Larceny","LCHD","LOUNG3D","LAP","LACHUH")
- $scenelist.push("MELiTE","MORTAL","MULTiPLY","MCHD","MOOVEE","MOMENTUM","MAGiCBOX")
- $scenelist.push("NERD","NODLABS","NOSCREENS","NeDiVx","NORDiCHD","NoSence","NnD","nDn","N0L")
- $scenelist.push("Ouzo","OSiTV")
- $scenelist.push("PARADiSE","PFa","PSYCHD","PURE","PFa","PHOBOS","PROD","PPi","ProPL")
- $scenelist.push("QCF","QoM")
- $scenelist.push("ROVERS","RUSTED","RedBlade","ROUGH","RedBlade","REACTOR","RiTALiX","RAWNiTRO")
- $scenelist.push("SPRiNTER","SML","SKA","SMAHD","SCREAM","SMOKEY","SPARKS","SCARED","SViNTO","SKiTFiSKE")
- $scenelist.push("Taurine","TASTE","TASTETV","TUSAHD","TRexHD","Trojan","TWiST","TARGET","TXF","TED")
- $scenelist.push("TWiZTED")
- $scenelist.push("ULSHD","UNVEiL","USi")
- $scenelist.push("VERYMUCH","VETO","VeDeTT","VoMiT","VhV")
- $scenelist.push("XSTREEM")
- $scenelist.push("WHiSKEY","WiDE","WaLMaRT","W4F")
- $imdb = ""
- $container = ""
- $extension = ""
- $desc = ""
- $format = ""
- $genre = ""
- $image = ""
- $mediainfo = ""
- $nfo = ""
- $nfocaps = ""
- $poster = ""
- $postername = ""
- $quality = ""
- $scrtxt = ""
- $scrurl = ""
- $source = ""
- $title = ""
- $type = ""
- $year = ""
- $remaster = 0
- $remasterinfo = ""
- $scene = 0
- $sceneinfo = ""
- $genre_adventure = 0
- $genre_animation = 0
- $genre_biography = 0
- $genre_crime = 0
- $genre_family = 0
- $genre_fantasy = 0
- $genre_filmnoir = 0
- $genre_horror = 0
- $genre_history = 0
- $genre_reality = 0
- $genre_music = 0
- $genre_mystery = 0
- $genre_romance = 0
- $genre_scifi = 0
- $genre_sport = 0
- $genre_thriller = 0
- $genre_war = 0
- $genre_western = 0
- def numeric?(object)
- true if Float(object) rescue false
- end
- def os_walk(dir)
- root = Pathname(dir)
- files, dirs = [], []
- Pathname(root).find do |path|
- unless path == root
- dirs << path if path.directory?
- files << path if path.file?
- end
- end
- [root, files, dirs]
- end
- def unrar(files)
- for filee in files
- if File.extname(filee).to_s == ".r00" or File.extname(filee).to_s == ".7z"
- system($zpath + " x \"" + filee.to_s + "\" -y -aos -o" + File.dirname(filee).to_s + " -r-")
- elsif File.extname(filee).to_s == ".rar" and not (File.basename(filee).to_s.include? ".part" and numeric?(File.basename(filee)[File.basename(filee).length - 5].to_s))
- system($zpath + " x \"" + filee.to_s + "\" -y -o" + File.dirname(filee).to_s + " -r-")
- else
- system($zpath + " x \"" + filee.to_s + "\" -y -aos -o" + File.dirname(filee).to_s + " -r-")
- end
- end
- end
- def create_temp()
- if not FileTest::directory?($tpath)
- Dir::mkdir($tpath)
- else
- abort("Temporary folder already exists.")
- end
- print("Temporary directory created.")
- print("\n")
- end
- def quit(message)
- print("\n")
- FileUtils.rm_rf($tpath)
- print("Temporary folder deleted." + "\n")
- print("Some info:\n")
- print("imdb: " + $imdblink + "\n")
- if $nfo == ""
- print("nfo empty." + "\n")
- end
- if $mediainfo == ""
- print("mediainfo empty." + "\n")
- end
- print("source: " + $source + "\n")
- print("quality: " + $quality + "\n")
- print("format: " + $format + "\n")
- print("container: " + $container + "\n")
- print("year: " + $year + "\n")
- print("title: " + $title + "\n")
- print("desc: " + $desc + "\n")
- print("genre: " + $genre + "\n")
- print("type: " + $type + "\n")
- print("scrtxt: " + $scrtxt + "\n")
- print("imdb: " + $imdb + "\n")
- abort(message)
- end
- def check_scene()
- # Scene folders do not have spaces, they have dots and at least 1 -
- if (not $folder.include?(" ")) and $folder.count(".") > 1 and $folder.include?("-")
- b = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- b.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- # Get scene information from predb.me
- begin
- b.get('http://predb.me/?search=' + $folder) do |page|
- page.encoding = "utf-8"
- if not page.body.include?("<h3>Error!</h3></div><div class=\"block-text\">Nothing found...")
- $scene = 1
- print("predb.me says: it's a scene release.\n")
- end
- end
- # If predb.me doesn't work, use the list
- rescue
- print("Could not use predb, using old system instead.\n")
- for i in $scenelist
- if $folder.end_with? i
- $scene = 1
- print("List says: it's a scene release.\n")
- end
- end
- end
- # Get scene information from srrDB.com
- begin
- b.get('http://www.srrdb.com/release/details/' + $folder) do |page|
- page.encoding = "utf-8"
- if not page.body.include?("<h4>404 - Not found</h4>")
- $scene = 1
- print("srrDB says: it's a scene release.\n")
- end
- end
- # If srrDB.com doesn't work, use the list
- rescue
- print("Could not use predb, using old system instead.\n")
- for i in $scenelist
- if $folder.end_with? i
- $scene = 1
- print("List says: it's a scene release.\n")
- end
- end
- end
- end
- # Special scene info
- if $scene == 1
- if $foldercaps.include? ".PROPER."
- $sceneinfo = "Proper"
- end
- if $foldercaps.include? ".RERIP."
- $sceneinfo = "Rerip"
- end
- if $foldercaps.include? ".REPACK."
- $sceneinfo = "Repack"
- end
- if $foldercaps.include? ".REAL.PROPER."
- $sceneinfo = "Real Proper"
- end
- end
- print("Scene info retrieved.\n")
- end
- def check_special_edition()
- if $foldercaps.include? ".UNRATED."
- $remaster = 1
- $remasterinfo = "Unrated"
- end
- if $foldercaps.include? ".DC."
- $remaster = 1
- $remasterinfo = "Director's Cut"
- end
- if $foldercaps.include? ".EXTENDED."
- $remaster = 1
- $remasterinfo = "Extended Edition"
- end
- if $foldercaps.include? ".SE."
- $remaster = 1
- $remasterinfo = "Special Edition"
- end
- if $foldercaps.include? ".CE."
- $remaster = 1
- $remasterinfo = "Collector's Edition"
- end
- if $foldercaps.include? ".RECUT."
- $remaster = 1
- $remasterinfo = "Recut"
- end
- if $foldercaps.include? ".RECUT."
- $remaster = 1
- $remasterinfo = "Recut"
- end
- if $foldercaps.include? ".WS."
- $remaster = 1
- $remasterinfo = "Widescreen"
- end
- if $foldercaps.include? ".REMASTERED."
- $remaster = 1
- $remasterinfo = "Remastered"
- end
- if $remaster == 1
- print("Special edition: " + $remasterinfo + "\n")
- end
- end
- def check_subtitles()
- root, files, dirs = os_walk($fpath + $folder)
- subcount = 0
- idxcount = 0
- for filee in files
- if File.extname(filee).to_s.upcase == ".SUB"
- subcount = subcount + 1
- end
- if File.extname(filee).to_s.upcase == ".IDX"
- idxcount = idxcount + 1
- end
- end
- if idxcount > 0 and not subcount == idxcount
- quit("The number of subtitle idx files does not equal the number of sub files.")
- end
- end
- def get_poster()
- begin
- if not $poster == ""
- # Get the imdb poster
- a = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- a.get($poster) do |page|
- page.encoding = "utf-8"
- if page.body.include? "<link rel=\"image_src\" href=\""
- list = page.body.split("<link rel=\"image_src\" href=\"")
- list = list[1].split(".jpg")
- else
- list = page.body.split("<link rel='image_src' href=\"")
- list = list[1].split(".jpg")
- end
- $poster = list[0] + ".jpg"
- list = $poster.split("/")
- $postername = list[list.length - 1]
- a.pluggable_parser.default = Mechanize::Download
- a.get($poster).save($tpath + $postername)
- print("Poster dl'd from IMDB.")
- print("\n")
- end
- print("Poster retrieved.")
- print("\n")
- if not try_to_up_to_freeimghosting()
- if not try_to_up_to_fotoshack()
- print("Poster too large. Searching tmdb to get smaller.")
- print("\n")
- get_poster_tmdb()
- print("Poster uploaded from tmdb.")
- print("\n")
- end
- end
- else
- get_poster_tmdb()
- print("Poster uploaded from tmdb.")
- print("\n")
- return true
- end
- rescue
- $poster = ""
- end
- end
- def get_poster_tmdb()
- link = ""
- name = ""
- b = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- b.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- b.get('http://www.themoviedb.org/search?query=tt' + $imdb) do |page|
- page.encoding = "utf-8"
- list = page.body.split("search_results movie\">")
- if list.length > 1
- list = list[1]
- list = list.split("<div class=\"info\">")
- list = list[1]
- list = list.split("<h3><a href=\"")
- list = list[1]
- list = list.split("\" title=\"")
- link = list[0]
- end
- end
- b.get('http://www.themoviedb.org/' + link + "/posters") do |page|
- page.encoding = "utf-8"
- list = page.body.split("<img id=\"upload_poster\"")
- list = list[1]
- list = list.split("src=\"")
- list = list[1]
- list = list.split(".jpg")
- list = list[0]
- name = link.split("/")
- link = list + ".jpg"
- b.pluggable_parser.default = Mechanize::Download
- $postername = name[name.length - 1]
- b.get(link).save($tpath + $postername)
- end
- # Try different hosts for the poster
- if not try_to_up_to_freeimghosting()
- try_to_up_to_fotoshack()
- end
- end
- def get_nfo()
- root, files, dirs = os_walk($fpath + $folder)
- if $imdblink == ""
- begin
- $nfo = ""
- for filee in files
- word = ""
- # Search all .nfo and .txt files but choose the first imdb link found.
- if (File.extname(filee).to_s.upcase == ".NFO" or File.extname(filee).to_s.upcase == ".TXT") and $nfo == ""
- $nfo = $nfo + "[spoiler=NFO][size=2][pre]"
- File.open(filee,"r:cp850:utf-8") do |f1|
- while line = f1.gets
- word = word + line
- end
- end
- $nfo = $nfo + word + "[/pre][/size][/spoiler]"
- list = [""]
- if word.include? "imdb.com/title/tt"
- list = word.split("imdb.com/title/tt")
- elsif word.include? "imdb.com/Title?"
- list = word.split("imdb.com/Title?")
- elsif word.include? "imdb.com/Plot?"
- list = word.split("imdb.com/Plot?")
- end
- word = list[1]
- truth = 1
- i = 0
- while truth == 1
- if numeric?(word[i])
- $imdb = $imdb + word[i]
- i = i + 1
- else
- truth = 0
- end
- end
- end
- end
- rescue
- $imdb == ""
- quit("No IMDB link or nfo file found.")
- end
- # Try to deduct the name
- if $imdb == ""
- name = deduct_name($folder)
- $imdb = compare_searches(name)
- end
- if $imdb == ""
- quit("No IMDB link or nfo file found.")
- end
- print("Imdb link retrieved.")
- print("\n")
- else
- list = $imdblink.split("imdb.com/title/tt")
- list = list[1].split("/")
- $imdb = list[0]
- end
- if ARGV.length >= 2
- $nfo = ""
- for filee in files
- word = ""
- if File.extname(filee).to_s == ".nfo"
- $nfo = $nfo + "[spoiler=NFO][size=2][pre]"
- File.open(filee,"r:cp850:utf-8") do |f1|
- while line = f1.gets
- word = word + line
- end
- end
- $nfo = $nfo + word + "[/pre][/size][/spoiler]"
- end
- end
- end
- if $nfo == "[spoiler=NFO][size=2][pre][/pre][/size][/spoiler]" or $nfo == "[spoiler=NFO][size=2][pre]"
- $nfo = ""
- end
- $nfocaps = $nfo.upcase
- print("NFO file retrieved.")
- print("\n")
- end
- def get_source()
- if $foldercaps.include? "TV" or $foldercaps.include? "TVRIP" or $foldercaps.include? "PDTV" or $foldercaps.include? "DTHEATER"
- $source = "Other"
- end
- if $foldercaps.include? ".CAM" or $foldercaps.include? " CAM"
- $source = "CAM (TS)"
- end
- if $foldercaps.include? ".R5" or $foldercaps.include? " R5"
- $source = "R5"
- end
- if $foldercaps.include? ".HDTV" or $foldercaps.include? "HDTV"
- $source = "HDTV"
- end
- if $foldercaps.include? ".DVD" or $foldercaps.include? " DVD"
- $source = "DVD"
- end
- if $foldercaps.include? ".HDDVD" or $foldercaps.include? ".HD.DVD" or $foldercaps.include? " HDDVD" or $foldercaps.include? " HD.DVD"
- $source = "HD-DVD"
- end
- if $foldercaps.include? ".BDRIP" or $foldercaps.include? " BDRIP"
- $source = "Blu-ray"
- end
- if $foldercaps.include? "SCREENER" or $foldercaps.include? "DVDSCR" or $foldercaps.include? "BDSCR"
- $source = "Screener"
- end
- if $foldercaps.include? ".BLURAY" or $foldercaps.include? "BLURAY"
- $source = "Blu-ray"
- end
- if $foldercaps.include? ".WEBDL" or $foldercaps.include? ".WEB-DL" or $foldercaps.include? ".WEBRIP"
- $source = "WEB-DL"
- end
- if $source == ""
- # Very unreliable, but might work sometimes
- if $nfocaps.include? "R5"
- $source = "R5"
- end
- if $nfocaps.include? "HDTV"
- $source = "HDTV"
- end
- if $nfocaps.include? "CAM"
- $source = "CAM (TS)"
- end
- if $nfocaps.include? "Screener"
- $source = "Screener"
- end
- if $nfocaps.include? "DVD"
- $source = "DVD"
- end
- if $nfocaps.include? "HDDVD" or $nfocaps.include? "HD-DVD"
- $source = "HD-DVD"
- end
- if $nfocaps.include? "WEB-DL" or $nfocaps.include? "WEBDL"
- $source = "WEB-DL"
- end
- if $nfocaps.include? "BLURAY" or $nfocaps.include? "BLU-RAY"
- $source = "Blu-ray"
- end
- end
- if $source == ""
- $source = "Other"
- end
- print("Source retrieved: " + $source)
- print("\n")
- end
- def get_quality()
- if $foldercaps.include? ".DVDRIP" or $foldercaps.include? " DVDRIP" or $foldercaps.include? "480p" or $foldercaps.include? ".SD" or $foldercaps.include? " SD"
- $quality = "Standard Def"
- end
- if $foldercaps.include? ".720P" or $foldercaps.include? " 720P"
- $quality = "720p"
- end
- if $foldercaps.include? ".1080P" or $foldercaps.include? " 1080P"
- $quality = "1080p"
- end
- if $foldercaps.include? ".1080I" or $foldercaps.include? " 1080I"
- $quality = "1080i"
- end
- if $quality == ""
- $quality = "Standard Def"
- end
- if $quality == ""
- quit("Quality unknown.")
- end
- print("Quality retrieved.")
- print("\n")
- end
- def get_format()
- if $foldercaps.include? ".DVDR" or $foldercaps.include? " DVDR" or $container.include? "DVDR"
- $format = "DVDR"
- end
- if $foldercaps.include? ".AVC" or $foldercaps.include? "AVC"
- $format = "AVC"
- end
- if $foldercaps.include? "VC-1"
- $format = "VC-1"
- end
- if $foldercaps.include? "MPEG-2"
- $format = "MPEG-2"
- end
- if $foldercaps.include? "X264"
- $format = "x264"
- end
- if $foldercaps.include? "DIVX"
- $format = "DivX"
- end
- if $foldercaps.include? "XVID"
- $format = "XviD"
- end
- if $foldercaps.include? "H264" or $foldercaps.include? "H.264" or $foldercaps.include? "H 264"
- $format = "h.264"
- end
- # Get format from mediainfo
- if $mediainfo.include?("Codec ID : V_MPEG4/ISO/AVC")
- $format = "h.264"
- end
- if $mediainfo.include?("Writing library : x264")
- $format = "x264"
- end
- if $mediainfo.include?("Writing library : XviD")
- $format = "XviD"
- end
- if $mediainfo.include?("Writing library : DivX")
- $format = "DivX"
- end
- # If not recognised
- if $format == ""
- quit("Format unknown.")
- end
- print("Format retrieved: " + $format)
- print("\n")
- end
- def get_container(largest_file)
- filee = largest_file
- if File.extname(filee).to_s.upcase == ".ISO" or File.extname(filee).to_s.upcase == ".VOB"
- if $foldercaps.include? "PAL"
- $container = "DVDR PAL"
- $extension = ".VOB"
- else
- $container = "DVDR NTSC"
- $extension = ".VOB"
- end
- end
- if File.extname(filee).to_s.upcase == ".M2TS"
- $container = "Blu-Ray"
- $extension = ".M2TS"
- end
- if File.extname(filee).to_s.upcase == ".EVO"
- $container = "HD-DVD"
- $extension = ".EVO"
- end
- if File.extname(filee).to_s.upcase == ".AVI"
- $container = "AVI"
- $extension = ".AVI"
- end
- if File.extname(filee).to_s.upcase == ".MKV"
- $container = "Matroska"
- $extension = ".MKV"
- end
- if File.extname(filee).to_s.upcase == ".TS"
- $container = "TS"
- $extension = ".TS"
- end
- if $container == ""
- quit("Container unknown.")
- end
- print("Container retrieved: " + $container)
- print("\n")
- end
- def screenshot_routine(filee)
- temp = $mediainfo.split("Display aspect ratio : ")
- temp = temp[1]
- temp = temp.split("\n")
- ratio = temp[0]
- temp = ratio.split(":")
- multiplier1 = temp[0]
- multiplier2 = temp[1]
- temp = $mediainfo.split("Width : ")
- temp = temp[1]
- temp = temp.split(" ")
- width = temp[0]
- temp = $mediainfo.split("Height : ")
- temp = temp[1]
- temp = temp.split(" ")
- height = temp[0]
- x_number = multiplier1.to_f * height.to_i
- y_number = multiplier2.to_f * height.to_i
- x_number = x_number.to_i
- y_number = y_number.to_i
- #must divisible by 2
- if not x_number % 2 == 0
- x_number = x_number + 1
- end
- if x_number < 1.03 * width.to_i and 0.97 * width.to_i < x_number
- x_number = width
- end
- x_number = x_number.to_s
- y_number = y_number.to_s
- screenshotlist = []
- screenshotsizelist = []
- $scrtxt = "[center][spoiler=Screenshots]\n"
- duration = get_duration()
- n = 10
- for count in 1..n do
- time = (count * duration / (n + 1)).floor
- #system("ffmpeg -loglevel warning -ss " + time.to_s + " -i \"" + filee.to_s + "\" -vframes 1 -f image2 \"" + $tpath + "screen" + count.to_s + ".png\"")
- if $source == "DVD" and $scene == 0
- system("ffmpeg -loglevel warning -ss " + time.to_s + " -i \"" + filee.to_s + "\" -vframes 1 -f image2 -s " + x_number + "x" + y_number + " \"" + $tpath + "screen" + count.to_s + ".png\"")
- else
- system("ffmpeg -loglevel warning -ss " + time.to_s + " -i \"" + filee.to_s + "\" -vframes 1 -f image2 \"" + $tpath + "screen" + count.to_s + ".png\"")
- end
- screenshot_path = $tpath + "screen" + count.to_s + ".png"
- sizee = File.size?(screenshot_path)
- screenshotlist.push(screenshot_path)
- screenshotsizelist.push(sizee)
- end
- begin
- screenshotsizelist = screenshotsizelist.sort
- screenshotsizelist = screenshotsizelist.reverse
- limsize = screenshotsizelist[4]
- for i in screenshotlist
- if File.size?(i) >= limsize
- begin
- bbcode = upload_screenshot_imagebam(i)
- rescue
- bbcode = ""
- end
- if bbcode == ""
- begin
- bbcode = upload_screenshot_imagebam(i)
- rescue
- bbcode = ""
- end
- end
- if bbcode == ""
- begin
- bbcode = try_to_up_screen_to_freeimghosting(screen)
- rescue
- bbcode = ""
- end
- end
- $scrtxt = $scrtxt + bbcode
- end
- end
- rescue
- exit("Failed to upload screenshots.\n")
- end
- $scrtxt = $scrtxt + "[/spoiler][/center]\n\n"
- end
- def upload_screenshot(screenshot_path)
- a = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- a.get('http://postimage.org/') do |page|
- page.encoding = "utf-8"
- form = page.forms[1]
- form['content'] = "no"
- form['optsize'] = "Do not resize my image"
- form.file_uploads.first.file_name = screenshot_path
- begin
- page = form.submit
- rescue
- #quit("Could not upload screenshots. Quitting.\n")
- return ""
- end
- # This should work always
- list = page.body.split("id=\"code_3\" scrolling=\"no\">")
- list = list[1].split("[img")
- part1 = list[0]
- list = list[1].split("[/url]")
- list = list[0].split("http://")
- list = list[1].split(".jpg")
- part2 = list[0]
- bbcode = part1 + "[img]http://" + part2 + ".jpg[/img][/url]\n"
- print("Screenshot done.")
- print("\n")
- return bbcode
- end
- end
- def upload_screenshot_imagebam(screenshot_path)
- a = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- a.get('http://www.imagebam.com/basic-upload') do |page|
- page.encoding = "utf-8"
- form = page.forms[0]
- form['content_type'] = 0 #"FAMILY SAFE content"
- form['thumb_size'] = "350" #"350x350 pixel"
- form['thumb_aspect_ratio'] = "resize" #"keep aspect ratio"
- form['thumb_file_type'] = "jpg" #"JPEG"
- form.checkbox_with('gallery_options').uncheck
- form.file_uploads.first.file_name = screenshot_path
- begin
- page = form.submit
- rescue
- #quit("Could not upload screenshots. Quitting.\n")
- return ""
- end
- # This should work always
- list = page.body.split("<b>BB-Code</b><br>")
- list = list[1]
- list = list.split("</textarea>")
- list = list[0]
- list = list.split("[URL")
- list = list[1]
- bbcode = "[URL" + list
- print("Screenshot done.")
- print("\n")
- return bbcode
- end
- end
- def get_mediainfo(filee)
- system($mpath + " \"" + filee.to_s + "\" > \"" + $tpath + "mediainfo.txt\"")
- File.open($tpath + "mediainfo.txt", "r") do |f1|
- while line = f1.gets
- $mediainfo = $mediainfo + line
- end
- end
- list = $mediainfo.split($fpath)
- $mediainfo = list[0] + list[1]
- print("Mediainfo retrieved.")
- print("\n")
- end
- def check_if_duration_long()
- list = $mediainfo.split("\nDuration")
- list = list[1]
- list = list.split("mn")
- duration = list[0]
- if duration.include?("h ")
- return true
- else
- return false
- end
- end
- def get_movie_info()
- begin
- a = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- a.get('http://www.imdb.com/title/tt' + $imdb + '/') do |page|
- page.encoding = "utf-8"
- if page.body.include? "/genre/Action"
- $genre = "action"
- $genre_action = 1
- $type = "1"
- end
- if page.body.include? "/genre/Comedy"
- $genre = "comedy"
- $genre_comedy = 1
- $type = "2"
- end
- if page.body.include? "/genre/Documentary"
- $genre = "documentary"
- $genre_documentary = 1
- $type = "3"
- end
- if page.body.include? "/genre/Drama"
- $genre = "drama"
- $genre_drama = 1
- $type = "4"
- end
- if page.body.include? "/genre/Musical"
- $genre = "musical"
- $genre_musical = 1
- $type = "5"
- end
- if page.body.include? "/genre/Thriller"
- $genre = "thriller"
- $genre_thriller = 1
- $type = "6"
- end
- if $genre == ""
- $genre = "drama"
- $type = "4"
- end
- if page.body.include? "/genre/Crime"
- $genre_crime = 1
- end
- if page.body.include? "/genre/Reality"
- $genre_reality = 1
- end
- if page.body.include? "/genre/Animation"
- $genre_animation = 1
- end
- if page.body.include? "/genre/Adventure"
- $genre_adventure = 1
- end
- if page.body.include? "/genre/Biography"
- $genre_biography = 1
- end
- if page.body.include? "/genre/History"
- $genre_history = 1
- end
- if page.body.include? "/genre/Family"
- $genre_family = 1
- end
- if page.body.include? "/genre/Fantasy"
- $genre_fantasy = 1
- end
- if page.body.include? "/genre/Film-Noir"
- $genre_filmnoir = 1
- end
- if page.body.include? "/genre/Horror"
- $genre_horror = 1
- end
- if page.body.include? "/genre/Music"
- $genre_music = 1
- end
- if page.body.include? "/genre/Mystery"
- $genre_mystery = 1
- end
- if page.body.include? "/genre/Romance"
- $genre_romance = 1
- end
- if page.body.include? "/genre/Sci-Fi"
- $genre_scifi = 1
- end
- if page.body.include? "/genre/Sport"
- $genre_sport = 1
- end
- if page.body.include? "/genre/Thriller"
- $genre_thriller = 1
- end
- if page.body.include? "/genre/War"
- $genre_war = 1
- end
- if page.body.include? "/genre/Western"
- $genre_western = 1
- end
- if page.body.include? "/genre/Adult" and $no_adult == 1
- quit("This is an adult movie.\n")
- end
- print("Genres retrieved.")
- print("\n")
- list = page.body.split("<meta name=\"title\" content=\"")
- list = list[1].split(" (")
- $title = list[0]
- $title = $title.split("\n")[0]
- list = page.body.split(") - IMDb</title>")
- list = list[0].split("(")
- $year = list[list.length - 1]
- $year = $year.split("\n")[0]
- if $year.start_with? "Video "
- list = $year.split("Video ")
- $year = list[1]
- end
- if $year.start_with? "TV "
- list = $year.split("TV ")
- $year = list[1]
- end
- if $year.start_with? "Movie "
- list = $year.split("Movie ")
- $year = list[1]
- end
- if $year.start_with? "Short"
- list = $year.split("Short ")
- $year = list[1]
- end
- if $year.start_with? "Episode"
- list = $year.split("Episode ")
- $year = list[1]
- end
- if not numeric? $year
- quit("Year not determined correctly. Got\n" + $year)
- end
- list = page.body.split("<p itemprop=\"description\">")
- if list.length >= 2
- list = list[1].split("<")
- $desc = list[0]
- else
- $desc = "No film description available."
- end
- list = page.body.split("<div class=\"image\">")
- if list.length >= 2
- list = list[1].split("<a href=\"")
- list = list[1].split("?ref")
- $poster = "http://www.imdb.com" + list[0]
- print("Poster found from IMDB.")
- print("\n")
- end
- end
- print("Movie info retrieved.\n")
- print("Title: " + $title)
- print("\n")
- rescue
- quit("Failed to retrieve imdb data.\nCheck imdb link and if the site is up.")
- end
- end
- def ask_for_dupe_confirmation()
- if dupecheck()
- print("This might be a duplicate. See:\n")
- print("https://tehconnection.eu/torrents.php?searchstr=tt" + $imdb + "\n")
- print("Type 1 to continue or 0 to abort.\n")
- continue = STDIN.gets.chomp
- if not continue == "1"
- quit("Aborted because this might be a duplicate.\nSee: https://tehconnection.eu/torrents.php?searchstr=tt" + $imdb)
- end
- end
- end
- def dupecheck()
- $tc.get('https://tehconnection.eu/torrents.php?searchstr=tt' + $imdb) do |page|
- page.encoding = "utf-8"
- list = page.body.split("<div class=\"box torrent_list_box\">")
- list = list[1]
- list = list.split("<tr class=\"group_torrent groupid_")
- for i in list
- if checkconditions(i)
- # If we find a match return true for duplicate.
- print("This might be a duplicate.\n")
- return true
- end
- end
- end
- $tc.get('https://tehconnection.eu/torrents.php?action=search&release_name=' + $folder) do |page|
- if not page.body.include?("{\"status\":\"ok\",\"releases\":[]}") and not $folder.include?(" ")
- print("This might be a duplicate.\n")
- return true
- end
- end
- # This gets executed if no matches were found.
- print("Not a duplicate.\n")
- return false
- end
- def checkconditions(i)
- # If they are all the same
- if i.include?($container) and i.include?($format) and i.include?($quality) and i.include?($source)
- if ($scene == 1 and i.include?("Scene")) or ($scene == 0 and not i.include?("Scene"))
- return true
- end
- end
- # Scene xvid trumps p2p xvid
- if i.include?("XviD") and i.include?("AVI") and i.include?("Scene")
- if $format == "XviD" and $container == "AVI" and $scene == 0
- return true
- end
- end
- # Bluray trumps DVD as source
- if i.include?($container) and i.include?($format) and i.include?($quality)
- if ($scene == 1 and i.include?("Scene")) or ($scene == 0 and not i.include?("Scene"))
- if $source == "WEB-DL" and (i.include?("DVD") or i.include?("Blu-ray") or i.include?("HD-DVD"))
- return true
- end
- if $source == "DVD" and (i.include?("Blu-ray") or i.include?("HD-DVD"))
- return true
- end
- if $source == "HD-DVD" and i.include?("Blu-ray")
- return true
- end
- end
- end
- return false
- end
- def doupload()
- #$tc.get('https://tehconnection.eu/login.php') do |page|
- #page.encoding = "utf-8"
- #form = page.forms.first
- #form['username'] = $username
- #form['password'] = $password
- #page = form.submit
- #end
- $tc.get('https://tehconnection.eu/upload.php') do |page|
- page.encoding = "utf-8"
- form = page.forms[page.forms.length - 1]
- # torrent file
- form.file_uploads.first.file_name = $torpath + $folder + ".torrent"
- # genre
- # max 3 little genres
- i = 0
- if $genre == "action"
- form.checkbox_with('genre_132951').check
- form['type'] = 0
- i = i + 1
- end
- if $genre == "comedy"
- form.checkbox_with('genre_122494').check
- form['type'] = 1
- i = i + 1
- end
- if $genre == "documentary"
- form.checkbox_with('genre_132953').check
- form['type'] = 2
- i = i + 1
- end
- if $genre == "drama"
- form.checkbox_with('genre_132952').check
- form['type'] = 3
- i = i + 1
- end
- if $genre == "musical"
- form.checkbox_with('genre_122483').check
- form['type'] = 4
- i = i + 1
- end
- if $genre == "thriller"
- form.checkbox_with('genre_132955').check
- form['type'] = 5
- i = i + 1
- end
- if $genre_adventure == 1 and i < 3
- form.checkbox_with('genre_122473').check
- i = i + 1
- end
- if $genre_animation == 1 and i < 3
- form.checkbox_with('genre_122474').check
- i = i + 1
- end
- if $genre_biography == 1 and i < 3
- form.checkbox_with('genre_122475').check
- i = i + 1
- end
- if $genre_crime == 1 and i < 3
- form.checkbox_with('genre_122476').check
- i = i + 1
- end
- if $genre_family == 1 and i < 3
- form.checkbox_with('genre_122477').check
- i = i + 1
- end
- if $genre_fantasy == 1 and i < 3
- form.checkbox_with('genre_122478').check
- i = i + 1
- end
- if $genre_filmnoir == 1 and i < 3
- form.checkbox_with('genre_122479').check
- i = i + 1
- end
- if $genre_history == 1 and i < 3
- form.checkbox_with('genre_122480').check
- i = i + 1
- end
- if $genre_horror == 1 and i < 3
- form.checkbox_with('genre_122481').check
- i = i + 1
- end
- if $genre_music == 1 and i < 3
- form.checkbox_with('genre_132956').check
- i = i + 1
- end
- if $genre_mystery == 1 and i < 3
- form.checkbox_with('genre_122483').check
- i = i + 1
- end
- if $genre_romance == 1 and i < 3
- form.checkbox_with('genre_122485').check
- i = i + 1
- end
- if $genre_scifi == 1 and i < 3
- form.checkbox_with('genre_122486').check
- i = i + 1
- end
- if $genre_sport == 1 and i < 3
- form.checkbox_with('genre_122488').check
- i = i + 1
- end
- if $genre_war == 1 and i < 3
- form.checkbox_with('genre_122489').check
- i = i + 1
- end
- if $genre_western == 1 and i < 3
- form.checkbox_with('genre_122490').check
- i = i + 1
- end
- form['imdb_number'] = $imdb
- form['image'] = $image
- $title = $title.force_encoding('UTF-8')
- form['title'] = $title
- form['year'] = $year
- form['format'] = $format
- form['container'] = $container
- form['bitrate'] = $quality
- form['media'] = $source
- $desc = $desc.force_encoding('UTF-8')
- form['album_desc'] = $desc
- form['mediainfo'] = $mediainfo
- $nfo = $nfo.force_encoding('UTF-8')
- form['release_desc'] = $scrtxt + $nfo
- if $scene == 1
- form.checkbox_with('scene').check
- form['scenetitle'] = $sceneinfo
- end
- if $remaster == 1
- form.checkbox_with('remaster').check
- form['remaster_year'] = $year
- form['remaster_title'] = $remasterinfo
- end
- form['release_name'] = $folder
- begin
- page = form.submit
- rescue
- #File.open($fpath + "errorpagefile4554343.html", 'w') {|f| f.write(page.body) }
- quit("Could not finish uploading. Something went wrong.\n")
- #See the error page file at " + $fpath + "errorpagefile4554343.html.")
- return false
- end
- end
- print("Torrent uploaded.")
- print("\n")
- end
- def createtorrent()
- # Exclude some special files
- if $format == "DivX" or $format == "XviD" or $format == "x264" or $format == "h.264"
- system($torrentword_encode)
- # Usual files excluded
- else
- system($torrentword_general)
- end
- print("Torrent created.")
- print("\n")
- end
- def opentorrent()
- if $os_windows == 1
- system("start \"\" \"" + $torpath + $folder + ".torrent\"")
- else
- system("xdg-open \"\" \"" + $torpath + $folder + ".torrent\"")
- end
- end
- def find_largest_file(files)
- largest_size = 0
- largest_file = ""
- for filee in files
- if File.size?(filee) > largest_size
- largest_size = File.size?(filee)
- largest_file = filee
- end
- end
- print("Found the largest file.")
- print("\n")
- return largest_file
- end
- def retrieve_imdb_update()
- begin
- $tc.get('https://tehconnection.eu/imdb.php?id=' + $imdb)
- print("IMDB update done.")
- print("\n")
- rescue
- quit("IMDB update failed. I blame hwkns.\n")
- end
- end
- def login_to_tc()
- begin
- $tc = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- $tc.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- $tc.get('https://tehconnection.eu/login.php') do |page|
- page.encoding = "utf-8"
- form = page.forms.first
- form['username'] = $username
- form['password'] = $password
- page = form.submit
- end
- rescue
- quit("Login failed. I blame hwkns.\n")
- end
- end
- def get_duration()
- hours = 0
- minutes = 0
- seconds = 0
- list = $mediainfo.split("Duration : ")
- list = list[1]
- list = list.split("\n")
- list = list[0]
- if list.include? "h"
- hourlist = list.split("h")
- hours = hourlist[0].to_i
- list = list.split("h")
- if list.length > 1
- list = list[1]
- else
- list = [""]
- end
- end
- if list.include? "mn"
- minutelist = list.split("mn")
- minutes = minutelist[0].to_i
- list = list.split("mn")
- if list.length > 1
- list = list[1]
- else
- list = [""]
- end
- end
- if list.include? "s"
- secondslist = list.split("s")
- seconds = secondslist[0].to_i
- end
- seconds = 60 * 60 * hours + 60 * minutes + seconds
- print("Duration: " + seconds.to_s + " seconds.\n")
- return seconds
- end
- def check_ban_list
- for i in $banlist
- if $folder.end_with?(i)
- quit(i + " is a banned group. Check your upload.\n")
- end
- end
- print("Not in banned groups list.\n")
- end
- def deduct_name(foldername)
- striplist = ["DVDRIP","BDRIP","BLURAY","HDTV","TVRIP","480P","576P","1080I","STV","LIMITED","NTSC","PAL","SUBBED","DUBBED","TELESYNC","CAM","FESTIVAL","COMPLETE"]
- striplist.push($source.upcase,$container.upcase,$extension.upcase,$format.upcase)
- if $scene == 1 and not $sceneinfo == ""
- striplist.push($sceneinfo.upcase)
- end
- if $remaster == 1 and not $remasterinfo == ""
- striplist.push($remasterinfo.upcase)
- end
- name = foldername.upcase
- name = name.gsub(".", " ")
- name = name.gsub("(", " ")
- name = name.gsub("[", " ")
- name = name.gsub(")", " ")
- name = name.gsub("]", " ")
- name = name.gsub("-", " ")
- for i in striplist
- if name.include?(i)
- name = name.split(i)
- name = name[0]
- end
- end
- return name
- end
- def compare_searches(name)
- a = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- name = name.rstrip
- searchterm = name.gsub(" ", "+")
- searchterm_tmdb = searchterm
- while numeric?(searchterm_tmdb[searchterm_tmdb.length - 1]) or searchterm_tmdb[searchterm_tmdb.length - 1] == "+"
- searchterm_tmdb = searchterm_tmdb.chop
- searchterm_tmdb = searchterm_tmdb.rstrip
- end
- #IMDB
- imdb_result = ""
- begin
- a.get('http://www.imdb.com/find?q=' + searchterm) do |page|
- list = page.body.split("<h3 class=\"findSectionHeader\"><a name=\"tt\"></a>Titles</h3>")
- list = list[1]
- list = list.split("/title/")
- list = list[1]
- list = list.split("/?ref")
- list = list[0]
- imdb_result = list
- end
- print("IMDB says: http://www.imdb.com/title/" + imdb_result + "\n")
- rescue
- imdb_result = ""
- end
- # GOOGLE
- google_result = ""
- begin
- a.get('https://www.google.com/search?q=site:imdb.com+' + searchterm + '&btnI') do |page|
- google_result = page.uri.to_s
- google_result = google_result.split("/title/")
- google_result = google_result[1]
- google_result = google_result.split("/?ref")
- google_result = google_result[0]
- google_result = google_result.split("/")
- google_result = google_result[0]
- end
- print("Google says: http://www.imdb.com/title/" + google_result + "\n")
- rescue
- google_result = ""
- end
- if google_result == imdb_result and not google_result == ""
- tt_result = ""
- begin
- a.get('http://www.themoviedb.org/search?query=' + imdb_result) do |page|
- list = page.body.split("<ul class=\"search_results movie\">")
- list = list[1]
- list = list.split("<a href=\"")
- list = list[1]
- list = list.split("\" title=\"")
- list = list[0]
- tt_result = list
- end
- rescue
- tt_result = ""
- end
- tmdb_result = ""
- begin
- a.get('http://www.themoviedb.org/search?query=' + searchterm_tmdb) do |page|
- list = page.body.split("<ul class=\"search_results movie\">")
- list = list[1]
- list = list.split("<a href=\"")
- list = list[1]
- list = list.split("\" title=\"")
- list = list[0]
- tmdb_result = list
- end
- rescue
- tmdb_result = ""
- end
- print("TMDB says: http://www.imdb.com/title/" + tmdb_result + "\n")
- if tt_result == tmdb_result and not tt_result == ""
- result = imdb_result.delete("tt")
- return result
- else
- return ""
- end
- else
- return ""
- end
- end
- def try_to_up_screen_to_freeimghosting(screen)
- b = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- b.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- b.get('http://www.freeimagehosting.net/upload.php') do |page|
- page.encoding = "utf-8"
- form = page.forms.first
- form.file_uploads.first.file_name = $tpath + screen
- begin
- page = form.submit
- temp = page.body.split("<input name=\"htmlfull\"")
- temp = temp[1]
- temp = temp.split("" alt="Free Web Proxy")
- temp = temp[0]
- temp = temp.split("http://www.freeimagehosting.net/newuploads/")
- temp = temp[1]
- temp = "http://www.freeimagehosting.net/newuploads/" + temp
- return "[IMG]" + temp + "[/IMG]"
- rescue
- return ""
- end
- end
- end
- def try_to_up_to_freeimghosting()
- b = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- b.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- b.get('http://www.freeimagehosting.net/upload.php') do |page|
- page.encoding = "utf-8"
- form = page.forms.first
- form.file_uploads.first.file_name = $tpath + $postername
- begin
- page = form.submit
- temp = page.body.split("<input name=\"htmlfull\"")
- temp = temp[1]
- temp = temp.split("" alt="Free Web Proxy")
- temp = temp[0]
- temp = temp.split("http://www.freeimagehosting.net/newuploads/")
- temp = temp[1]
- temp = "http://www.freeimagehosting.net/newuploads/" + temp
- $image = temp
- $poster = temp
- print("Poster uploaded to Freeimagehosting.\n")
- return true
- rescue
- $poster = ""
- print("Could not upload poster. Continuing.\n")
- return false
- end
- end
- end
- def try_to_up_to_fotoshack()
- b = Mechanize.new { |agent|
- agent.user_agent_alias = 'Mac Safari'
- }
- b.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- b.get('http://www.fotoshack.us') do |page|
- page.encoding = "utf-8"
- form = page.forms.first
- form.file_uploads.first.file_name = $tpath + $postername
- begin
- page = form.submit
- temp = page.body.split("Direct link to image</td>")
- temp = temp[0]
- temp = temp.split("</a> image to friends</td>")
- temp = temp[1]
- temp = temp.split("value=\"")
- temp = temp[1]
- temp = temp.split("\" size")
- temp = temp[0]
- $image = temp
- $poster = temp
- print("Poster uploaded to Fotoshack.\n")
- return true
- rescue
- $poster = ""
- print("Could not upload poster. Continuing.\n")
- return false
- end
- end
- end
- ### Running starts here.
- if File.file?($fpath + $folder)
- extname = File.extname($fpath + $folder)
- foldername = $folder[0..$folder.length - extname.length - 1]
- print(extname + "\n")
- print(foldername + "\n")
- if not File.directory?($fpath + foldername)
- FileUtils.mkdir($fpath + foldername + "/")
- FileUtils.copy($fpath + $folder,$fpath + foldername + "/" + $folder)
- $folder = foldername
- $foldercaps = $folder.upcase
- else
- quit("To-be-made folder already exists.")
- end
- end
- if not File.directory?($fpath + $folder)
- print($fpath + $folder)
- quit("Given directory does not exist.")
- end
- # Check if banned group
- check_ban_list()
- # Twice to to work with some nested archives.
- # Use trice if paranoid.
- if $archives == 1
- root, files_1, dirs_1 = os_walk($fpath + $folder)
- unrar(files_1)
- root, files_2, dirs_2 = os_walk($fpath + $folder)
- for filee in files_2
- if files_1.count(filee) > 0
- files_2.delete(filee)
- end
- end
- unrar(files_2)
- print("All files extracted.")
- print("\n")
- end
- # Find the main file
- $root, $files, $dirs = os_walk($fpath + $folder)
- largest_file = find_largest_file($files)
- # Create the temp folder.
- create_temp()
- # Login to the site
- login_to_tc()
- # Check that subtitles were extracted correctly.
- check_subtitles()
- # Check if is scene and/or special edition
- check_scene()
- check_special_edition()
- # Get mediainfo
- get_mediainfo(largest_file)
- # Container
- get_container(largest_file)
- # Retrieve source
- get_source()
- # Quality
- get_quality()
- # Format
- get_format()
- # Get IMDB info and nfo contents.
- get_nfo()
- # Make sure user isn't uploading a duplicate.
- if $check_for_duplicates == 1
- ask_for_dupe_confirmation()
- end
- # Get movie info
- get_movie_info()
- # Get poster and upload it
- get_poster()
- # Take screenshots and upload them.
- screenshot_routine(largest_file)
- # Create torrent
- createtorrent()
- # Uploading
- doupload()
- # Tell TC's retard code to fetch rating and peoples info for the film
- retrieve_imdb_update()
- # Open torrent file
- opentorrent()
- # Delete the temporary folder
- FileUtils.rm_rf($tpath)
- print("Temporary folder deleted.")
- print("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement