revert: ⏪ revert to old transmissionrpc
This commit is contained in:
parent
6b208ed90a
commit
7f99179b40
@ -9,10 +9,10 @@ RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
vim p7zip* git mc lftp rename wget curl procps psmisc \
|
||||
openssh-client transmission-cli speedtest-cli \
|
||||
python3-pip python3-requests && \
|
||||
python3-pip python3-requests python3-transmissionrpc && \
|
||||
apt-get install -y --no-install-recommends mame-tools && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
pip install --extra-index-url https://git.crystalyx.net/api/packages/Xefir/pypi/simple/ transmissionrpc-cf yt-dlp && \
|
||||
pip install yt-dlp && \
|
||||
curl -sSL https://raw.githubusercontent.com/MatanZ/tremc/main/tremc -o /usr/local/bin/tremc && \
|
||||
curl -sSL https://raw.githubusercontent.com/putnam/binmerge/master/binmerge -o /usr/local/bin/binmerge && \
|
||||
update-alternatives --set editor /usr/bin/vim.basic
|
||||
|
@ -5,7 +5,7 @@ from sys import stdout
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from requests import get
|
||||
from transmissionrpc_cf import LOGGER, Client # type: ignore
|
||||
from transmissionrpc import LOGGER, Client, DefaultHTTPHandler # type: ignore
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-u", "--username", required=True)
|
||||
@ -15,11 +15,22 @@ args = parser.parse_args()
|
||||
LOGGER.setLevel(INFO)
|
||||
LOGGER.addHandler(StreamHandler(stdout))
|
||||
|
||||
|
||||
class CustomHTTPHandler(DefaultHTTPHandler):
|
||||
def request(self, url, query, headers, timeout):
|
||||
headers["User-Agent"] = (
|
||||
"Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0"
|
||||
)
|
||||
|
||||
return super().request(url, query, headers, timeout)
|
||||
|
||||
|
||||
client = Client(
|
||||
"https://torrent.crystalyx.net/transmission/rpc",
|
||||
port=443,
|
||||
user=args.username,
|
||||
password=args.password,
|
||||
http_handler=CustomHTTPHandler,
|
||||
)
|
||||
|
||||
torrents = client.get_torrents()
|
||||
|
@ -6,7 +6,7 @@ from sys import stdout
|
||||
from time import sleep
|
||||
|
||||
from requests import head
|
||||
from transmissionrpc_cf import LOGGER, Client # type: ignore
|
||||
from transmissionrpc import LOGGER, Client, DefaultHTTPHandler # type: ignore
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("-u", "--username", required=True)
|
||||
@ -16,11 +16,22 @@ args = parser.parse_args()
|
||||
LOGGER.setLevel(INFO)
|
||||
LOGGER.addHandler(StreamHandler(stdout))
|
||||
|
||||
|
||||
class CustomHTTPHandler(DefaultHTTPHandler):
|
||||
def request(self, url, query, headers, timeout):
|
||||
headers["User-Agent"] = (
|
||||
"Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Firefox/111.0"
|
||||
)
|
||||
|
||||
return super().request(url, query, headers, timeout)
|
||||
|
||||
|
||||
client = Client(
|
||||
"https://torrent.crystalyx.net/transmission/rpc",
|
||||
port=443,
|
||||
user=args.username,
|
||||
password=args.password,
|
||||
http_handler=CustomHTTPHandler,
|
||||
)
|
||||
|
||||
for torrent in client.get_torrents():
|
||||
|
21
poetry.lock
generated
21
poetry.lock
generated
@ -292,25 +292,6 @@ files = [
|
||||
{file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "transmissionrpc-cf"
|
||||
version = "0.2.1"
|
||||
description = "Fork of transmissionrpc-ng with CloudFlare support"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "transmissionrpc_cf-0.2.1-py3-none-any.whl", hash = "sha256:f1daf9f5e649250d64009f48a537d9f2f47eeba1687e304c0f073e6f8c484a9e"},
|
||||
{file = "transmissionrpc_cf-0.2.1.tar.gz", hash = "sha256:dda3ab986bd07c674e0e6cf76721c699490cfb805c399fb81fa02406942601f9"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
transmissionrpc-ng = ">=0.13.1,<0.14.0"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://git.crystalyx.net/api/packages/Xefir/pypi/simple"
|
||||
reference = "gitea"
|
||||
|
||||
[[package]]
|
||||
name = "transmissionrpc-ng"
|
||||
version = "0.13.1"
|
||||
@ -388,4 +369,4 @@ test = ["pytest (>=8.1,<9.0)", "pytest-rerunfailures (>=14.0,<15.0)"]
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "085ce1422940a6bc32eea3d6c3ca975435aecbbfd2e25ebca4e1720f5a147b74"
|
||||
content-hash = "2bac6904482a41c72f85536ec7d674c7ccf07ffe737c15affb740bb309ea57d6"
|
||||
|
@ -7,7 +7,7 @@ package-mode = false
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
transmissionrpc-cf = "^0.2.1"
|
||||
transmissionrpc-ng = "~0.13.1"
|
||||
requests = "^2.32.3"
|
||||
yt-dlp = "^2024.11.27"
|
||||
|
||||
@ -16,11 +16,6 @@ ruff = "^0.8.1"
|
||||
mypy = "^1.13.0"
|
||||
types-requests = "^2.32.0"
|
||||
|
||||
[[tool.poetry.source]]
|
||||
name = "gitea"
|
||||
url = "https://git.crystalyx.net/api/packages/Xefir/pypi/simple"
|
||||
priority = "supplemental"
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user