|
|
@@ -55,6 +55,7 @@ def getauthkey(): |
|
|
|
soup = BeautifulSoup(smpage.text, 'html5lib') |
|
|
|
rel2 = str(soup.select('#content .thin .main_column .torrent_table tbody')) |
|
|
|
authkey = re.findall('authkey=(.*)&torrent_pass=', rel2) |
|
|
|
print(authkey) |
|
|
|
return authkey |
|
|
|
|
|
|
|
|
|
|
@@ -544,7 +545,7 @@ def detectlanguage(string): |
|
|
|
|
|
|
|
return en |
|
|
|
|
|
|
|
def uploadtorrent(torrent, cover, releasedata): |
|
|
|
def uploadtorrent(torrent, releasedata): |
|
|
|
|
|
|
|
languages = ('Japanese', 'English', 'Korean', 'Chinese', 'Vietnamese') |
|
|
|
# POST url. |
|
|
@@ -560,8 +561,8 @@ def uploadtorrent(torrent, cover, releasedata): |
|
|
|
|
|
|
|
try: |
|
|
|
postDataFiles = { |
|
|
|
'file_input': open(torrent, 'rb'), |
|
|
|
'userfile': open(cover, 'rb') |
|
|
|
'file_input': open(torrent, 'rb') |
|
|
|
#'userfile': open(cover, 'rb') |
|
|
|
} |
|
|
|
except FileNotFoundError: |
|
|
|
print("_" * 100) |
|
|
@@ -665,7 +666,9 @@ if __name__ == "__main__": |
|
|
|
loginUrl = "https://sugoimusic.me/login.php" |
|
|
|
loginTestUrl = "https://sugoimusic.me" |
|
|
|
successStr = "Enabled users" |
|
|
|
|
|
|
|
passkey = cfg['credentials']['passkey'] |
|
|
|
annouceurl = "https://tracker.sugoimusic.me:24601/"+passkey+"/announce" |
|
|
|
print(annouceurl) |
|
|
|
# j is an object which can be used to make requests with respect to the loginsession |
|
|
|
sm = smpy.MyLoginSession(loginUrl, loginData, loginTestUrl, successStr, debug=args.debug) |
|
|
|
# Acquire authkey |
|
|
@@ -679,10 +682,11 @@ if __name__ == "__main__": |
|
|
|
# cover_path = directory + "/" + cfg['local_prefs']['cover_name'] |
|
|
|
|
|
|
|
# Create torrent file. |
|
|
|
torrentfile = createtorrent(authkey, directory, folder_name, releasedata) |
|
|
|
#torrentfile = createtorrent(authkey, directory, folder_name, releasedata) |
|
|
|
torrentfile = createtorrent(annouceurl, directory, folder_name, releasedata) |
|
|
|
|
|
|
|
# Upload torrent to JPopSuki |
|
|
|
# uploadtorrent(torrentfile, cover_path, releasedata) |
|
|
|
uploadtorrent(torrentfile, releasedata) |
|
|
|
|
|
|
|
# Setting variable for watch/download folders |
|
|
|
ftp_watch_folder = cfg['ftp_prefs']['ftp_watch_folder'] |
|
|
|