소스 검색

Merge pull request 'convert 1440 to 1080i' (#2) from anamorphic into master

Reviewed-on: https://git.sugoimusic.me/sharky555/SM-AU-TV/pulls/2
pull/5/head
sharky555 3 년 전
부모
커밋
f63dd29565
1개의 변경된 파일23개의 추가작업 그리고 16개의 파일을 삭제
  1. +23
    -16
      upload.py

+ 23
- 16
upload.py 파일 보기

@@ -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("-ti", "--title", help='Set the title. (Romaji\English)', 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("-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("-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("-ey", "--editionyear", help='Set the torrent edition year (YYYYMMDD or YYYY).', nargs='?')
parser.add_argument("-ss", "--screenshots", help='Set the torrent screen shots', nargs='?')
@@ -69,7 +70,8 @@ def gatherdata():
:return: releasedata: dict
"""
releasedata = {"submit": "true"}
releasedata["album_desc"] = description
releasedata["album_desc"] = torrentgroupdescription
if artists:
releasedata['idols[]'] = artists
else:
@@ -177,12 +179,15 @@ def gatherdata():
if tags:
input_tags = tags
releasedata["tags"] = tags
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"]
if releasetype in list_of_types:
@@ -219,7 +224,7 @@ def gatherdata():
if screenshots:
input_screenshots = screenshots
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 != "":
input_screenshots = input_screenshots.replace(",","\n")
releasedata["screenshots"] = input_screenshots
@@ -263,6 +268,7 @@ def add_mediainfo_to_releasedata(filename, releasedata):
standardresolutions = {
"3840": "1920",
"1920": "1080",
"1440": "1080",
"1280": "720",
"720": "480",
}
@@ -271,7 +277,7 @@ def add_mediainfo_to_releasedata(filename, releasedata):
releasedata['ressel'] = height
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"
else:
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
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
description = args.description
torrentgroupdescription = args.torrentgroupdescription
torrentdescription = args.torrentdescription
if args.dryrun:
dryrun = True


불러오는 중...
취소
저장