Warlock666

Passing Basics
Beginner
15 Luty 2021
19
6
30
Odznaki
11
QNAP
TS-x53
Ethernet
1 GbE
Poz.
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

Kod:
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
 

Załączniki

  • upload_2021-2-15_21-12-49.webp
    upload_2021-2-15_21-12-49.webp
    29,5 KB · Wyświetleń: 115
I've narrowed it down abit

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

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

Kod:
>>> 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?
 
  • Lubię to
Reakcje: 1 osoba
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

Kod:
<?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>
 

Użytkownicy znaleźli tą stronę używając tych słów:

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