XG, called Xdcc Grabscher, is a XDCC download manager. Grabscher is the german word for grabber :-)
XG is just a command line app which connects to one or multiple IRC networks and handles the whole network communication. The IRC servers, channels, bots and packets are presented within a nice and stylish web frontend. There you can search and download packets.
You can run XG on every machine that supports C# / Mono - even root servers without x(org), or an old weak pc running linux without a monitor - and control your downloads with your browser from everywhere. You don't have to keep a big PC running, but just a small download box which handles all the IRC stuff.
Run the program and point your browser to 127.0.0.1:5556. The default password is xgisgreat. If you already added some servers and channels, it will take some time untill the Webfrontend is up and running. This is due to the build in SQLite database which is not really performant and takes some time to load the saved objects.
You can do this directly in the web frontend. Just click on the Config link in the options menu.
This is a small explanation to help you set the correct options. If you don't want to use a special feature, just disable it.
Note: The Elastic Search configuration is not available in the webfrontend anymore and can be changed by editing the config file manually.
The web server password is filled with xgisgreat and the port ist 5556. The IRC passport and email can be left blank and are just needed if you want use nickserv.
If a packet is downloaded you can run several commands. If the regex of a file handler matches the file name, the process is started. A process is defined by a command, arguments and the next process. The next process can be left empty and only is called if the current one is successfully executed.
The following handler matches all rar / zip archives. It will create a separate folder, extract the archive into it and removes the archive. Every process is executed only, if the previous one was successfully. Because of this, the handler won't delete the archive if he could not extract it.
You can add as many file handlers as you want. They are also stored in the settings file.
You can use different placeholders in your arguments:
If you want to change the settings manually, you have to change the file named xg.config located in your user folder:
Now you have to add IRC networks and channels. The bots and packets are generated and updated automatically. If you don't know which server and channels to add, try the integrated xg.bitpir.at search or add a XDCC link.
Normally the bots will announce their pakets directly in the channel. If they are silent, you can check the option Check user versions and XG will ask the voiced users about their version. If XG detects an iroffer he will try to send xdcc list commands to get packet lists. _DO NOT_ check the option unless you know, that the bots in this channel wont announce their packets. Otherwhise you mostly will be banned!
You can search for packets by entering a custom search term and just hit enter. If your want to save your search, just click on the thumb button. Deleting a search works the same. The search items are working with the internal and external search and are also saved into the database. If you want to exclude words from your search you can use "-". To search for packages and exclude TS releases you could use Spiderman -TS. The size of packets can be controlled by the size box. Only packets which are bigger than the given value are displayed. If you don't want to use this feature, leave this field blank or zero.
XG supportes wildcard searches to be able to search for tv shows. If you search for under the dome s02e** you will get results for all season 2 episodes from 01 to 99. Even multiple wildcards are supported: under the dome s**e** will return results for all season from 01 to 10 and episodes from 01 to 30. Because multiple wildcard searches are expensive, the results are limited to 10 seasons and 30 episodes.
The results are displayed in a table and the packets can be grouped by their bot or wildcard search. The grouping can be disabled, but you will lose some important informations. If you click on a packet icon, XG will try to download it and keeps you up to date with updated packet informations. The packet icon will match the file ending, so there are different versions.
If something happens inside XG you will get a notification. This can also be shown via your browser if you allow it.
You can add XDCC links in the following dialog. A XDCC link must have the following structure:
xdcc:// server / server-name / channel / bot / packet-id / file-name /
The server, channel and bot is automatically added. If the server is connected and the channel joined, the packet will be requested.
The server and channel are not deleted after the packet is complete, so if you don't need them anymore, you have to delete them yourself.
XG will collect every 5 minutes some statistical data and generate nice graphs. There you can enable and disable different values to get an optimal view of your running XG copy.
This feature wont work in older browsers like the good old IE8, so do yourself a favor and use a newer one ;-)
XG v3 supports a REST api to control it via external tools. You can add api keys and enable / disable them.
The following objects can be controlled with different methods via the api:
The object name has to be entered after the /api/1.0/ path segment with the format in the wich the answer should be encoded, for example /api/1.0/servers.json. The data you want to pass to the method has to be encoded in same format. The content type must be the format, too. The Authorization header is mandatory and has to match an api key which is enabled. If the apiKey was invalid or disabled, the method will result in an 401.
The currently allowed formats:
Api methods which create or update data, always return the following properties:
You can delete an object and all children.
DELETE /api/1.0/[ servers | channels | files | searches ]/$guid.$format
curl -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XDELETE localhost:5556/api/1.0/servers/deebd412-9b16-4726-b613-7ec98e714f59.json
{
"ReturnValue":1,
"Message":null
}
Get a single object by its guid.
GET /api/1.0/[ servers | channels | bots | packets | files | searches ]/$guid.$format
curl -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XGET localhost:5556/api/1.0/servers/deebd412-9b16-4726-b613-7ec98e714f59.json
{
"Port":6667,
"ErrorCode":0,
"ParentGuid":"c31aa923-b615-4d03-840d-c82357c929d4",
"Guid":"906bfd60-b6f1-4d38-a2f4-cb9cba983a24",
"Name":"irc.abjects.net",
"Connected":false,
"Enabled":false
}
If you enable servers and channels, they will be connected. If you enable a packet it will be downloaded.
POST /api/1.0/[ servers | channels | packets ]/$guid/enable.$format
curl -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XPOST localhost:5556/api/1.0/servers/deebd412-9b16-4726-b613-7ec98e714f59/enable.json
{
"ReturnValue":1,
"Message":null
}
If you disable servers and channels, they will be disconnected. If you disable a packet the download will be stopped and the file is beeing deleted.
POST /api/1.0/[ servers | channels | packets ]/$guid/disable.$format
curl -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XPOST localhost:5556/api/1.0/servers/deebd412-9b16-4726-b613-7ec98e714f59/disable.json
{
"ReturnValue":1,
"Message":null
}
You can add an object. All parameters are mandatory.
If you got a XDCC link, you can use this method to add a packet and download it instantly. The server and channel are not deleted after the packet is complete, so if you dont need them anymore, you have to delete them yourself.
PUT /api/1.0/[ servers | channels | packets | searches ].$format
curl -H "Content-Type:application/json" -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XPOST localhost:5556/api/1.0/servers.json -d '
{
"server":"irc.rizon.net",
"port": 6667
}'
curl -H "Content-Type:application/json" -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XPOST localhost:5556/api/1.0/packets.json -d '
{
"server":"irc.rizon.net",
"channel":"#abjects",
"bot":"[XDCC]Bot",
"packetId":11,
"packetName":"My.Super.Movie.mkv"
}'
{
"ReturnValue":0,
"Message":"server is empty"
}
You can list objects. If you want to list packets, you can controll the results.
GET /api/1.0/[ servers | channels | packets | files | searches ].$format
The properties showOfflineBots, maxResults, page, sortBy, sort can be left blank. If you leave showOfflineBots blank, it will be filled with false and the search request will just return packets, which bots are online.
curl -H "Authorization: 615d86bb-f867-47c1-a860-ac24e09e976c" -s -XGET 'localhost:5556/api/1.0/packets.json?searchTerm=mkv%20-seven&showOfflineBots=true'
{
"Results":
[
{
...
}
],
"ResultCount":5584
}
Results is an array containg the requestet objects.
If you want to shutdown XG, just ctrl+c the process or close the command window. You can also stop XG by using the shutdown button in the webfrontend.
If you are upgrading from version 2 to 3, you should finish your downloads and write down your servers and channels, because XG 3 is not able to load the data generated by previous versions.
If you are upgrading from XG 3.2 to 3.3 you should notice, that the db format switched from sqlite to db4o. Because of this, XG automatically transformes the db xgobjects.db into a db4o database xgobjects.db4o if it is not there already. The sqlite file can be safely deleted after the first start, but can also be keeped as backup. If you delete the db4o file, XG will start the transformation process again.
Because XG changed some internal routines you can safely delete the following files in the config folder:
You need at least .net 4.5.
You need at least mono 3.x because some needed libs are running on .net 4.5 wich is not supported in earlier versions.
If you are using Debian / Ubuntu, take a look here to get newer mono packages:
sudo apt-get install mono-complete