diff --git a/copycommand.txt b/copycommand.txt deleted file mode 100644 index 913f68b..0000000 --- a/copycommand.txt +++ /dev/null @@ -1 +0,0 @@ -python upload.py -i "C:\file.ts" --releasetype "PV" --artist "" --title "" --tags "pop" --year "2022" --mediasource "HDTV" --imagepath "C:\file.ts_thumbs_[2022.04.29_19.06.07].jpg" --torrentgroupdescription "a long description!!!!" --torrentdescription "placeholder" diff --git a/copycommand.txt.example b/copycommand.txt.example index 7ea1ea1..da7012d 100644 --- a/copycommand.txt.example +++ b/copycommand.txt.example @@ -1,2 +1,2 @@ -python upload.py -i "C:\path to file" --releasetype "PV" --artist "" --title "" --tags "" --year "" --mediasource "" --imagepath "C:\path to image" --torrentgroupdescription "a long description!!!!" --torrentdescription "placeholder" +python upload.py -i "C:\path to file" --releasetype "PV" --artist "" --title "" --tags "" --year "" --mediasource "" --imagepath "C:\path to image" --torrentgroupdescription "torrentgroupdescription.txt" --torrentdescription "torrentdescription.txt" \ No newline at end of file diff --git a/torrentdescription.txt b/torrentdescription.txt new file mode 100644 index 0000000..48430a1 --- /dev/null +++ b/torrentdescription.txt @@ -0,0 +1 @@ +enter your torrent description here \ No newline at end of file diff --git a/torrentgroupdescription.txt b/torrentgroupdescription.txt new file mode 100644 index 0000000..6698dcb --- /dev/null +++ b/torrentgroupdescription.txt @@ -0,0 +1 @@ +enter your torrent group description here \ No newline at end of file diff --git a/upload.py b/upload.py index 7153c70..1dd2c11 100644 --- a/upload.py +++ b/upload.py @@ -287,7 +287,7 @@ def gatherdata(): if originalartist: releasedata['artistjp'] = originalartist else: - input_artist = input("\n" + "_" * 100 + "\nEnter the original ARTIST name. Press enter to skip if this torrent has the artist name already english or already has a artist page.\n") + input_artist = input("\n" + "_" * 100 + "\nEnter the original ARTIST name. Press enter to skip if this torrent has the artist name already in English or already has a artist page.\n") releasedata['artistjp'] = input_artist if title: @@ -504,6 +504,25 @@ def localfileorganization(torrent, directory, watch_folder, downloads_folder): if cfg['local_prefs']['add_to_watch_folder']: os.rename(torrent, f"{watch_folder}/{torrent}") +def addnewline(text): + text = re.sub(r"\\n", "\n", text) + +def gettorrentgroupdescription(textfile): + result = "" + with open(textfile,encoding='utf8') as f: + lines = f.readlines() + for line in lines: + result += line + return result + +def gettorrentdescription(textfile): + result = "" + with open(textfile,encoding='utf8') as f: + lines = f.readlines() + for line in lines: + result += line + return result + if __name__ == "__main__": asciiart() @@ -514,8 +533,11 @@ if __name__ == "__main__": originalartist = originaltitle = torrentdescription = torrentgroupdescription = editiontitle = editionyear = year = mediasource = releasetype = None inputfile = args.input - torrentgroupdescription = args.torrentgroupdescription - torrentdescription = args.torrentdescription + # torrentgroupdescription = args.torrentgroupdescription + # torrentdescription = args.torrentdescription + torrentgroupdescription = gettorrentgroupdescription(args.torrentgroupdescription) + torrentdescription = gettorrentdescription(args.torrentdescription) + if args.dryrun: dryrun = True @@ -581,6 +603,8 @@ if __name__ == "__main__": # Identifying cover.jpg path # cover_path = directory + "/" + cfg['local_prefs']['cover_name'] + #= addnewline(releasedata["album_desc"]) + #print(releasedata["album_desc"] ) # Create torrent file. torrentfile = createtorrent(authkey, inputfile, releasedata)