Warlock666

Passing Basics
Beginner
Feb 15, 2021
19
6
30
Awards
11
QNAP
TS-x53
Ethernet
1 GbE
LV
1
 
Firmware version: 4.5.2 1566
Model name: QNAP TS-453A

trying to run python xmlrpc querys but getting 400?

do i need to enable something 1st to allow this

Code:
import xmlrpc.client
server_url='http://username:password@192.168.1.200:6009/RPC2'
server = xmlrpc.client.Server(server_url)

torrents = server.download_list()
 
You put url as it with hardcoded username/password? I'm not expert in python but this not give me any error:
upload_2021-2-15_21-13-28.webp
 

Attachments

  • upload_2021-2-15_21-12-49.webp
    upload_2021-2-15_21-12-49.webp
    29.5 KB · Views: 140
bro - you nicely formatted 1. post - but to lazy to fix next one ? come on ! :> or do you want me to reach to warning button and rule book of forum ?
 
I've narrowed it down abit

if i run directly on nas using localhost instead of IP it seems to work
Code:
server_url='http://username:password@localhost:6009/RPC2'

if I run directon on nas or PC using ip
Code:
server_url='http://username:password@192.168.1.200:6009/RPC2'
i get the following error

Code:
>>> torrents = server.download_list()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/share/CACHEDEV1_DATA/.qpkg/QPython3/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/share/CACHEDEV1_DATA/.qpkg/QPython3/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/share/CACHEDEV1_DATA/.qpkg/QPython3/lib/python3.8/xmlrpc/client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/share/CACHEDEV1_DATA/.qpkg/QPython3/lib/python3.8/xmlrpc/client.py", line 1183, in single_request
    raise ProtocolError(
xmlrpc.client.ProtocolError: <ProtocolError for username:password@192.168.1.247:6009/RPC2: 400 Bad Request>


it looks to me to do with authorization?
 
  • Like
Reactions: 1 person
But RPC is not used to connect with Sonarr/Radarr?
 
So according to Silas it should be enabled already?
if Transdroid can connect to using ip address then other should be able too (TESTED transdroid does connect)

Tried this with postman and same result when trying to get authorization

192.168.1.200:6009/RPC
and basic authorization

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <title>400 - Bad Request</title>
</head>

<body>
    <h1>400 - Bad Request</h1>
</body>

</html>
 

Users search this thread by keywords

  1. RPC2
  2. rtorrent rpc2
  3. XMLRPC
  4. qpython3