├── .dockerignore
├── .github
├── FUNDING.yml
├── stale.yml
└── workflows
│ └── build_images.yml
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── premiumizer
├── DownloadTask.py
├── __init__.py
├── docker-entrypoint.sh
├── premiumizer.py
├── settings.cfg.tpl
├── static
│ ├── css
│ │ └── style.css
│ ├── img
│ │ └── favicon.ico
│ └── js
│ │ └── control.js
├── templates
│ ├── 404.html
│ ├── about.html
│ ├── base.html
│ ├── history.html
│ ├── index.html
│ ├── log.html
│ ├── login.html
│ └── settings.html
└── utils.py
└── requirements.txt
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.git
2 | **/.gitignore
3 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: pieterjanssens13976
2 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Number of days of inactivity before an issue becomes stale
2 | daysUntilStale: 60
3 | # Number of days of inactivity before a stale issue is closed
4 | daysUntilClose: 7
5 | # Issues with these labels will never be considered stale
6 | exemptLabels:
7 | - pinned
8 | - security
9 | # Label to use when marking an issue as stale
10 | staleLabel: wontfix
11 | # Comment to post when marking an issue as stale. Set to `false` to disable
12 | markComment: >
13 | This issue has been automatically marked as stale because it has not had
14 | recent activity. It will be closed if no further activity occurs. Thank you
15 | for your contributions.
16 | # Comment to post when closing a stale issue. Set to `false` to disable
17 | closeComment: >
18 | Feel free to reopen if the issue persists on the latest version.
--------------------------------------------------------------------------------
/.github/workflows/build_images.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'build images'
3 |
4 | on:
5 | push:
6 | branches:
7 | - master
8 |
9 | jobs:
10 | docker:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v2
15 |
16 | - name: Prepare
17 | id: prep
18 | run: |
19 | DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
20 | VERSION=latest
21 | SHORTREF=${GITHUB_SHA::8}
22 |
23 | # If this is git tag, use the tag name as a docker tag
24 | if [[ $GITHUB_REF == refs/tags/* ]]; then
25 | VERSION=${GITHUB_REF#refs/tags/v}
26 | fi
27 | TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
28 |
29 | # If the VERSION looks like a version number, assume that
30 | # this is the most recent version of the image and also
31 | # tag it 'latest'.
32 | if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
33 | TAGS="$TAGS,${DOCKER_IMAGE}:latest"
34 | fi
35 |
36 | # Set output parameters.
37 | echo ::set-output name=tags::${TAGS}
38 | echo ::set-output name=docker_image::${DOCKER_IMAGE}
39 |
40 | - name: Set up QEMU
41 | uses: docker/setup-qemu-action@master
42 | with:
43 | platforms: all
44 |
45 | - name: Set up Docker Buildx
46 | id: buildx
47 | uses: docker/setup-buildx-action@master
48 |
49 | - name: Login to DockerHub
50 | if: github.event_name != 'pull_request'
51 | uses: docker/login-action@v1
52 | with:
53 | username: ${{ secrets.DOCKER_USERNAME }}
54 | password: ${{ secrets.DOCKER_PASSWORD }}
55 |
56 | - name: Build
57 | uses: docker/build-push-action@v2
58 | with:
59 | builder: ${{ steps.buildx.outputs.name }}
60 | context: .
61 | file: ./Dockerfile
62 | platforms: linux/amd64,linux/arm64
63 | push: true
64 | tags: ${{ steps.prep.outputs.tags }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #Premiumizer Specific
2 | conf/
3 |
4 | .vscode/
5 |
6 | **.DS_Store
7 |
8 | #PyCharm
9 | .idea/
10 |
11 | # Byte-compiled / optimized / DLL files
12 | __pycache__/
13 | *.py[cod]
14 |
15 | # C extensions
16 | *.so
17 |
18 | # Distribution / packaging
19 | .Python
20 | nzbtomedia/
21 | env/
22 | build/
23 | develop-eggs/
24 | dist/
25 | downloads/
26 | eggs/
27 | .eggs/
28 | #lib/
29 | lib64/
30 | parts/
31 | sdist/
32 | var/
33 | *.egg-info/
34 | .installed.cfg
35 | *.egg
36 |
37 | # PyInstaller
38 | # Usually these files are written by a python script from a template
39 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
40 | *.manifest
41 | *.spec
42 |
43 | # PIP
44 | pip-log.txt
45 | pip-delete-this-directory.txt
46 | virtualenv/
47 |
48 | # Unit test / coverage reports
49 | htmlcov/
50 | .tox/
51 | .coverage
52 | .coverage.*
53 | .cache
54 | nosetests.xml
55 | coverage.xml
56 | *,cover
57 |
58 | # Translations
59 | *.mo
60 | *.pot
61 |
62 | # Django stuff:
63 | *.log
64 |
65 | # Sphinx documentation
66 | docs/_build/
67 |
68 | # PyBuilder
69 | target/
70 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM python:3-alpine
2 |
3 | WORKDIR /app
4 | COPY requirements.txt requirements.txt
5 | COPY premiumizer .
6 |
7 | RUN apk add --update --no-cache libffi-dev openssl-dev build-base su-exec shadow
8 |
9 | RUN pip install --no-cache-dir -r requirements.txt
10 |
11 | RUN addgroup -S -g 6006 premiumizer
12 | RUN adduser -S -D -u 6006 -G premiumizer -s /bin/sh premiumizer
13 |
14 | VOLUME /conf
15 | EXPOSE 5000
16 |
17 | ENTRYPOINT ["/bin/sh","docker-entrypoint.sh"]
18 | CMD ["/usr/local/bin/python", "premiumizer.py"]
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Pieter Janssens
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Premiumizer
2 |
3 |  
4 |
5 | Premiumizer is a download management tool for premiumize.me cloud downloads, which allows automatic downloading to your personal computer/server.
6 |
7 | - Web interface to manage premiumize.me downloads: cloud Torrent & Nzb and Filehosts links
8 | - Category based automatic downloader of finished cloud tasks to local file system
9 | - Picks up new taks through black hole
10 | - Integrates with nzbToMedia (post processing)
11 |
12 | Enjoying it so far? Great! If you want to show your appreciation, feel free to:
13 |
14 |
15 |
16 | ## About premiumize.me
17 |
18 | Premiumize.me combines anonymous cloud torrent downloads, usenet and premium hosters in one subscription. Cloud torrent downloads are cached, meaning if some other premiumize.me member downloaded the torrent through premiumize.me before, you can immediately download the files from that torrent over HTTPS at top speeds.
19 |
20 | Get your account [right here](https://www.premiumize.me/ref/198754075).
21 |
22 | ## How does it work?
23 |
24 | Premiumizer will monitor download tasks on premiumize.me.
25 | Once the download in the cloud finishes and the download task has a category that needs to be automatically downloaded premiumizer will start downloading all the files to your local computer where premiumizer is running. Download tasks without a category will not be automatically downloaded locally. Categories can be setup through the web interface's setup page.
26 |
27 | When enabled, premiumizer can inform nzbToMedia whenever the local download is finished.
28 |
29 | ## Web Interface
30 |
31 | By default, premiumizer's web interface listens on port 5000.
32 | When premiumizer is running you can access it at http://localhost:5000/
33 |
34 | ## Installation using Docker
35 |
36 | We have provide images for `amd64` & `arm64v8`. If you have a different architecture, you can build this yourself using our Dockerfile.
37 |
38 | You need to set the correct PUID and PGID equal to the user that has rw access to the mounted volumes.
39 |
40 | ```shell
41 | docker run \
42 | --name premiumizer \
43 | -e PUID=1000 \
44 | -e PGID=1000 \
45 | -e TZ=Europe/London \
46 | -p 5000:5000 \
47 | -v /path/to/conf:/conf \
48 | -v /path/to/blackhole:/blackhole \
49 | -v /path/to/downloads:/downloads \
50 | --restart unless-stopped \
51 | piejanssens/premiumizer
52 | ```
53 |
54 | ### Synology DSM
55 |
56 | 1. Create a folder using File Station where Premiumizer can store its config and logs (e.g. /volume1/docker/premiumizer)
57 | 2. Identify (or create) the locations for blackhole and downloads that Premiumizer will use
58 | 3. SSH into your syno and figure out the PUID and PGID of the user that has access to these folders
59 | 4. Open Docker app
60 | 5. Under 'Registry': Download the piejanssens/premiumizer image
61 | 6. Under 'Image': Select the image and click 'launch'
62 | 7. Map a port of your chosing to '5000' (e.g. Chosing 5555 to 5000, means your Premiumizer will be accessible through 5555)
63 | 8. Map your blackhole folder to '/blackhole'
64 | 9. Map your downloads folder to '/downloads'
65 | 10. Map your premiumizer conf folder to '/conf'
66 | 11. Set the following environment variables:
67 |
68 | - PUID (see step 3.)
69 | - PGID (see step 3.)
70 | - TZ (e.g. Europe/London)
71 |
72 | #### Updating images on Synology
73 |
74 | 1. Stop the container
75 | 2. Right click the container: Action -> Clear/Rest
76 | 3. Under 'Registry': Download the piejanssens/premiumizer image (this will pull in the latest image)
77 | 4. Start the container
78 |
79 | ## Windows Installer
80 |
81 | [PremiumizerInstaller](https://github.com/neox387/PremiumizerInstaller/releases)
82 |
83 | Open services.msc & edit Premiumizer service to logon using your account that is an administrator.
84 |
85 | ## Manual Installation
86 |
87 | Required: Git & Python 3 (with pip)
88 |
89 | ### Windows
90 |
91 | ```shell
92 | git clone https://github.com/piejanssens/premiumizer.git C:\Premiumizer
93 | python -m pip install --upgrade pip
94 | python -m pip install -pywin32
95 | python -m pip install -r c:\Premiumizer\requirements.txt
96 | python C:\Premiumizer\premiumizer\premiumizer.py
97 | ```
98 |
99 | ### Unix / macOS
100 |
101 | ```shell
102 | $ brew install python3
103 | $ git clone https://github.com/piejanssens/premiumizer.git premiumizer
104 | $ cd premiumizer
105 | $ pip install -r requirements.txt
106 | $ python premiumizer/premiumizer.py
107 | ```
108 |
109 | ## Updating
110 |
111 | Update from the settings page / enable automatic updates
112 | Update button & changes will be displayed when an update is available.
113 |
114 | ## Settings
115 |
116 | Once you can access the premiumizer web interface make sure you head over to the settings page.
117 |
118 | ## Development
119 |
120 | Want to contribute? Great!
121 | Just fork the github repo, do some awesome stuff and create a pull request.
122 |
123 | Report issues or feature enhancements/requests on the [Issues](https://github.com/piejanssens/premiumizer/issues) page
124 |
--------------------------------------------------------------------------------
/premiumizer/DownloadTask.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 |
4 | class DownloadTask:
5 | def __init__(self, callback, id, folder_id, size, name, category, dldir, dlext, dlext_blacklist, delsample, dlnzbtomedia, type):
6 | self.progress = None
7 | self.speed = None
8 | self.size = size
9 | self.id = id
10 | self.folder_id = folder_id
11 | self.file_id = None
12 | self.name = name
13 | self.category = category
14 | self.timestamp = int(time.time())
15 | self.previous_timestamp = None
16 | self.speed = None
17 | self.cloud_status = None
18 | self.cloud_ratio = None
19 | self.local_status = None
20 | self.eta = None
21 | self.callback = callback
22 | self.dldir = dldir
23 | self.dlext = dlext
24 | self.dlext_blacklist = dlext_blacklist
25 | self.delsample = delsample
26 | self.dlnzbtomedia = dlnzbtomedia
27 | self.dltime = 0
28 | self.dlsize = ''
29 | self.type = type
30 | self.download_list = []
31 |
32 | def update(self, **kwargs):
33 | self.previous_timestamp = self.timestamp
34 | self.timestamp = int(time.time())
35 | if 'progress' in kwargs:
36 | self.progress = kwargs.get('progress')
37 | if 'cloud_status' in kwargs:
38 | self.cloud_status = kwargs.get('cloud_status')
39 | if 'local_status' in kwargs:
40 | self.local_status = kwargs.get('local_status')
41 | if 'name' in kwargs:
42 | self.name = kwargs.get('name')
43 | if 'size' in kwargs:
44 | self.size = kwargs.get('size')
45 | if self.cloud_status == "finished" and not self.local_status:
46 | self.progress = 100
47 | if 'speed' in kwargs:
48 | self.speed = kwargs.get('speed')
49 | if 'eta' in kwargs:
50 | self.eta = kwargs.get('eta')
51 | if 'category' in kwargs:
52 | self.category = kwargs.get('category')
53 | if 'dldir' in kwargs:
54 | self.dldir = kwargs.get('dldir')
55 | if 'dlext' in kwargs:
56 | self.dlext = kwargs.get('dlext')
57 | if 'dlext_blacklist' in kwargs:
58 | self.dlext_blacklist = kwargs.get('dlext_blacklist')
59 | if 'delsample' in kwargs:
60 | self.delsample = kwargs.get('delsample')
61 | if 'dlnzbtomedia' in kwargs:
62 | self.dlnzbtomedia = kwargs.get('dlnzbtomedia')
63 | if 'dltime' in kwargs:
64 | self.dltime = kwargs.get('dltime')
65 | if 'dlsize' in kwargs:
66 | self.dlsize = kwargs.get('dlsize')
67 | if 'type' in kwargs:
68 | self.type = kwargs.get('type')
69 | if 'id' in kwargs:
70 | self.id = kwargs.get('id')
71 | if 'folder_id' in kwargs:
72 | self.folder_id = kwargs.get('folder_id')
73 | if 'file_id' in kwargs:
74 | self.file_id = kwargs.get('file_id')
75 | if 'download_list' in kwargs:
76 | self.download_list = kwargs.get('download_list')
77 | self.callback('update_task', {'task': self.get_json()})
78 |
79 | def get_json(self):
80 | return {'progress': self.progress, 'speed': self.speed, 'dlsize': self.dlsize, 'eta': self.eta, 'id': self.id,
81 | 'folder_id': self.folder_id, 'file_id': self.file_id, 'name': self.name, 'type': self.type,
82 | 'cloud_status': self.cloud_status, 'local_status': self.local_status, 'category': self.category}
83 |
--------------------------------------------------------------------------------
/premiumizer/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piejanssens/premiumizer/83982c7b686cc0f69080af1f8cb59ef989e039bf/premiumizer/__init__.py
--------------------------------------------------------------------------------
/premiumizer/docker-entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | PUID=${PUID:-6006}
4 | PGID=${PGID:-6006}
5 |
6 | groupmod -o -g "$PGID" premiumizer || true
7 | usermod -o -u "$PUID" premiumizer || true
8 |
9 | chown -R premiumizer:premiumizer /conf || true
10 |
11 | # Allow write access on downloaded files to group and others
12 | umask 0000
13 |
14 | exec su-exec premiumizer "$@"
15 |
--------------------------------------------------------------------------------
/premiumizer/settings.cfg.tpl:
--------------------------------------------------------------------------------
1 | [global]
2 | server_port = 5000
3 | bind_ip = 0.0.0.0
4 | reverse_proxy_path =
5 | custom_domain =
6 | active_interval = 3
7 | idle_interval = 300
8 | debug_enabled = 0
9 |
10 | [security]
11 | login_enabled = 0
12 | username =
13 | password =
14 |
15 | [premiumize]
16 | apikey =
17 |
18 | [downloads]
19 | time_shed = 0
20 | time_shed_start = 00:00
21 | time_shed_stop = 06:00
22 | download_enabled = 0
23 | download_all = 0
24 | download_rss = 0
25 | download_max = 1
26 | download_threads = 1
27 | download_speed = -1
28 | remove_cloud = 0
29 | remove_cloud_delay = 0
30 | seed_torrent = 0
31 | download_location =
32 | nzbtomedia_location = [Change to path]\nzbToMedia.py
33 | jd_enabled = 0
34 | jd_username =
35 | jd_password =
36 | jd_device_name =
37 | aria2_enabled = 0
38 | aria2_host = localhost
39 | aria2_port = 6800
40 | aria2_secret = premiumizer
41 |
42 | [categories]
43 | cat_name[1] = tv
44 | cat_dir[1] =
45 | cat_ext[1] =
46 | cat_ext_blacklist[1] = 0
47 | cat_delsample[1] = 0
48 | cat_nzbtomedia[1] = 0
49 | cat_name[2] = movie
50 | cat_dir[2] =
51 | cat_ext[2] =
52 | cat_ext_blacklist[2] = 0
53 | cat_delsample[2] = 0
54 | cat_nzbtomedia[2] = 0
55 | cat_name[3] =
56 | cat_dir[3] =
57 | cat_ext[3] =
58 | cat_ext_blacklist[3] = 0
59 | cat_delsample[3] = 0
60 | cat_nzbtomedia[3] = 0
61 | cat_name[4] =
62 | cat_dir[4] =
63 | cat_ext[4] =
64 | cat_ext_blacklist[4] = 0
65 | cat_delsample[4] = 0
66 | cat_nzbtomedia[4] = 0
67 | cat_name[5] =
68 | cat_dir[5] =
69 | cat_ext[5] =
70 | cat_ext_blacklist[5] = 0
71 | cat_delsample[5] = 0
72 | cat_nzbtomedia[5] = 0
73 | cat_name[6] = default
74 | cat_dir[6] =
75 | cat_ext[6] =
76 | cat_ext_blacklist[6] = 0
77 | cat_delsample[6] = 0
78 | cat_nzbtomedia[6] = 0
79 |
80 | [upload]
81 | watchdir_enabled = 0
82 | watchdir_location =
83 | watchdir_walk_enabled = 0
84 | watchdir_walk_interval = 60
85 |
86 | [notifications]
87 | email_enabled = 0
88 | email_on_failure = 0
89 | email_from =
90 | email_to =
91 | email_server =
92 | email_port =
93 | email_encryption = 0
94 | email_username =
95 | email_password =
96 | apprise_enabled = 0
97 | apprise_push_on_failure = 0
98 | apprise_url =
99 |
100 | [update]
101 | #Do not change these values#
102 | updated = 1
103 | auto_update = 0
104 | update_date = Never
105 | config_version = 2.9
106 | req_version = 11.0
--------------------------------------------------------------------------------
/premiumizer/static/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 70px;
3 | }
4 |
5 | .pointer {
6 | cursor: pointer;
7 | }
8 |
9 | .center-block {
10 | float: none;
11 | margin-left: auto;
12 | margin-right: auto;
13 | }
14 |
15 | .input-group .icon-addon .form-control {
16 | border-radius: 0;
17 | }
18 |
19 | .icon-addon {
20 | position: relative;
21 | color: #555;
22 | display: block;
23 | }
24 |
25 | .icon-addon:after,
26 | .icon-addon:before {
27 | display: table;
28 | content: " ";
29 | }
30 |
31 | .icon-addon:after {
32 | clear: both;
33 | }
34 |
35 | .icon-addon.addon-md .glyphicon,
36 | .icon-addon .glyphicon,
37 | .icon-addon.addon-md .fa,
38 | .icon-addon .fa {
39 | position: absolute;
40 | z-index: 2;
41 | left: 10px;
42 | font-size: 14px;
43 | width: 20px;
44 | margin-left: -2.5px;
45 | text-align: center;
46 | padding: 10px 0;
47 | top: 1px
48 | }
49 |
50 | .icon-addon.addon-lg .form-control {
51 | line-height: 1.33;
52 | height: 46px;
53 | font-size: 18px;
54 | padding: 10px 16px 10px 40px;
55 | }
56 |
57 | .icon-addon.addon-sm .form-control {
58 | height: 30px;
59 | padding: 5px 10px 5px 28px;
60 | font-size: 12px;
61 | line-height: 1.5;
62 | }
63 |
64 | .icon-addon.addon-lg .fa,
65 | .icon-addon.addon-lg .glyphicon {
66 | font-size: 18px;
67 | margin-left: 0;
68 | left: 11px;
69 | top: 4px;
70 | }
71 |
72 | .icon-addon.addon-md .form-control,
73 | .icon-addon .form-control {
74 | padding-left: 30px;
75 | float: left;
76 | font-weight: normal;
77 | }
78 |
79 | .icon-addon.addon-sm .fa,
80 | .icon-addon.addon-sm .glyphicon {
81 | margin-left: 0;
82 | font-size: 12px;
83 | left: 5px;
84 | top: -1px
85 | }
86 |
87 | .icon-addon .form-control:focus + .glyphicon,
88 | .icon-addon:hover .glyphicon,
89 | .icon-addon .form-control:focus + .fa,
90 | .icon-addon:hover .fa {
91 | color: #2580db;
92 | }
93 |
94 | .table tbody > tr > td.vert-align {
95 | vertical-align: middle;
96 | }
97 |
98 | .table tbody > tr > td.taskname {
99 | word-wrap: break-word;
100 | word-break: break-all;
101 | white-space: normal;
102 | }
103 |
104 | .bootstrap-switch-container {
105 | white-space: nowrap;
106 | }
107 |
108 | .panel-body {
109 | padding-left: 30px;
110 | padding-right: 30px;
111 | padding-top: 10px;
112 | padding-bottom: 10px;
113 | }
114 |
115 | .dropdown-menu {
116 | position: relative;
117 | }
118 |
119 | h4 {
120 | word-wrap: break-word;
121 | }
122 |
123 | .col:not(:first-child), .col:not(:last-child) {
124 | padding-right: 7px;
125 | padding-left: 7px;
126 | }
127 |
128 | .padding-xs {
129 | padding: .25em;
130 | }
131 |
132 | .padding-sm {
133 | padding: .5em;
134 | }
135 |
136 | .padding-md {
137 | padding: 1em;
138 | }
139 |
140 | .padding-lg {
141 | padding: 1.5em;
142 | }
143 |
144 | .padding-xl {
145 | padding: 3em;
146 | }
147 |
148 | .padding-x-xs {
149 | padding: .25em 0;
150 | }
151 |
152 | .padding-x-sm {
153 | padding: .5em 0;
154 | }
155 |
156 | .padding-x-md {
157 | padding: 1em 0;
158 | }
159 |
160 | .padding-x-lg {
161 | padding: 1.5em 0;
162 | }
163 |
164 | .padding-x-xl {
165 | padding: 3em 0;
166 | }
167 |
168 | .padding-y-xs {
169 | padding: 0 .25em;
170 | }
171 |
172 | .padding-y-sm {
173 | padding: 0 .5em;
174 | }
175 |
176 | .padding-y-md {
177 | padding: 0 1em;
178 | }
179 |
180 | .padding-y-lg {
181 | padding: 0 1.5em;
182 | }
183 |
184 | .padding-y-xl {
185 | padding: 0 3em;
186 | }
187 |
188 | .padding-top-xs {
189 | padding-top: .25em;
190 | }
191 |
192 | .padding-top-sm {
193 | padding-top: .5em;
194 | }
195 |
196 | .padding-top-md {
197 | padding-top: 1em;
198 | }
199 |
200 | .padding-top-lg {
201 | padding-top: 1.5em;
202 | }
203 |
204 | .padding-top-xl {
205 | padding-top: 3em;
206 | }
207 |
208 | .padding-right-xs {
209 | padding-right: .25em;
210 | }
211 |
212 | .padding-right-sm {
213 | padding-right: .5em;
214 | }
215 |
216 | .padding-right-md {
217 | padding-right: 1em;
218 | }
219 |
220 | .padding-right-lg {
221 | padding-right: 1.5em;
222 | }
223 |
224 | .padding-right-xl {
225 | padding-right: 3em;
226 | }
227 |
228 | .padding-bottom-xs {
229 | padding-bottom: .25em;
230 | }
231 |
232 | .padding-bottom-sm {
233 | padding-bottom: .5em;
234 | }
235 |
236 | .padding-bottom-md {
237 | padding-bottom: 1em;
238 | }
239 |
240 | .padding-bottom-lg {
241 | padding-bottom: 1.5em;
242 | }
243 |
244 | .padding-bottom-xl {
245 | padding-bottom: 3em;
246 | }
247 |
248 | .padding-left-xs {
249 | padding-left: .25em;
250 | }
251 |
252 | .padding-left-sm {
253 | padding-left: .5em;
254 | }
255 |
256 | .padding-left-md {
257 | padding-left: 1em;
258 | }
259 |
260 | .padding-left-lg {
261 | padding-left: 1.5em;
262 | }
263 |
264 | .padding-left-xl {
265 | padding-left: 3em;
266 | }
267 |
268 | .margin-xs {
269 | margin: .25em;
270 | }
271 |
272 | .margin-sm {
273 | margin: .5em;
274 | }
275 |
276 | .margin-md {
277 | margin: 1em;
278 | }
279 |
280 | .margin-lg {
281 | margin: 1.5em;
282 | }
283 |
284 | .margin-xl {
285 | margin: 3em;
286 | }
287 |
288 | .margin-x-xs {
289 | margin: .25em 0;
290 | }
291 |
292 | .margin-x-sm {
293 | margin: .5em 0;
294 | }
295 |
296 | .margin-x-md {
297 | margin: 1em 0;
298 | }
299 |
300 | .margin-x-lg {
301 | margin: 1.5em 0;
302 | }
303 |
304 | .margin-x-xl {
305 | margin: 3em 0;
306 | }
307 |
308 | .margin-y-xs {
309 | margin: 0 .25em;
310 | }
311 |
312 | .margin-y-sm {
313 | margin: 0 .5em;
314 | }
315 |
316 | .margin-y-md {
317 | margin: 0 1em;
318 | }
319 |
320 | .margin-y-lg {
321 | margin: 0 1.5em;
322 | }
323 |
324 | .margin-y-xl {
325 | margin: 0 3em;
326 | }
327 |
328 | .margin-top-xs {
329 | margin-top: .25em;
330 | }
331 |
332 | .margin-top-sm {
333 | margin-top: .5em;
334 | }
335 |
336 | .margin-top-md {
337 | margin-top: 1em;
338 | }
339 |
340 | .margin-top-lg {
341 | margin-top: 1.5em;
342 | }
343 |
344 | .margin-top-xl {
345 | margin-top: 3em;
346 | }
347 |
348 | .margin-right-xs {
349 | margin-right: .25em;
350 | }
351 |
352 | .margin-right-sm {
353 | margin-right: .5em;
354 | }
355 |
356 | .margin-right-md {
357 | margin-right: 1em;
358 | }
359 |
360 | .margin-right-lg {
361 | margin-right: 1.5em;
362 | }
363 |
364 | .margin-right-xl {
365 | margin-right: 3em;
366 | }
367 |
368 | .margin-bottom-xs {
369 | margin-bottom: .25em;
370 | }
371 |
372 | .margin-bottom-sm {
373 | margin-bottom: .5em;
374 | }
375 |
376 | .margin-bottom-md {
377 | margin-bottom: 1em;
378 | }
379 |
380 | .margin-bottom-lg {
381 | margin-bottom: 1.5em;
382 | }
383 |
384 | .margin-bottom-xl {
385 | margin-bottom: 3em;
386 | }
387 |
388 | .margin-left-xs {
389 | margin-left: .25em;
390 | }
391 |
392 | .margin-left-sm {
393 | margin-left: .5em;
394 | }
395 |
396 | .margin-left-md {
397 | margin-left: 1em;
398 | }
399 |
400 | .margin-left-lg {
401 | margin-left: 1.5em;
402 | }
403 |
404 | .margin-left-xl {
405 | margin-left: 3em;
406 | }
407 |
--------------------------------------------------------------------------------
/premiumizer/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piejanssens/premiumizer/83982c7b686cc0f69080af1f8cb59ef989e039bf/premiumizer/static/img/favicon.ico
--------------------------------------------------------------------------------
/premiumizer/static/js/control.js:
--------------------------------------------------------------------------------
1 | var socket;
2 | var loaded_tasks = false;
3 | var download_categories = [];
4 |
5 | function start_loading_upload() {
6 | $("#loading_upload").attr('style', 'display: inline');
7 | }
8 |
9 | function stop_loading_upload() {
10 | $("#loading_upload").attr('style', 'display: none');
11 | $('#magnet-input').val('');
12 | }
13 |
14 | function stop_loading_download_tasks() {
15 | $("#loading_download_tasks").attr('style', 'display: none');
16 | }
17 |
18 | function show_no_downloads() {
19 | $("#no_downloads").attr('style', 'display: inline');
20 | }
21 |
22 | function hide_no_downloads() {
23 | $("#no_downloads").attr('style', 'display: none');
24 | }
25 |
26 | function show_premiumize_connect_error() {
27 | $('#premiumize_connect_error').attr('style', 'display: inline');
28 | $('#main_container').attr('style', 'display: none');
29 | }
30 |
31 | function category_selected(id, category) {
32 | socket.emit('change_category', {
33 | data: {
34 | id: id,
35 | category: category
36 | }
37 | });
38 | }
39 |
40 | function update_task(task) {
41 | var stateColor;
42 | var stateIcon;
43 | var stateStr;
44 | var categoryState;
45 | if (task.cloud_status == 'running') {
46 | stateColor = 'info';
47 | stateStr = 'Downloading';
48 | stateIcon = 'cloud-download';
49 | categoryState = '';
50 | } else if (task.cloud_status == 'waiting') {
51 | stateColor = 'warning';
52 | stateStr = 'Downloading';
53 | stateIcon = 'cloud';
54 | categoryState = '';
55 | } else if (task.cloud_status == 'queued') {
56 | stateColor = 'warning';
57 | stateStr = 'Download queued';
58 | stateIcon = 'cloud-upload';
59 | categoryState = '';
60 | } else if (task.cloud_status == 'finished' && task.local_status == null) {
61 | stateColor = 'success';
62 | stateStr = 'Finished';
63 | stateIcon = 'cloud';
64 | categoryState = '';
65 | } else if (task.cloud_status == 'seeding' && task.local_status == null) {
66 | stateColor = 'success';
67 | stateStr = 'Seeding';
68 | stateIcon = 'cloud';
69 | categoryState = '';
70 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'queued') {
71 | stateColor = 'primary';
72 | stateStr = 'Download Queue';
73 | stateIcon = 'desktop';
74 | categoryState = '';
75 | } else if (task.cloud_status == 'finished' && task.local_status == 'waiting') {
76 | stateColor = 'info';
77 | stateStr = 'Waiting on category';
78 | stateIcon = 'desktop';
79 | categoryState = '';
80 | } else if (task.cloud_status == 'seeding' && task.local_status == 'waiting') {
81 | stateColor = 'info';
82 | stateStr = 'Waiting on category / Seeding';
83 | stateIcon = 'desktop';
84 | categoryState = '';
85 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'download_disabled') {
86 | stateColor = 'info';
87 | stateStr = 'Downloads are disabled';
88 | stateIcon = 'desktop';
89 | categoryState = '';
90 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'paused') {
91 | stateColor = 'warning';
92 | stateStr = 'Download paused';
93 | stateIcon = 'desktop';
94 | categoryState = '';
95 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'downloading') {
96 | stateColor = 'primary';
97 | stateStr = 'Downloading';
98 | stateIcon = 'desktop';
99 | categoryState = '';
100 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'finished') {
101 | stateColor = 'success';
102 | stateStr = 'Finished';
103 | stateIcon = 'desktop';
104 | categoryState = '';
105 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'finished_waiting') {
106 | stateColor = 'success';
107 | stateStr = 'Waiting to delete';
108 | stateIcon = 'desktop';
109 | categoryState = '';
110 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'finished_seeding') {
111 | stateColor = 'success';
112 | stateStr = 'Waiting to delete / Seeding';
113 | stateIcon = 'desktop';
114 | categoryState = '';
115 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'stopped') {
116 | stateColor = 'warning';
117 | stateStr = 'Download stopped';
118 | stateIcon = 'desktop';
119 | categoryState = '';
120 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'failed: download retrying') {
121 | stateColor = 'warning';
122 | stateStr = 'Failed: download retrying soon';
123 | stateIcon = 'desktop';
124 | categoryState = '';
125 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'failed: download') {
126 | stateColor = 'danger';
127 | stateStr = 'Failed: download';
128 | stateIcon = 'desktop';
129 | categoryState = '';
130 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'failed: nzbToMedia') {
131 | stateColor = 'danger';
132 | stateStr = 'Failed: nzbToMedia';
133 | stateIcon = 'desktop';
134 | categoryState = '';
135 | } else if ((task.cloud_status == 'finished' || task.cloud_status == 'seeding') && task.local_status == 'failed: Filehost') {
136 | stateColor = 'danger';
137 | stateStr = 'Failed: Filehost';
138 | stateIcon = 'desktop';
139 | categoryState = '';
140 | } else if (task.cloud_status == 'error') {
141 | stateColor = 'danger';
142 | stateStr = 'Cloud: Error';
143 | stateIcon = 'cloud-download';
144 | categoryState = '';
145 | } else {
146 | stateColor = 'danger';
147 | stateStr = 'check js console';
148 | stateIcon = 'exclamation-triangle';
149 | console.log('UNKNOWN STATUS - cloud: ' + task.cloud_status + ', local: ' + task.local_status);
150 | }
151 |
152 | var update = false;
153 | if ($("#" + task.id).length > 0) {
154 | update = true;
155 | }
156 |
157 | var dropDown = '
8 |
9 |
12 |
13 |
Date | 9 |Name | 10 |Category | 11 |Type | 12 |Downloaded | 13 |Deleted | 14 |nzbToMedia | 15 |Info | 17 ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ item.date }} | 22 |{{ item.name }} | 23 |{{ item.category }} | 24 |{{ item.type }} | 25 | {% if item.downloaded == '1' %} 26 |SUCCESS | 27 | {% elif item.downloaded == '0' %} 28 |FAILED | 29 | {% else %} 30 |N/A | 31 | {% endif %} 32 | {% if item.deleted == '1' %} 33 |SUCCESS | 34 | {% elif item.deleted == '0' %} 35 |FAILED | 36 | {% else %} 37 |N/A | 38 | {% endif %} 39 | {% if item.nzbtomedia == '1' %} 40 |SUCCESS 41 | | 42 | {% elif item.nzbtomedia == '0' %} 43 |FAILED 44 | | 45 | {% else %} 46 |N/A | 47 | {% endif %} 48 | {% if item.email == '1' %} 49 |SUCCESS | 50 | {% elif item.email == '0' %} 51 |FAILED | 52 | {% else %} 53 |N/A | 54 | {% endif %} 55 |
56 | {% if item.info %}
57 | {% for line in item.info.splitlines() %}
58 | {{ line }} 59 | {% endfor %} |
60 | {% endif %}
61 |
13 |
21 |
29 |
37 |
45 |
53 |
61 |
69 |
Loading Download Tasks
137 |{{ log }}13 |
{{ debuglog }}15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /premiumizer/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block title %} - Home{% endblock %} 3 | {% block content %} 4 | {% block barbuttons %}{% endblock %} 5 |