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