Új hozzászólás Aktív témák
-
Hege1234
addikt
Hali
mi okozhatja azt, hogy a result-al nem látom a data első részét? (time)
ezzel szűrveprint (resp['result']['item']['file'])
szépen megkapom az elérési utat de a "time" részt nem tudom elérniprint (resp['result']['time']['hours'])
print (resp['result']['time']['minutes'])
print (resp['result']['time']['seconds'])>>> import json
>>> import base64
>>> from urllib.request import Request, urlopen
>>>
>>> credentials = b'kodi:kodi'
>>> encoded_credentials = base64.b64encode(credentials)
>>> authorization = b'Basic ' + encoded_credentials
>>>
>>> headers = { 'Content-Type': 'application/json', 'Authorization': authorization }
>>> url = 'http://192.168.1.10:8080/jsonrpc?Base'
>>> data = [{"jsonrpc":"2.0","method":"Player.GetProperties","params":[1,["time"]],"id":17},{"jsonrpc":"2.0","method":"Player.GetItem","params":[1,["file"]],"id":18}]
>>>
>>> json_data = json.dumps(data)
>>> post_data = json_data.encode('utf-8')
>>> request = Request(url, post_data, headers)
>>> result = urlopen(request)
>>> print(result.read())
b'[{"id":17,"jsonrpc":"2.0","result":{"time":{"hours":0,"milliseconds":416,"minutes":52,"seconds":59}}},{"id":18,"jsonrpc":"2.0","result":{"item":{"file":"smb://192.168.1.10/n filmek 720p/@.mkv","id":340,"label":"The Expendables 3","type":"movie"}}}]'
>>>
>>> print (resp['result'])
{'item': {'file': 'smb://192.168.1.10/n filmek 720p/@.mkv', 'id': 340, 'label': 'The Expendables 3', 'type': 'movie'}}
Új hozzászólás Aktív témák
- Allegro vélemények - tapasztalatok
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- PlayStation 5
- Milyen billentyűzetet vegyek?
- HDMI topic
- Sweet.tv - internetes TV
- HiFi műszaki szemmel - sztereó hangrendszerek
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- BestBuy topik
- Gitáros topic
- További aktív témák...
- Vadonatúj, bontatlan iScooter i9Max elektromos roller, 1 év gari 35 km/h
- ADATA XPG Lancer Blade 32GB (2x16GB) DDR5 6000MHz CL34 - XMP/EXPO - 120 hó garancia
- Kingston FURY Beast 64GB (2x32GB) DDR5 6400MHz CL32 - XMP/EXPO - 120 hó garancia
- Kingston FURY Beast 32GB (1x32GB) DDR5 5200MHz CL40 - XMP/EXPO - 120 hó garancia
- Kingston FURY Beast 32GB (1x32GB) DDR5 6400MHz CL32 - XMP/EXPO - 120 hó garancia
- Gamer egerek és billentyűzetek kitűnő árakon!
- GYÖNYÖRŰ iPhone 14 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3967
- Bomba ár! Dell Vostro 5490 - i5-10GEN I 16GB I 256SSD I 14" FHD I HDMI I Cam I W11 I Gari!
- HIBÁTLAN iPhone 12 mini 128GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3303
- LG 25GR75FG - E-Sport Monitor - FHD 360Hz 1ms - NVIDIA Reflex + G-sync - AMD FreeSync - HDR 400
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

