#2 convert 1440 to 1080i

Merged
sharky555 merged 1 commits from anamorphic into master 3 years ago
  1. +23
    -16
      upload.py

+ 23
- 16
upload.py View File

@@ -46,15 +46,16 @@ def getargs():
parser.add_argument("-ca", "--contributingartists", help='Set the contributing artists. (Romaji\English). Split multiple with ","', nargs='?') parser.add_argument("-ca", "--contributingartists", help='Set the contributing artists. (Romaji\English). Split multiple with ","', nargs='?')
parser.add_argument("-ti", "--title", help='Set the title. (Romaji\English)', nargs='?') parser.add_argument("-ti", "--title", help='Set the title. (Romaji\English)', nargs='?')
parser.add_argument("-oti", "--originaltitle", help='Set the title. (Original Language)', nargs='?') parser.add_argument("-oti", "--originaltitle", help='Set the title. (Original Language)', nargs='?')
parser.add_argument("-des", "--description", help='Add a torrent description.', nargs='?', required=True)
parser.add_argument("-tdes", "--torrentdescription", help='Add a torrent description', nargs='?')
parser.add_argument("-tgdes", "--torrentgroupdescription", help='Add a torrent group description. This is a required argument.', nargs='?', required=True)
parser.add_argument("-t", "--tags", help="Add additional tags to the upload. At least 2 tags are required", nargs='?') parser.add_argument("-t", "--tags", help="Add additional tags to the upload. At least 2 tags are required", nargs='?')
parser.add_argument("-im", "--imageURL", help='Set the torrent cover URL.', nargs='?') parser.add_argument("-im", "--imageURL", help='Set the torrent cover URL.', nargs='?')
parser.add_argument("-ms", "--mediasource", help='Set the media source.', nargs='?')
parser.add_argument("-rt", "--releasetype", help='Set the release type.', nargs='?')
parser.add_argument("-s", "--sub", help='Set the subtitle type.', nargs='?')
parser.add_argument("-l", "--language", help='Set the language', nargs='?')
parser.add_argument("-ms", "--mediasource", help='Set the media source. ()', nargs='?')
parser.add_argument("-rt", "--releasetype", help='Set the release type. ()', nargs='?')
parser.add_argument("-s", "--sub", help='Set the subtitle type. (NoSubs,Softsubs,Hardsub)', nargs='?')
parser.add_argument("-l", "--language", help='Set the language (Japanese,English,Korean,Chinese,Vietnamese,Other)', nargs='?')
parser.add_argument("-y", "--year", help='Set the torrent year (YYYYMMDD or YYYY).', nargs='?') parser.add_argument("-y", "--year", help='Set the torrent year (YYYYMMDD or YYYY).', nargs='?')
parser.add_argument("-f", "--freeleech", help="Enables freeleech.", action="store_true")
#parser.add_argument("-f", "--freeleech", help="Enables freeleech. ()", action="store_true")
parser.add_argument("-eti", "--editiontitle", help='Set the edition title', nargs='?') parser.add_argument("-eti", "--editiontitle", help='Set the edition title', nargs='?')
parser.add_argument("-ey", "--editionyear", help='Set the torrent edition year (YYYYMMDD or YYYY).', nargs='?') parser.add_argument("-ey", "--editionyear", help='Set the torrent edition year (YYYYMMDD or YYYY).', nargs='?')
parser.add_argument("-ss", "--screenshots", help='Set the torrent screen shots', nargs='?') parser.add_argument("-ss", "--screenshots", help='Set the torrent screen shots', nargs='?')
@@ -69,7 +70,8 @@ def gatherdata():
:return: releasedata: dict :return: releasedata: dict
""" """
releasedata = {"submit": "true"} releasedata = {"submit": "true"}
releasedata["album_desc"] = description
releasedata["album_desc"] = torrentgroupdescription
if artists: if artists:
releasedata['idols[]'] = artists releasedata['idols[]'] = artists
else: else:
@@ -177,12 +179,15 @@ def gatherdata():
if tags: if tags:
input_tags = tags
releasedata["tags"] = tags
else: else:
input_tags = input("\n" + "_" * 100 + "\nEnter the tags. Separate multiple with \",\". Minimum 2 tags required.\n")
if input_tags != "":
input_tags = [x.strip() for x in input_tags.split(',')]
releasedata["tags"] = input_tags
while(True):
input_tags = input("\n" + "_" * 100 + "\nEnter the tags. Separate multiple with \",\". Minimum 1 tag required.\n")
if len(input_tags.split(",")) != 0:
releasedata["tags"] = input_tags
break
else:
print("Please enter at least one tag.")
list_of_types = ["PV", "Music Performance", "TV Music", "TV Variety", "TV-Drama"] list_of_types = ["PV", "Music Performance", "TV Music", "TV Variety", "TV-Drama"]
if releasetype in list_of_types: if releasetype in list_of_types:
@@ -219,7 +224,7 @@ def gatherdata():
if screenshots: if screenshots:
input_screenshots = screenshots input_screenshots = screenshots
else: else:
input_screenshots = input("\n" + "_" * 100 + "\nEnter the screenshot links. Separate multiple with \",\".\n")
input_screenshots = input("\n" + "_" * 100 + "\nEnter the screenshot links. Separate multiple with \",\".Press enter to skip.\n")
if input_screenshots != "": if input_screenshots != "":
input_screenshots = input_screenshots.replace(",","\n") input_screenshots = input_screenshots.replace(",","\n")
releasedata["screenshots"] = input_screenshots releasedata["screenshots"] = input_screenshots
@@ -263,6 +268,7 @@ def add_mediainfo_to_releasedata(filename, releasedata):
standardresolutions = { standardresolutions = {
"3840": "1920", "3840": "1920",
"1920": "1080", "1920": "1080",
"1440": "1080",
"1280": "720", "1280": "720",
"720": "480", "720": "480",
} }
@@ -271,7 +277,7 @@ def add_mediainfo_to_releasedata(filename, releasedata):
releasedata['ressel'] = height releasedata['ressel'] = height
if 'ressel' in releasedata.keys(): # Known resolution type, try to determine if interlaced if 'ressel' in releasedata.keys(): # Known resolution type, try to determine if interlaced
if track.scan_type == "Interlaced" or track.scan_type == "MBAFF":
if track.scan_type == "Interlaced" or track.scan_type == "MBAFF" or (track.width == 1440 and track.height == 1080):
releasedata['ressel'] += "i" releasedata['ressel'] += "i"
else: else:
releasedata['ressel'] += "p" # Sometimes a Progressive encode has no field set releasedata['ressel'] += "p" # Sometimes a Progressive encode has no field set
@@ -402,10 +408,11 @@ if __name__ == "__main__":
# TODO consider calling args[] directly, we will then not need this line # TODO consider calling args[] directly, we will then not need this line
dryrun = debug = freeleech = imageURL = tags = inputfile = artists = contributingartists = title = None dryrun = debug = freeleech = imageURL = tags = inputfile = artists = contributingartists = title = None
originalartist = originaltitle = description = editiontitle = editionyear = sub = language = year = mediasource = releasetype = screenshots = None
originalartist = originaltitle = torrentdescription = torrentgroupdescription = editiontitle = editionyear = sub = language = year = mediasource = releasetype = screenshots = None
inputfile = args.input inputfile = args.input
description = args.description
torrentgroupdescription = args.torrentgroupdescription
torrentdescription = args.torrentdescription
if args.dryrun: if args.dryrun:
dryrun = True dryrun = True


Loading…
Cancel
Save