damonjavert / jps2sm

Migrate data from JPopSuki to SugoiMusic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jps2sm

PyPI PyPI - Status PyPI - Downloads Code Climate maintainability Code Climate technical debt Pylint score Code Climate coverage Tests status GitHub last commit License PRs Welcome

A project to migrate torrents from JPopSuki to SugoiMusic

jps2sm will automatically gather and validate data from JPS and transfer it to SM. jps2sm does not download any data using torrents themselves and is not a torrent client.

Features

  • Create upload on SM by automatically retrieving all data on JPS, including english and original titles, group description, release information (format / media / bitrate etc.), group images, contributing artists, original titles, mediainfo data and remaster information if applicable.
  • Upload by specifiyng a JPS group or release --url or a --torrentid
  • Upload all your (or someone elses) personally uploaded / seeding / snatched torrents with --batch upload / --batch seeding / --batch snatched
  • Contribute to SM by uploading ALL recent torrents to JPS with --batch recent mode. A maximum size can be configured with MaxSizeRecentMode, a minimum number of seeders with MinSeeders and an amount of time to wait for JPS files to be downloaded with WaitTimeRecentModeMins in jps2sm.cfg
  • Search for your media files specified in MediaDirectories and run Mediainfo against them and save the output to the 'mediainfo' field and parse the data to populate the codec, container, audioformat and resolution fields. DVD ISOs are automatically extracted and Mediainfo is run against the VOB files, BR ISO images are not currently supported in the pyunpack module.
  • Exclude certain audioformats, medias or categories with --excaudioformat , --excmedia and --exccategory
  • Test your uploads with --dryrun mode.

Install

From PyPi:

pip install jps2sm

Or use the latest commit:

git clone https://github.com/damonjavert/jps2sm.git
cd jps2sm
python setup.py install

jps2sm requires python >=3.10

Quickstart

  • Install the latest release of python: https://www.python.org/downloads/
  • Launch your favourite terminal emulator, if you are not familiar with command-line usage or tools, on Windows: Type Win+R and run 'cmd'. On Mac: Go > Utilities > Terminal.
  • Install the package as above pip install jps2sm and add your JPS & SM login credentials and the directories where your media is stored to jps2sm.cfg, using jps2sm.cfg.example as a template.

The SM torrents are automatically downloaded to the $HOME/SMTorrents, or My Documents\SMTorrents if on Windows by default. All video torrents MUST have mediainfo extracted to be uploaded - you must setup MediaDirectories as below in order for jps2sm to find your media files:

[Media]
MediaDirectories: d:\Music, e:\BR-Rips, .....

MediaInfo will also need to be installed.

To upload an single release or a whole group:

jps2sm --urls <group-url or release-url(s)>

Command line usage Examples

To upload all your current seeding torrents, whilst automatically retrieving mediainfo data:

jps2sm --batch seeding --mediainfo

To upload the latest 50 torrents uploaded to JPS, prompting the user to continue once JPS data has been downloaded:

jps2sm --batch recent --mediainfo

To test upload all your JPS uploads:

jps2sm --batch uploaded --dryrun

To upload all your JPS uploads:

jps2sm --batch uploaded

To upload the most recent 50 torrents you uploaded at JPS:

jps2sm --batch uploaded --batchsort time --batchsortorder desc --batchstart 1 --batchend 1

To upload your 100 most popular uploads, based on snatches:

jps2sm --batch uploaded --batchsort snatches --batchsortorder desc --batchstart 1 --batchend 2

To upload every release of AKB48 - 1830m:

jps2sm --urls "https://jpopsuki.eu/torrents.php?id=111284"

To upload only the FLAC and MP3 320:

jps2sm --urls "https://jpopsuki.eu/torrents.php?id=111284&torrentid=148289 https://jpopsuki.eu/torrents.php?id=111284&torrentid=147830"

To upload every release of AKB48 - 1830m, excluding the ISOs (in JPS ISO is considered an audio format):

jps2sm --urls "https://jpopsuki.eu/torrents.php?id=111284" --excaudioformat ISO

Please only upload torrents you intend to SEED. Never-seeded torrents are deleted after 48 hours.

Usage

usage: jps2sm (--urls URLS | --torrentid TORRENTID | --batch {uploaded,seeding,snatched,recent} | -U | -S | -SN | -R)
[--batchuser BATCHUSER] [--batchsort {name,year,time,size,snatches,seeders,leechers}]
[--batchsortorder {asc,desc}] [--batchstart PAGESTART] [--batchend PAGEEND]
[--exccategory {Album,Single,PV,DVD,TV-Music,TV-Variety,TV-Drama,Fansubs,Pictures,Misc}]
[-excaudoiformat EXCAUDIOFORMAT] [--excmedia EXCMEDIA]
[--help] [--version] [--debug] [--dryrun] [--mediainfo] [--wait-for-jps-dl]


