Browse Source

code clean up

master
sharky555 3 years ago
parent
commit
8579cd4bb0
2 changed files with 22 additions and 30 deletions
  1. +6
    -14
      README.md
  2. +16
    -16
      autoupload.py

+ 6
- 14
README.md View File

@@ -1,14 +1,11 @@
This project is **NOT** being maintained as i'd rather rewrite it from scratch.
## Overview ## Overview
**JPS-AU** is a tool for automating the uploading process on jpopsuki.eu.
**SM-AU** is a tool for automating the uploading process on jpopsuki.eu.
This is intended to be used alongside BugsPy. This is intended to be used alongside BugsPy.
**Features:** **Features:**
- SM Client. - SM Client.
- FTP Support - FTP Support
- FLAC/MP3 Support. - FLAC/MP3 Support.
- BugsPy .log Support.
**Installation:** **Installation:**
- Install requirements - Install requirements
@@ -23,23 +20,23 @@ python autoupload.py {command_name} {ID/URL}
Command | Description | Example Command | Description | Example
------------- | ------------- | ------------- ------------- | ------------- | -------------
-d, --debug | Provides additional information on upload for debugging purposes | `python autoupload.py -d` -d, --debug | Provides additional information on upload for debugging purposes | `python autoupload.py -d`
-f, --freeleech | Enables freeleech (VIP+ Userclass Requirement) | `python autoupload.py -f -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]"`
-t, --tags | Add additional tags to upload, separated with comma | `python autoupload.py -t "korean, female.vocalist" -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]"`
-t, --tags | Add additional tags to upload, separated with comma. Minimum 2 tags required. | `python autoupload.py -t "korean, female.vocalist" -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]"`
-dir, --directory | Appoint directory used for torrent creation | `python autoupload.py -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]"` -dir, --directory | Appoint directory used for torrent creation | `python autoupload.py -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]"`
-dry, --dryrun | Carries out all actions other than the upload itself.| `python autoupload.py -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]" -dry` -dry, --dryrun | Carries out all actions other than the upload itself.| `python autoupload.py -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3]" -dry`
-i, --imageURL | Set the torrent cover URL | `python autoupload.py -f -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3] -i "https://someimageurl.com/someimage.jpg""`
-im, --imageURL | Set the torrent cover URL | `python autoupload.py -f -dir "Z:\Music\Korean\Ego\Ego - E [2020.01.02] [EP] [WEB-MP3] -i "https://someimageurl.com/someimage.jpg""`
-tdes [TORRENTDESCRIPTION], --description [TORRENTDESCRIPTION] | Add a torrent description. Only available as an argument.
## Config.json ## Config.json
- It's not recommended to use both local watch/download folders and ftp watch/download folders at the same time as it will result in seeding from 2 locations. - It's not recommended to use both local watch/download folders and ftp watch/download folders at the same time as it will result in seeding from 2 locations.
- If generate_tracklist is set to false the script will try and find BugsPy logs within the selected log folder, this will use the comments tag to find the log. For example if 204815 is within your comments tag, it will search your log folder for 204815.log and use the contents of this log for the album description. - If generate_tracklist is set to false the script will try and find BugsPy logs within the selected log folder, this will use the comments tag to find the log. For example if 204815 is within your comments tag, it will search your log folder for 204815.log and use the contents of this log for the album description.
- Similarly to generate_tracklist, if enable_release_description is 'true' the script will create a url to the Bugs.co.kr album webpage to display the source, this can easily be edited to suit your needs within the gatherdata() function
**credentials:** **credentials:**
Config | Description | Example Config | Description | Example
------------- | ------------- | ------------- ------------- | ------------- | -------------
Username | SugoiMusic Username | Slyy
Username | SugoiMusic Username | User234
Password | SugoiMusic Password | Password Password | SugoiMusic Password | Password
Passkey | SugoiMusic Passkey | Passkey Passkey | SugoiMusic Passkey | Passkey
@@ -47,11 +44,6 @@ Passkey | SugoiMusic Passkey | Passkey
Config | Description | Example Config | Description | Example
------------- | ------------- | ------------- ------------- | ------------- | -------------
log_directory | directory containing BugsPy log files | `Z:/Bugs/Logs`
generate_tracklist | enable tracklist generation | `true/false`
save_tracklist | write tracklist to .log and save in log folder | `true/false`
enable_release_description | post comments tag to release description | `true/false`
cover_name | name of cover with extension | `cover.jpg`
add_to_watch_folder | moves .torrent file to local watch folder | `true/false` add_to_watch_folder | moves .torrent file to local watch folder | `true/false`
add_to_downloads_folder | moves torrent data to local downloads folder | `true/false` add_to_downloads_folder | moves torrent data to local downloads folder | `true/false`
local_watch_folder | directory of local watch folder | `Z:/watch/Transmission` local_watch_folder | directory of local watch folder | `Z:/watch/Transmission`


+ 16
- 16
autoupload.py View File

@@ -418,13 +418,13 @@ def gatherdata(directory):
print("Mutt detected, exiting.") print("Mutt detected, exiting.")
sys.exit() sys.exit()
if file.endswith(".log"):
log_available = True
# if file.endswith(".log"):
# log_available = True
if log_available == True:
media = 'CD'
else:
media = 'Web'
# if log_available == True:
# media = 'CD'
# else:
# media = 'Web'
# Load Dict.json for translations # Load Dict.json for translations
file = "json_data/dictionary.json" file = "json_data/dictionary.json"
@@ -470,15 +470,15 @@ def gatherdata(directory):
## If release description is enabled we apply comments to the bugs album url ## If release description is enabled we apply comments to the bugs album url
# Note that this is dependant on the album being sourced from bugs so should be changed per user. # Note that this is dependant on the album being sourced from bugs so should be changed per user.
if cfg['local_prefs']['enable_release_description']:
try:
release_description = f"Sourced from [url=https://music.bugs.co.kr/album/{tags['COMMENT'][0]}]Bugs[/url]"
# If any exceptions occur we will return to no release description
except:
release_description = ""
# If release description is not enabled we will use no release description
else:
release_description = ""
# if cfg['local_prefs']['enable_release_description']:
# try:
# release_description = f"Sourced from [url=https://music.bugs.co.kr/album/{tags['COMMENT'][0]}]Bugs[/url]"
# # If any exceptions occur we will return to no release description
# except:
# release_description = ""
# # If release description is not enabled we will use no release description
# else:
# release_description = ""
## Assign all our unique values into releasedata{}. We'll use this later down the line for POSTING. ## Assign all our unique values into releasedata{}. We'll use this later down the line for POSTING.
# POST values can be found by inspecting JPS HTML # POST values can be found by inspecting JPS HTML
@@ -514,7 +514,7 @@ def gatherdata(directory):
# else: # EP type # else: # EP type
# releasedata['type'] = 1 # releasedata['type'] = 1
accepted_types = ['Album', 'Single', 'EP'] accepted_types = ['Album', 'Single', 'EP']
if releasedata['type'] not in accepted_types:
if releasetype not in accepted_types:
if releasetype: if releasetype:
releasedata['type'] = releasetype releasedata['type'] = releasetype
else: else:


Loading…
Cancel
Save