Page 1 of 1

Disable popup window with aria2 manager

Posted: Sun Oct 02, 2016 9:57 am
by godblessfq
Hello Sir,
I am using flashgot with external aria2 download manager. It pops up a window for each download I added to the aria2 server. How to disable that behavior and let all happens in the background?
Thank you!

Re: No popup window with aria2 manager

Posted: Wed Oct 05, 2016 1:32 am
by therube
Not sure, but...

FlashGot Options -> Downloads => Autostart downloads && Intercept all downloads ?

Re: No popup window with aria2 manager

Posted: Wed Oct 05, 2016 11:47 am
by godblessfq
No, I don't want to disable aria2, I want flashgot to intercept all downloads with aria2, but let it do it silently without showing details of the downloads in a pop up window. Aria2 has a web interface for acitive downloads.

Re: Disable popup window with aria2 manager

Posted: Wed Oct 05, 2016 12:36 pm
by godblessfq
The problem solved with a script I find on the internet and the following setting.

Code: Select all

user_pref("flashgot.custom", "aria2c");
user_pref("flashgot.custom.aria2c.args", "[--cookie COOKIE] [--output FNAME] --rpc http://localhost:6800/jsonrpc [URL]\n");
user_pref("flashgot.custom.aria2c.exe", "/home/q/.dotfiles/.aria2/");
user_pref("flashgot.defaultDM", "aria2c");
user_pref("flashgot.detect.cache", "(Browser Built In),Wget,pyLoad,cURL,aria2c,Aria 2");
user_pref("flashgot.interceptAll", true);

Code: Select all

#!/usr/bin/env python2
import json, urllib2, sys
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-c', '--cookie', help='use cookies', type=str,
                    default='', metavar='COOKIES', dest='cookies')
parser.add_argument('-o', '--output', help='output name', type=str,
                    default='', metavar='NAME', dest='output')
parser.add_argument('-d', '--dir', help='dest dir', type=str,
                    default='', metavar='DIR', dest='dir')
parser.add_argument('-r', '--rpc', help='aria2 rpc (http://localhost:6800/jsonroc)',
                    type=str, default='',
                    metavar='URL', dest='rpc')
parser.add_argument('URIs', nargs='+', help='URIs', type=str,
                    default='', metavar='URI')
opts = parser.parse_args()
jsondict = {'jsonrpc':'2.0', 'id':'qwer',
        'continue'                  :'true',
        'max-connection-per-server' :'15',
        'split'                     :'15',
        'min-split-size'            :'10M'}
aria2opts = {}
if opts.output:
    aria2opts['out'] = opts.output
if opts.dir:
    aria2opts['dir'] = opts.dir
if opts.cookies:
    aria2opts['header'] = ['Cookie: 0'.format(opts.cookies)]
jsonreq = json.dumps(jsondict)
print jsonreq
urllib2.urlopen(opts.rpc, jsonreq)