jps2sm actions:
  Choose ONE action for jps2sm to migrate data from

  -u URLS, --urls URLS  JPS URL for a group, or multiple individual releases URLs from the same group
  -t TORRENTID, --torrentid TORRENTID
                        JPS torrent id
  -bm {uploaded,seeding,snatched,recent}, --batch {uploaded,seeding,snatched,recent}
                        Batch mode: Upload all releases either uploaded, seeding, snatched by you or, if provided, user id specified by --batchuser. OR all
                        recent uploads to JPS.
  -U, --batchuploaded   alias to --batch upload
  -S, --batchseeding    alias to --batch seeding
  -SN, --batchsnatched  alias to --batch snatched
  -R, --batchrecent     alias to --batch recent


Batch mode (--batch MODE) optional arguments:
  -b BATCHUSER, --batchuser BATCHUSER
                        User id for batch user operations, default is user id of SM Username specified in jps2sm.cfg
  -bs {name,year,time,size,snatches,seeders,leechers}, --batchsort {name,year,time,size,snatches,seeders,leechers}
                        Sort for batch upload, must be one of: name,year,time,size,snatches,seeders,leechers
  -bso {asc,desc}, --batchsortorder {asc,desc}
                        Sort order for batch upload, either ASC or DESC.
  -s BATCHSTART, --batchstart BATCHSTART
                        Start at this page
  -e BATCHEND, --batchend BATCHEND
                        End at this page
  -exc {Album,Single,PV,DVD,TV-Music,TV-Variety,TV-Drama,Fansubs,Pictures,Misc}, --exccategory {Album,Single,PV,DVD,TV-Music,TV-Variety,TV-Drama,Fansubs,Pictures,Misc}
                        Exclude a JPS category from upload
  -exf EXCAUDIOFORMAT, --excaudioformat EXCAUDIOFORMAT
                        Exclude an audioformat from upload
  -exm EXCMEDIA, --excmedia EXCMEDIA
                        Exclude a media from upload


optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d, --debug           Enable debug mode
  -n, --dryrun          Just parse JPS data and show the output, do not upload the torrent(s) to SM
  -w, --wait-for-jps-dl
                        (Non-batch mode only) Show a prompt for the user to continue after scraping JPS torrent data and the
                        torrent, to allow for the file to be downloaded before adding it to SM
  -m, --mediainfo       Search and get mediainfo data from the source file(s) in the directories specified by MediaDirectories. Extract data to set codec,
                        resolution, audio format and container fields as well as the mediainfo field itself.

Development

Pull requests are welcome! See https://github.com/damonjavert/jps2sm/issues for areas that you can contribute to.

To setup your Dev environment for Mac/Linux:

git clone https://github.com/damonjavert/jps2sm.git
cd jps2sm
python3 -m venv .venv  # or whatever
. .venv/bin/activate
pip install -r requirements_dev.txt

This will install the runtime and dev dependancies and jps2sm itself in editable mode.

To run tests:

# Run from the repo root, else the required files will not be found
pytest

Windows

Windows 10 users can setup a Dev environment using Windows Subsystem for Linux. Windows 7 users can install cygwin and then select the python 3.8 packages. Or a python3 MSI installer can be found on the offical python 3 downloads page.

Mac OSX

Install Homebrew if you do not have it already and then brew install python3. See this guide: https://wsvincent.com/install-python3-mac/

Linux

Your distro's primary repos may not include packages for python3.8. Using apt-get install python3 for example may only install python3.6 (or even earlier) and due to the use of the walrus operator jps2sm requires python 3.8. The recommended approach to workaround this is to install LinuxBrew and then brew install python3 as also shown above. Otherwise Debian and Fedora based distros can follow this guide: https://docs.python-guide.org/starting/install3/linux/ .

Legal Disclaimer

Use of jps2sm is not illegal but piracy probably is in your country. Data transferred using jps2sm should be used to maintain backup copies on JPopSuki and SugoiMusic.

The developers of jps2sm are assuming that you own the original file and hold NO RESPONSIBILITY if further to the use of this software the files are misused in any way and cannot be held responsible for what uploads are created on SugoiMusic as a result.

jps2sm is not a torrent client and only migrates and validates metadata and not the actual data/files themselves.

About

Migrate data from JPopSuki to SugoiMusic

License:GNU General Public License v3.0


Languages

Language:Python 99.2%Language:Shell 0.8%Language:Batchfile 0.0%