Open forkless opened 10 years ago
the newznab plugin only supports the output as json ... it seams the api syntax is different for SpotWeb or maybe you need to do this https://github.com/spotweb/spotweb/wiki/Spotweb-als-Newznab-Provider ? i cant find a documentation for the api
I've done that already. I use spotweb as an alternative newznab provider for CouchPotato, Sickbeard et al. which works fine.
Eg. http://127.0.0.1/spotweb/api?t=c works. One dfifference I do notice with the same api call to my newznab provider on http://127.0.0.1/newznab/api?t=c it will give slightly different XML (it adds groups & genre taxonomies).
the issue is that the newznab plugin only supports json output newznab can do that apperently SpotWeb can't so either a newznab plugin for xml has to be made that will work with SpotWeb or the existing one has to take xml output into consideration ... but honestly xml is a pain
Spotweb supports JSON output it just defaults to XML as far as I know, it should listen to the o=JSON URI parameter
Maybe I shouldn't have mentioned XML in the issue comment/title, the only thing I intended to point out is that the newznab API is working when you call it with api?t=c (Which indeed produces XML, by the way it does this by default on Newznab itself as well).
Like I mentioned before CP and SB parse the content from the API. Could it be there is a bug in your JSON parser/the way you handle your stream?
EDIT: Never mind, I think I've found a bug in the Spotweb API
https://myspotweb.com/api?t=search&q=Linux&apikey=##MYAPIKEY##&o=json
[{"ID":"QqZtqmI59xsTOtuUgeNUL@spot.net","name":"Kerio Connect 8.2.0 Linux 64","size":"519432948","adddate":"2013-10-28 23:55:10","guid":"QqZtqmI59xsTOtuUgeNUL@spot.net","fromname":"whizkidz","completion":100,"comments":"0","category_name":"Applications: TUX","category_ids":[],"_totalrows":57},{"ID":"6DXlkA5PQCwJetuUg05lu@spot.net","name":"Kerio Connect 8.2.0 Linux 32","size":"535704523","adddate":"2013-10-28 23:54:32","guid":"6DXlkA5PQCwJetuUg05lu@spot.net","fromname":"whizkidz","completion":100,"comments":"0","category_name":"Applications: TUX","category_ids":[]},{"ID":"V5hHguOQUhQZpttUgkL3A@spot.net","name":"Kerio Connect 8.1.3 Linux 64","size":"261317540","adddate":"2013-10-28 00:02:10","guid":"V5hHguOQUhQZpttUgkL3A@spot.net","fromname":"whizkidz","completion":100,"comments":"0","category_name":"Applications: TUX","category_ids":[]},{"ID":"vuNqzWmt57M4JptUgJdcA@spot.net","name":"Kerio Connect linux 32","size":"267924996","adddate":"2013-10-27 23:59:55","guid":"vuNqzWmt57M4JptUgJdcA@spot.net","fromname":"whizkidz","completion":100,"comments":"0","category_name":"Applications: TUX","category_ids":[]},
Here's some sample JSON output from Spotweb, hope this will help
any progress on this issue? I'm experiencing exactly the same.
I am trying to get it to work in a new Spotweb plugin with XML parsing.
I have parsing the nzb and category with XML working it only needs an extra lib. xmltodict i will put everything together and will do a pull request later this evening.
@avdstelt did you upgrade the default Nezwnab plugin or make a new one ? because if its a new one you could host it yourself
It's a new one maybe you can help me how to host it i am pretty new to git :)
i suspect https://github.com/avdstelt/XDM-main-plugin-repo is what you are using as a start there are two ways either you delte every other plugin except your own (locally) then commit the changes and push that way only your plugin / version is available there. when you did this you might want to change the name of the repo like "my xdm plugins"
or you could create a new repo on github (the make that part quite easy) and move the modified plugin to the local copy of the new repo
now to make your git(hub) repo into a XDM repo you have to modify the meta.json (the name is irrelevant) how you do that is up to you
please give the repoJSONmaker.py a chance and i can help you with the rest besides if you have any question feel free to ask either here @ https://xdm.userecho.com/ or on irc freenode.net on #xdm
Ok i will try it this evening i am also having some problems with the pluginRootLibarys is there a good documentation how to use this?
this is all i have written down https://xdm.readthedocs.org/en/latest/plugin/index.html#pluginrootlibarys
I saw that, but at some point it doesn't work for me i created a directory pluginRootLibarys/xmltodict and put the file xmltodict.py in that directory.
When i write import xmltodict.xmltodict i am getting module xmltodict not found.
The xmltodict folder does it have an inti.py if not add one Otherwise the folder is not a module It might also work to just add the xmltodict.py to the pluginRootLibarys folder (without the extra folder)
You are right there isn't one i will add one and see what happens then.
Having some problems with the download.type and downloader.types
In the Spotweb plugin type and types are both de.lad1337.nzb but when i print them in the tasks.py they are not the same?
I did changed them to nl.avdstelt.nzb in the new plugin when i started to build it.
Fixed it by deleting the entries in the database.
Ok check https://github.com/avdstelt/XDM-plugins for Spotweb plugin.
You can add my repos with the following url https://raw.github.com/avdstelt/XDM-plugins/master/meta.json
I think that this issue can be closed.
ERRORLOG:
Error during _gatherCategories of Newznab(Default) Error: No JSON object could be decoded
Traceback (most recent call last): File "/share/MD0_DATA/.qpkg/XDM/source/xdm/web/ajax.py", line 70, in pluginCall status, data, msg = p_function(_fn_args) File "/share/MD0_DATA/.qpkg/XDM/source/plugins/Indexer/Newznab-de_lad1337_newznab-0_6/Newznab.py", line 142, in _gatherCategories for cat in r.json()['categories']['category']: File "/share/MD0_DATA/.qpkg/XDM/source/lib/requests/models.py", line 629, in json return json.loads(self.text or self.content, *_kwargs) File "/opt/lib/python2.7/json/init.py", line 326, in loads return _default_decoder.decode(s) File "/opt/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/lib/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded
NEWZNAB XML FORMATTING: