Page 1 of 1

cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 1st, 2018, 4:46 pm
by mattra
Hi,
I just installed a new computer with Ubuntu 17.10 and Sabnzb 1.1.1, but when I download a nzb file Firefox (58.0.2) asks me what to do with it (open it with text editor, or download it), but when I choose open with another program, SABnzb is nowhere listed. Is there a way to associate nzbs with SABnzb in Firefox?
Now I download the nzb, open it manually in SABnzb, but it's tedious...

Re: cannot associatie NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 2:07 am
by sander
First of all: install the PPA for SABnzbd to get the most recent SABnzbd.

Then your NZB associating question:

It seems that is not possible anymore via the GUI.
"You must create/edit a .desktop file located in ~/.local/share/applications/ or /usr/share/applications/ Locate the Exec= parameter and at the end of the line add %U - it will be replaced with the filename to be opened."

I will try some things on my own Lubuntu, and report back.

Re: cannot associatie NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 3:34 am
by mattra
Hi Sander,

Thank you. I've meanwhile installed the PPA and updated to 2.3.2.

I added %U at the end of the Exec parameter in /usr/share/applications/sabnzbplus.desktop (the file is listed as SABnzb+ but opens as sabnzbplus.desktop, don't know why this is so, I use nemo to browse files) and now SABnzb+ is listed in the programs when I open a nzb in Firefox.

So, though I have no idea what %U means, or why it is necessary to add it, it works like a charm.

So thank you!

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 3:40 am
by sander
I think %U means the filename you click on, so the filename of the .NZB

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 3:53 am
by sander
I checked my Ubuntu server (!) and it has /usr/share/applications/sabnzbdplus.desktop too. Quite special for a Server.

Anyway:

Code: Select all

sander@haring:~$ ll  /usr/share/applications/sabnzbdplus.desktop
-rw-r--r-- 1 root root 245 Sep 26  2015 /usr/share/applications/sabnzbdplus.desktop

Code: Select all

sander@haring:~$ cat  /usr/share/applications/sabnzbdplus.desktop
[Desktop Entry]
Name=SABnzbd+
GenericName=Binary newsgrabber
Comment=Download from Usenet
Exec=sabnzbdplus --browser 1
Icon=sabnzbdplus
Terminal=false
Type=Application
Categories=Network;FileTransfer;
Keywords=usenet;binaries;download;nzb;nntp;

So you should added the %U to the exec line, and you were fine?

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 3:59 am
by OneCD
sander wrote: March 2nd, 2018, 3:53 am I checked my Ubuntu server (!) and it has /usr/share/applications/sabnzbdplus.desktop too. Quite special for a Server.
You're running a GUI on your server? ;D

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 5:45 am
by sander
According to https://packages.ubuntu.com/search?sear ... l&arch=any , that file /usr/share/applications/sabnzbdplus.desktop is provided by the package ... 'sabnzbdplus'. OK, good: then we know where to change / bug-report it.

Confirmed by

Code: Select all

sander@haring:~$ dpkg -S /usr/share/applications/sabnzbdplus.desktop
sabnzbdplus: /usr/share/applications/sabnzbdplus.desktop
I'll check on my own desktop Ubuntu if the %U works for me.

Maybe @jcfp can read along? FWIW: I've moved this topic to the forum "Debian/Ubuntu Package"

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 12:29 pm
by sander
I can confirm: with the " %U", and a logout-login, SABnzbd is available & selectable in Nautilus / Nemo under "Open With Other Application". Afterwards, double clicking adds it so SABnzbd. Nice

Contents of /usr/share/applications/sabnzbdplus.desktop

Code: Select all

[Desktop Entry]
Name=SABnzbd+
GenericName=Binary newsgrabber
Comment=Download from Usenet
Exec=sabnzbdplus --browser 1 %U
Icon=sabnzbdplus
Terminal=false
Type=Application
Categories=Network;FileTransfer;
Keywords=usenet;binaries;download;nzb;nntp;
@jcfp is this something you can take care of in the PPA and the plain package?

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 2nd, 2018, 1:23 pm
by mattra
Hi Sander,

Yes, with %U SABnzb is listed in nemo.

Still have no idea what %U means or why it makes a difference for Gnome or Nemo to list SABnzb or not, but it does the trick!

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 3rd, 2018, 4:51 am
by jcfp
mattra wrote: March 2nd, 2018, 1:23 pmStill have no idea what %U means or why it makes a difference for Gnome or Nemo to list SABnzb or not, but it does the trick!
See here.
sander wrote: March 2nd, 2018, 12:29 pm@jcfp is this something you can take care of in the PPA and the plain package?
Wasn't aware that sab accepted an nzb file (or maybe files, or even urls?) via the command line. Program --help output doesn't mention it, and didn't work when I tried this wayyyy back when writing the desktop file. Changing the desktop file is trivial if it does now.

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 3rd, 2018, 5:13 am
by sander
jcfp wrote: March 3rd, 2018, 4:51 am
sander wrote: March 2nd, 2018, 12:29 pm@jcfp is this something you can take care of in the PPA and the plain package?
Wasn't aware that sab accepted an nzb file (or maybe files, or even urls?) via the command line. Program --help output doesn't mention it, and didn't work when I tried this wayyyy back when writing the desktop file.
That was a surprise for me too.
I think this is the SAB code that takes care of that https://github.com/sabnzbd/sabnzbd/blob ... #L775-L779

Changing the desktop file is trivial if it does now.
Nice.

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 3rd, 2018, 5:42 am
by jcfp
So multiple local files yes, urls no: seems %F is the way to go, rather than %U. I'll do some testing and add this to the desktop file with a future update. Also needs a PR to document this feature in help output and elsewhere on the sab end.

Re: cannot associate NZB to sabnzbd (on Firefox 58)

Posted: March 3rd, 2018, 5:50 am
by sander
jcfp wrote: March 3rd, 2018, 5:42 am So multiple local files yes, urls no: seems %F is the way to go, rather than %U. I'll do some testing and add this to the desktop file with a future update. Also needs a PR to document this feature in help output and elsewhere on the sab end.
like this? https://github.com/sabnzbd/sabnzbd/issues/1107