Thanks for trying to help hugbug,
first I ask for the 'listgroup' data from NZBget, and if I must believe the part of the code I once copied from other scripts, the data returned is a JSON-raw string.
This data looks like:
Code: Select all
{
"version" : "1.1",
"result" : [
{
"FirstID" : 432,
"LastID" : 432,
...
"ActiveDownloads" : 0,
"Status" : "PAUSED",
"NZBID" : 432,
"NZBName" : "The.Challenge.S30E04.HDTV.x264-YesTV",
"NZBNicename" : "The.Challenge.S30E04.HDTV.x264-YesTV",
...
"ExtraParBlocks" : 0,
"Parameters" : [...,
{
"Name" : "VideoSort\\VideoSort.py:",
"Value" : "yes"
},
{
"Name" : "Completion.py:",
"Value" : "yes"
},
{
"Name" : "CnpNZBFileName",
"Value" : "The.Challenge.S30E04.HDTV.x264-YesTV.nzb.queued"
}],....
So then I use this code
So I can use
to get the specific job in the queue I want do something with, like using
Code: Select all
job['DupeKey'], job['MaxPostTime'], or job['Parameters']
But when getting the data from job['Parameters'], I can't narrow it down to get the data from the 'CnpNZBFileName' thingy (the actual file name)
Code: Select all
, u'ExParStatus': u'NONE', u'Parameters': [{...}, {u'Name': u'*Unpack:', u'Value': u'yes'}, {u'Name': u'Subliminal.py:', u'Value': u'yes'}, {u'Name': u'VideoSort\\VideoSort.py:', u'Value': u'yes'}, {u'Name': u'Completion.py:', u'Value': u'yes'}, {u'Name': u'CnpNZBFileName', u'Value': u'The.Challenge.S30E04.HDTV.x264-YesTV.nzb.2.queued'}], ...
So to still be able to extract it (as I couldnt figure / google out how to get the data), I used the find option to get the data. So basically the above is just a string, in where I search to match the location of the filename:
Code: Select all
s = str(parameters)
loc = s.rfind("u'CnpNZBFileName', u'Value': u") ## "/'
s = s[loc+31:]
loc = s.rfind('}')
return s[:loc-1]
where parameters contains the job['Parameters'] data