Hello
A userscript that loads nzbs from binsearch.info a posts them directly to sabnzbd can be installed from http://userscripts.org/scripts/source/145926.user.js via ajax requests. It works in Chrome with Tampermonkey. Should also work in FF with Scriptish or Greasemonkey but shows an error after uploading as described here.
This or similiar could be done with every nzb index/download site of course not only as userscript but also as a feature of the site or as a browser extension (addon).
Hope someone likes it or even feels inspired to adapt this to other indexer sites.
Regards, T.
Userscript for binsearch.info
-
- Newbie
- Posts: 5
- Joined: May 4th, 2012, 9:00 am
Re: Userscript for binsearch.info
I forgot to say what makes this approach worth to think about: Different to existing userscripts and browser extensions/addons this script downloads the nzb to the browsers memory and sends it directly to sabnzbd.
When you instead use the addurl command (like many scripts do) sabnzbd needs to have full access to the nzb site. If the site requires authentication sabnzb needed to know how to do this for this specific site.
When just directly posting the nzb to sabnzbd the browser is already logged in the nzb site. So for usenet forums where you have to be logged in to download the nzbs this is a working approach that needs quiet less efforts than integrating the necessary forms and settings in the server side scripts and database of the nzb site.
This possibilty to leverage the logged in state of a site by another page is why the w3c invents CORS. And probably will all browsers earlier or later deny that (like current Firefox already does) unless the server provides sufficient Access-Control-xxx headers. Sabnzbd would just need to add a "Access-Control-Allow-Origin: *" to its headers to make scripts like mine work. In the meantime you can use the Force CORS addon for Firefox.
When you instead use the addurl command (like many scripts do) sabnzbd needs to have full access to the nzb site. If the site requires authentication sabnzb needed to know how to do this for this specific site.
When just directly posting the nzb to sabnzbd the browser is already logged in the nzb site. So for usenet forums where you have to be logged in to download the nzbs this is a working approach that needs quiet less efforts than integrating the necessary forms and settings in the server side scripts and database of the nzb site.
This possibilty to leverage the logged in state of a site by another page is why the w3c invents CORS. And probably will all browsers earlier or later deny that (like current Firefox already does) unless the server provides sufficient Access-Control-xxx headers. Sabnzbd would just need to add a "Access-Control-Allow-Origin: *" to its headers to make scripts like mine work. In the meantime you can use the Force CORS addon for Firefox.
-
- Newbie
- Posts: 5
- Joined: May 4th, 2012, 9:00 am
Re: Userscript for binsearch.info
I promised too much: In Chrome the attempt to access sabnzbd via ajax also results in an error:
It only works in userscripts...
Code: Select all
XMLHttpRequest cannot load http://localhost:8080/api?mode=get_cats&output=json&apikey=f22d9370a15678945070b300190abf. Origin http://www.example.de is not allowed by Access-Control-Allow-Origin.