Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

session cookie use #51

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
6389a25
Converted to support apollo.rip
ApexWeed Dec 3, 2016
870c2c2
Added more rename handling
ApexWeed Dec 28, 2016
6b05159
Bump version
ApexWeed Dec 28, 2016
0622eea
Corrected missed reference to what.cd
ApexWeed Dec 29, 2016
2b55548
Added more 24 bit specific renaming
ApexWeed Dec 29, 2016
50ee2c9
Added more 24 bit handling, updated readme
ApexWeed Dec 31, 2016
4d76a36
Better handling of 88 and 176khz media
ApexWeed Jan 2, 2017
b38a2c9
Fixed multiples of 44.1 matching multiples of 48 (176.4 khz release f…
ApexWeed Jan 2, 2017
6834c04
Fixed missing [16-44] on FLAC24 albums
ApexWeed Jan 2, 2017
9328e6f
Fixed type
ApexWeed Jan 27, 2017
d9631f7
Changed to target python2 specifically
ApexWeed Feb 2, 2017
a294b5b
Added file with URL list as input option
ApexWeed Feb 2, 2017
4315bf5
Wrap readme at col 80
ApexWeed Feb 2, 2017
2f7590b
Updated tracker to SSL finally
ApexWeed Feb 3, 2017
d05ad96
Moved tracker to config file
ApexWeed Feb 3, 2017
fe5464f
Fixed tracker URL
ApexWeed Feb 4, 2017
22e26c0
Fix setup
ApexWeed Feb 13, 2017
bdc74d1
Change setup.py to python2 specifically
ApexWeed Feb 13, 2017
340ccc8
Nuke non functional setup
ApexWeed Feb 13, 2017
274e0a7
Transcode candidate mode selection
ApexWeed Feb 16, 2017
8ffc587
Added FLAC-24 handling
ApexWeed Mar 4, 2017
b2ff91d
Force mechanize version to fix uncompatible API change.
ApexWeed Apr 6, 2017
998baef
Use existing transcoded dir
ApexWeed Apr 6, 2017
d1f31b0
Per format output dirs
ApexWeed Apr 17, 2017
d6520b4
Fix for transcode dir missing format if parent dir contains flac
ApexWeed Apr 22, 2017
71e92dc
Fix resampling
ApexWeed May 30, 2017
5b8c54a
Allow API endpoint configuration, disabling scraping
ApexWeed Jun 13, 2017
225b9bd
Fix error
ApexWeed Jun 13, 2017
cd4be0a
Updated readme
ApexWeed Jun 13, 2017
4f28ac7
Fix upload failures
ApexWeed Aug 10, 2017
5e2b7e1
added source flag
ApexWeed Nov 21, 2017
d4e70c2
add skip option
ApexWeed Feb 17, 2018
b9c8c98
update readme
ApexWeed Feb 17, 2018
618005f
fixed readme
ApexWeed Feb 17, 2018
201d4fd
add seeding transcode mode
ApexWeed Apr 5, 2018
856061e
update readme
ApexWeed Apr 5, 2018
9c92654
Update readme
ApexWeed Aug 5, 2018
bdad8dd
Orpheus
ApexWeed Oct 25, 2018
04e1db7
Bump version
ApexWeed Oct 25, 2018
4f40edd
Port to python 3
ApexWeed Nov 12, 2018
fdd2135
Fix 24 bit correction
ApexWeed Nov 12, 2018
7f329cb
Fixed ConfigParser issue
ApexWeed Nov 12, 2018
ac01755
Fix urllib parsing issue
ApexWeed Nov 12, 2018
4a9a230
Fix cache
ApexWeed Nov 30, 2018
07e47f2
More consistent hashbangs
ApexWeed Nov 30, 2018
7036d6f
Add basic 2FA support
ApexWeed Dec 1, 2018
c23dde1
Fix string formatting
ApexWeed Dec 1, 2018
80cc12a
Add setup.py back in
ApexWeed Dec 16, 2018
6ff82e2
Fix utf-8 filenames failing to upload
ApexWeed Dec 23, 2018
01b8241
Enable 24 bit editing
ApexWeed Dec 29, 2018
21b9ce5
Merge branch 'feature-py3'
ApexWeed Jan 11, 2019
ee1a913
Move source flag to config
ApexWeed Jan 11, 2019
bf5204b
Update readme
ApexWeed Jan 12, 2019
efedf42
Add support for multiple data directories
ApexWeed Jan 13, 2019
2ff3202
MechanicalSoup 0.12.0 compatibility
ApexWeed Sep 19, 2019
73a4f2f
Add error message when running python < 3.6.0
ApexWeed Nov 14, 2019
89b52e2
workaround for KeyError
buiniyslavik Mar 8, 2021
92bff1b
Merge pull request #2 from buiniyslavik/master
ApexWeed Mar 8, 2021
8f91a91
fixed logging in with new login page
doggo404 Apr 1, 2021
89adeb1
Update whatapi.py
doggo404 Apr 2, 2021
400912f
Update whatapi.py
doggo404 Apr 2, 2021
f663cc5
Update whatapi.py
doggo404 Apr 2, 2021
b539b05
Merge pull request #3 from doggo404/patch-1
ApexWeed Apr 3, 2021
a9fd059
Fix 24bit behavior for Python 3
Majora320 Apr 24, 2021
3fdc7e6
Merge pull request #4 from Majora320/master
ApexWeed Apr 24, 2021
0b4309d
Logging in by post request was fixed, no need to use mechanicalsoup.
doggo404 Jun 7, 2021
863537d
Merge pull request #5 from doggo404/patch-1
ApexWeed Jun 13, 2021
0466416
Removed v2 from config as it is no longer needed.
doggo404 Sep 19, 2021
c787581
Merge pull request #6 from doggo404/patch-2
ApexWeed Sep 20, 2021
9204c14
fix better
ApexWeed May 18, 2022
48f728d
replace distutils
ApexWeed May 18, 2022
d1f9384
fix snatched and uploaded
ApexWeed May 18, 2022
97f611b
add missing deps
ApexWeed May 18, 2022
e3e9fea
add rate limiting to html pages
ApexWeed May 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 90 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
Introduction
------------

whatbetter is a script which automatically transcodes and uploads these
files to What.CD.
orpheusbetter is a script which automatically transcodes and uploads these
files to Orpheus.

The following command will scan through every FLAC you have ever
downloaded (if it is in , determine which formats are needed, transcode the FLAC to
each needed format, and upload each format to What.CD -- automatically.
downloaded or uploaded (if it is in , determine which formats are needed, transcode
the FLAC to each needed format, and upload each format to Orpheus -- automatically.

$ whatbetter
$ orpheusbetter

Installation
------------

You're going to need to install a few dependencies before using
whatbetter.
orpheusbetter.

First and foremost, you will need Python 2.7 or newer.
First and foremost, you will need Python 3.6 or newer. NOTE: this version
has been ported to Python 3.x and will not run under Python 2.x.

Once you've got Python installed, you will need a few modules: mechanize,
mutagen, and requests. Try this:

$ pip install -r requirements.txt
$ pip3 install -r requirements.txt


If you are on a seedbox, or a system without root priviliages, try this:


$ pip install --user -r requirements.txt
$ pip3 install --user -r requirements.txt


Alternatively, if you have setuptools installed, you can do this (in the
source directory):

$ python setup.py install

This should theoretically install all required dependencies
automatically.

Furthermore, you need several external programs: mktorrent, flac,
Furthermore, you need several external programs: mktorrent 1.1+, flac,
lame, and sox. The method of installing these programs varies
depending on your operating system, but if you're using something like
Ubuntu you can do this:
Expand All @@ -51,16 +44,16 @@ you could contact your provider to have these packages installed.

At this point you may execute the following command:

$ whatbetter
$ orpheusbetter

And you will receive a notification stating that you should edit the
configuration file \~/.whatbetter/config (if you're lucky).
configuration file \~/.orpheusbetter/config (if you're lucky).

Configuration
-------------

You've made it far! Congratulations. Open up the file
\~/.whatbetter/config in a text editor. You're going to see something
\~/.orpheusbetter/config in a text editor. You're going to see something
like this:

[whatcd]
Expand All @@ -72,24 +65,51 @@ like this:
formats = flac, v0, 320, v2
media = sacd, soundboard, web, dvd, cd, dat, vinyl, blu-ray
24bit_behaviour = 0
tracker = https://home.opsfet.ch/
api = https://orpheus.network
mode = both
source = OPS

`username` and `password` are your Orpheus login credentials.

`username` and `password` are your What.CD login credentials.
`data_dir` is the directory where your downloads are stored.

`output_dir` is the directory where your transcodes will be created. If
the value is blank, `data_dir` will be used.
the value is blank, `data_dir` will be used. You can also specify
per format values such as `output_dir_320` or `output_dir_v0`.

`torrent_dir` is the directory where torrents should be created (e.g.,
your watch directory). `formats` is a list of formats that you'd like to
support (so if you don't want to upload V2, just remove it from this
list).
your watch directory). Same per format settings as output_dir apply.

`formats` is a list of formats that you'd like to support
(so if you don't want to upload V2, just remove it from this list).

`media` is a list of lossless media types you want to consider for
transcoding. The default value is all What.CD lossless formats, but if
you want to transcode only CD and vinyl media, for example, you would
set this to 'cd, vinyl'.

`24bit_behaviour` defines what happens when the program encounters a FLAC
that it thinks is 24bits. If it is set to '2', every FLAC that has a bits-
per-sample property of 24 will be silently re-categorized. If it set to '1',
a prompt will appear. The default is '0' which ignores these occurrences.

`tracker` is the base url to use in the torrent files.

`api` is the base url to use for api requests.

`mode` is which list of torrents to search for candidates. One of:

- `snatched` - Your snatched torrents.
- `uploaded` - Your uploaded torrents.
- `both` - Your uploaded and snatched torrents.
- `seeding` - Better.php for your seeding torrents.
- `all` - All transcode sources above.
- `none` - Disable scraping.

`source` is the source flag to put on created torrents, leave blank if you're
running mktorrent 1.0.

You should end up with something like this:

[whatcd]
Expand All @@ -101,44 +121,67 @@ You should end up with something like this:
formats = flac, v0, 320
media = cd, vinyl, web
24bit_behaviour = 0
tracker = https://home.opsfet.ch/
api = https://orpheus.network
mode = both
source = OPS

Alright! Now you're ready to use whatbetter.
Alright! Now you're ready to use orpheusbetter.

Usage
-----

usage: whatbetter [-h] [-s] [--config CONFIG] [--cache CACHE]
[release_urls [release_urls ...]]

positional arguments:
release_urls the URL where the release is located

optional arguments:
-h, --help show this help message and exit
-s, --single only add one format per release (useful for getting unique
groups)
--config CONFIG the location of the configuration file (default:
~/.whatbetter/config)
--cache CACHE the location of the cache (default: ~/.whatbetter/cache)
```
usage: orpheusbetter [-h] [-s] [-j THREADS] [--config CONFIG] [--cache CACHE]
[-U] [-E] [--version] [-m MODE] [-S] [-t TOTP]
[-o SOURCE]
[release_urls [release_urls ...]]

positional arguments:
release_urls the URL where the release is located (default: None)

optional arguments:
-h, --help show this help message and exit
-s, --single only add one format per release (useful for getting
unique groups) (default: False)
-j THREADS, --threads THREADS
number of threads to use when transcoding (default: 7)
--config CONFIG the location of the configuration file (default:
~/.orpheusbetter/config)
--cache CACHE the location of the cache (default:
~/.orpheusbetter/cache)
-U, --no-upload don't upload new torrents (in case you want to do it
manually) (default: False)
-E, --no-24bit-edit don't try to edit 24-bit torrents mistakenly labeled
as 16-bit (default: False)
--version show program's version number and exit
-m MODE, --mode MODE mode to search for transcode candidates; snatched,
uploaded, both, seeding, or all (default: None)
-S, --skip treats a torrent as already processed (default: False)
-t TOTP, --totp TOTP time based one time password for 2FA (default: None)
-o SOURCE, --source SOURCE
the value to put in the source flag in created
torrents (default: None)
```

Examples
--------

To transcode and upload every snatch you've ever downloaded (this may
take a while):
To transcode and upload every snatch you've ever downloaded along with all
your uploads (this may take a while):

$ whatbetter
$ orpheusbetter

To transcode and upload a specific release (provided you have already
downloaded the FLAC and it is located in your `data_dir`):

$ whatbetter http://what.cd/torrents.php?id=1000\&torrentid=1000000
$ orpheusbetter https://orpheus.network/torrents.php?id=1000\&torrentid=1000000

Note that if you specify a particular release(s), whatbetter will
Note that if you specify a particular release(s), orpheusbetter will
ignore your configuration's media types and attempt to transcode the
releases you have specified regardless of their media type (so long as
they are lossless types).

Your first time running whatbetter might take a while, but after it has
Your first time running orpheusbetter might take a while, but after it has
successfully gone through and checked everything, it'll go faster any
consecutive runs due to it's caching method.
consecutive runs due to its caching method
2 changes: 1 addition & 1 deletion _version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3"
__version__ = "2.0.3"
Loading