Skip to content

Commit

Permalink
Merge pull request #18 from edge20200/PullUpdates
Browse files Browse the repository at this point in the history
Pull updates
edge20200 authored Aug 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 407a3ba + df5a1f8 commit 2c8e4a5
Showing 23 changed files with 1,468 additions and 919 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Create and publish a Docker image
name: Create and publish Docker images

on:
push:
branches: ['master']
branches:
- master
- develop
- qbit-torrent-check

env:
REGISTRY: ghcr.io
@@ -45,13 +48,25 @@ jobs:
id: get_short_commit_id
run: |
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Set image name based on branch
id: set_image_name
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
IMAGE_TAG="master"
elif [ "${{ github.ref_name }}" == "develop" ]; then
IMAGE_TAG="develop"
else
IMAGE_TAG="${{ github.ref_name }}"
fi
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}, ${{ env.REGISTRY }}/${{ env.LOWER_CASE_REPO_NAME }}:${{ env.SHA_SHORT }}
tags: ${{ env.REGISTRY }}/${{ env.LOWER_CASE_REPO_NAME }}:${{ env.IMAGE_TAG }}, ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -8,4 +8,5 @@ data/cookies/*.pickle
.vscode/
__pycache__/
tmp/*
.wdm/
.wdm/
.vs/
54 changes: 30 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
FROM alpine:latest

# Install bash
RUN apk add --no-cache bash

# Add mono repo and mono
RUN apk add --no-cache mono --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing

# Install requirements
RUN apk add --no-cache --upgrade ffmpeg mediainfo python3 git py3-pip python3-dev g++ cargo mktorrent rust
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip3 install wheel

WORKDIR UploadAssistant

# Install python requirements
FROM python:3.11

# Update the package list and install system dependencies including mono
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg \
mediainfo \
git \
g++ \
cargo \
mktorrent \
rustc \
mono-complete && \
rm -rf /var/lib/apt/lists/*

# Set up a virtual environment to isolate our Python dependencies
RUN python -m venv /venv
ENV PATH="/venv/bin:$PATH"

# Install wheel and other Python dependencies
RUN pip install --upgrade pip wheel

# Set the working directory in the container
WORKDIR /Only-Uploader

# Copy the Python requirements file and install Python dependencies
COPY requirements.txt .
RUN pip3 install -r requirements.txt
RUN pip install -r requirements.txt

# Copy everything
# Copy the rest of the application's code
COPY . .

# Set shell command alias
RUN echo 'alias l4g="/Only-Uploader/upload.py"' >> /root/.bashrc

# Start container and tail to keep container running
CMD ["/bin/bash", "-c", "tail -f /dev/null"]
# Set the entry point for the container
ENTRYPOINT ["python", "/Only-Uploader/upload.py"]
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -17,17 +17,26 @@ A simple tool to take the work out of uploading.
- Can re-use existing torrents instead of hashing new
- Generates proper name for your upload using Mediainfo/BDInfo and TMDb/IMDb conforming to site rules
- Checks for existing releases already on site
- Uploads to PTP/BLU/BHD/Aither/THR/STC/R4E(limited)/HP/ACM/LCD/LST/NBL/ANT/FL/HUNO/RF/SN/OE/OTW
- Uploads to OE/PTP/BLU/BHD/Aither/THR/STC/R4E(limited)/HP/ACM/LCD/LST/NBL/ANT/FL/HUNO/RF/SN/RTF/OTW/FNP/CBR/UTP/AL/ULCX
- Adds to your client with fast resume, seeding instantly (rtorrent/qbittorrent/deluge/watch folder)
- ALL WITH MINIMAL INPUT!
- Currently works with .mkv/.mp4/Blu-ray/DVD/HD-DVDs

## Image Hosts:
- OnlyImage - oeimg
- ImgBB - imgbb
- PTPimg - ptpimg
- ImageBox - imgbox
- PixHost - pixhost
- LensDump - lensdump
- PTScreens - ptscreens

## Coming Soon:
- Features


## **Setup:**
- **REQUIRES AT LEAST PYTHON 3.7 AND PIP3**
- **REQUIRES AT LEAST PYTHON 3.12 AND PIP3**
- Needs [mono](https://www.mono-project.com/) on linux systems for BDInfo
- Also needs MediaInfo and ffmpeg installed on your system
- On Windows systems, ffmpeg must be added to PATH (https://windowsloop.com/install-ffmpeg-windows-10/)
12 changes: 11 additions & 1 deletion cogs/commands.py
Original file line number Diff line number Diff line change
@@ -569,6 +569,16 @@ def check(reaction, user):
upload_embed_description = upload_embed_description.replace('STC', '~~STC~~')
upload_embed = discord.Embed(title=f"Uploaded `{meta['name']}` to:", description=upload_embed_description, color=0x00ff40)
await msg.edit(embed=upload_embed)
if "OE" in tracker_list:
OE = OE(config=config)
dupes = await stc.search_existing(meta)
meta = await self.dupe_embed(dupes, meta, tracker_emojis, channel)
if meta['upload'] == True:
await oe.upload(meta)
await client.add_to_client(meta, "OE")
upload_embed_description = upload_embed_description.replace('OE', '~~OE~~')
upload_embed = discord.Embed(title=f"Uploaded `{meta['name']}` to:", description=upload_embed_description, color=0x00ff40)
await msg.edit(embed=upload_embed)
if "LCD" in tracker_list:
lcd = LCD(config=config)
dupes = await lcd.search_existing(meta)
@@ -601,7 +611,7 @@ async def dupe_embed(self, dupes, meta, emojis, channel):
else:
dupe_text = "\n\n•".join(dupes)
dupe_text = f"```•{dupe_text}```"
embed = discord.Embed(title="Are these dupes?", description=dupe_text, color=0xff0000)
embed = discord.Embed(title="Check if these are actually dupes!", description=dupe_text, color=0xff0000)
embed.set_footer(text=f"{emojis['CANCEL']} to abort upload | {emojis['UPLOAD']} to upload anyways")
message = await channel.send(embed=embed)
await message.add_reaction(emojis['CANCEL'])
56 changes: 34 additions & 22 deletions data/example-config.py
Original file line number Diff line number Diff line change
@@ -7,18 +7,20 @@
# -----------------------

"tmdb_api" : "tmdb_api key",
"imgbb_api" : "imgbb api key",
"oeimg_api" : "OnlyImg api key",
"imgbb_api" : "imgbb api key",
"ptscreens_api" : "ptscreens api key",
"ptpimg_api" : "ptpimg api key",
"lensdump_api" : "lensdump api key",

# Order of image hosts, and backup image hosts
"img_host_1": "imgbb",
"img_host_2": "ptpimg",
"img_host_3": "imgbox",
"img_host_4": "pixhost",
"img_host_5": "lensdump",
"img_host_6": "oeimg",
"img_host_1": "oeimg",
"img_host_2": "imgbb",
"img_host_3": "ptpimg",
"img_host_4": "imgbox",
"img_host_5": "pixhost",
"img_host_6": "lensdump",
"img_host_7": "ptscreens",


"screens" : "6",
@@ -36,7 +38,9 @@

"TRACKERS" : {
# Which trackers do you want to upload to?
"default_trackers" : "BLU, BHD, AITHER, STC, SN, THR, R4E, HP, ACM, PTP, LCD, LST, PTER, NBL, ANT, MTV, CBR, RTF, HUNO, BHDTV, LT, PTER, TL, TDC, HDT, OE, RF, OTW, FNP, UTP",
# Available tracker: BLU, BHD, AITHER, STC, SN, THR, R4E, HP, ACM, PTP, LCD, LST, PTER, NBL, ANT, MTV, CBR, RTF, HUNO, BHDTV, LT, PTER, TL, HDT, OE, RF, OTW, FNP, UTP, AL
# Remove the ones not used to save being asked everytime
"default_trackers" : "BLU, BHD, AITHER, STC, SN, THR, R4E, HP, ACM, PTP, LCD, LST, PTER, NBL, ANT, MTV, CBR, RTF, HUNO, BHDTV, LT, PTER, TL, HDT, OE, RF, OTW, FNP, UTP, AL",

"BLU" : {
"useAPI" : False, # Set to True if using BLU
@@ -136,7 +140,7 @@
"announce_url" : "https://locadora.cc/announce/customannounceurl",
# "anon" : False
},
"CBR" : {
"CBR" : {
"api_key" : "CBR api key",
"announce_url" : "https://capybarabr.com/announce/customannounceurl",
# "anon" : False
@@ -172,12 +176,12 @@
"OE" : {
"api_key" : "OE api key",
"announce_url" : "https://onlyencodes.cc/announce/customannounceurl",
#"internal" : True,
#"internal_groups" " ["group1"],
#"internal" : True,
#"internal_groups" " ["group1"],
# "anon" : False
},
"RTF": {
"username" : "username",
"username" : "username",
"password" : "password",
"api_key": 'get_it_by_running_/api/ login command from https://retroflix.club/api/doc',
"announce_url": "get from upload page",
@@ -199,26 +203,43 @@
"announce_url" : "https://fearnopeer.com/announce/customannounceurl",
# "anon" : "False"
},
"ULCX" : {
"api_key" : "ULXC api key",
"announce_url" : "https://upload.cx/announce/customannounceurl",
# "anon" : False
},
"UTP" : {
"api_key" : "UTP api key",
"announce_url" : "https://UTP/announce/customannounceurl",
# "anon" : False
},
"AL" : {
"api_key" : "AL api key",
"announce_url" : "https://animelovers.club/announce/customannounceurl",
# "anon" : False
},
"MANUAL" : {
# Uncomment and replace link with filebrowser (https://github.com/filebrowser/filebrowser) link to the Upload-Assistant directory, this will link to your filebrowser instead of uploading to uguu.se
# "filebrowser" : "https://domain.tld/filebrowser/files/Upload-Assistant/"
},
},

# enable_search to true will automatically try and find a suitable hash to save having to rehash when creating torrents
# Should use the qbit API, but will also use the torrent_storage_dir to find suitable hashes
# If you find issue, use the "--debug" command option to print out some related details

"TORRENT_CLIENTS" : {
# Name your torrent clients here, for example, this example is named "Client1"
# Name your torrent clients here, for example, this example is named "Client1" and is set as default_torrent_client above
# All options relate to the webui, make sure you have the webui secured if it has WAN access
# See https://github.com/edge20200/Only-Uploader/wiki
"Client1" : {
"torrent_client" : "qbit",
# "enable_search" : True,
"qbit_url" : "http://127.0.0.1",
"qbit_port" : "8080",
"qbit_user" : "username",
"qbit_pass" : "password",
# "torrent_storage_dir" : "path/to/BT_backup folder"

# Remote path mapping (docker/etc.) CASE SENSITIVE
# "local_path" : "/LocalPath",
@@ -242,9 +263,6 @@
# If using remote path mapping, use remote path
# For using multiple paths, use a list ["path1", "path2"]
# "automatic_management_paths" : ""



# Remote path mapping (docker/etc.) CASE SENSITIVE
# "local_path" : "E:\\downloads\\tv",
# "remote_path" : "/remote/downloads/tv"
@@ -283,12 +301,6 @@

},







"DISCORD" :{
"discord_bot_token" : "discord bot token",
"discord_bot_description" : "L4G's Upload Assistant",
3 changes: 2 additions & 1 deletion src/args.py
Original file line number Diff line number Diff line change
@@ -52,11 +52,12 @@ def parse(self, args, meta):
parser.add_argument('-d', '--desc', nargs='*', required=False, help="Custom Description (string)")
parser.add_argument('-pb', '--desclink', nargs='*', required=False, help="Custom Description (link to hastebin/pastebin)")
parser.add_argument('-df', '--descfile', nargs='*', required=False, help="Custom Description (path to file)")
parser.add_argument('-ih', '--imghost', nargs='*', required=False, help="Image Host", choices=['imgbb', 'ptpimg', 'imgbox', 'pixhost', 'lensdump', 'oeimg'])
parser.add_argument('-ih', '--imghost', nargs='*', required=False, help="Image Host", choices=['imgbb', 'ptpimg', 'imgbox', 'pixhost', 'lensdump', 'oeimg', 'ptscreens'])
parser.add_argument('-siu', '--skip-imagehost-upload', dest='skip_imghost_upload', action='store_true', required=False, help="Skip Uploading to an image host")
parser.add_argument('-th', '--torrenthash', nargs='*', required=False, help="Torrent Hash to re-use from your client's session directory")
parser.add_argument('-nfo', '--nfo', action='store_true', required=False, help="Use .nfo in directory for description")
parser.add_argument('-k', '--keywords', nargs='*', required=False, help="Add comma seperated keywords e.g. 'keyword, keyword2, etc'")
parser.add_argument('-kf', '--keep-folder', action='store_true', required=False, help="Keep the folder containing the single file. Works only when supplying a directory as input. For uploads with poor filenames, like some scene.")
parser.add_argument('-reg', '--region', nargs='*', required=False, help="Region for discs")
parser.add_argument('-a', '--anon', action='store_true', required=False, help="Upload anonymously")
parser.add_argument('-st', '--stream', action='store_true', required=False, help="Stream Optimized Upload")
Loading

0 comments on commit 2c8e4a5

Please sign in to comment.