Skip to content

Jaglag/xdcc-grabscher

 
 

Repository files navigation

XG

XG, called __X__dcc __G__rabscher, is a XDCC download manager. Grabscher is the german word for grabber :-)

What makes it special?

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.

How do i use it?

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.

Password Dialog

At first: change the settings

You can do this directly in the web frontend. Just click on the Config link in the options menu.

Options

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.

Settings part 1

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.

Settings part 2

Filehandlers

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.

Settings part 3

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.

Settings part 4

You can add as many file handlers as you want. They are also stored in the settings file.

Arguments

You can use different placeholders in your arguments:

  • %PATH% = full path of the file, like /the/full/path/to/file_complete.rar
  • %FOLDER% = full path of the folder of the file, like /the/full/path/to
  • %FILE% = the complete file name, like file_complete.rar
  • %FILENAME% = just the file name, like file_complete
  • %EXTENSION% = just the file extension, like rar

Change settings manually

If you want to change the settings manually, you have to change the file named xg.config located in your user folder:

  • Windows 7: C:\Users\Username\AppData\Roaming\XG
  • Linux: /home/Username/.config/XG
  • Mac: /Users/Username/.config/XG

Add servers and channels

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!

Server / Channel Dialog

Search

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".

Search

The results are displayed in a table and the packets are grouped by their bot. The grouping can be disabled in the settings menu, 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.

Packet Icons

Notifications

If something happens inside XG you will get a notification. This can also be shown via your browser if you allow it.

Notification Icon

XDCC Links

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.

XDCC Links

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.

Extended Stats / Snapshots

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.

Extended Statistics

This feature wont work in older browsers like the good old IE8, so do yourself a favor and use a newer one ;-)

API

XG v3 supports a rest like api to control it via scripts. You can add api keys and enable / disable them.

Api

Currently you can just add xdcc links by calling the following url:

ht*p:// your-own-host:5556 / api / 615d86bb-f867-47c1-a860-ac24e09e976c / parseXdccLink / irc.test.net / servername / channel / bot / 1 / filename /

The api id has to be entered after the /api/ path segment. After that is the method you want to call, for example /parseXdccLink/. Finally you have to add the data you want to pass to method (must be a valid xdcc link in our example). Currently api methods can return the following JSON encoded results:

  • {"ReturnValue":-1} - api key is invalid or disabled
  • {"ReturnValue":0} - there was an error calling the method
  • {"ReturnValue":1} - everything is fine

Shutdown XG gracefully

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.

Upgrading XG

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.

XG 3 is using NHibernate, so you can use your own config if you want to put the data into a mysql database for example. If you do not need this feature you can use the build in SQLite config which is loaded by default. The database named xgobjects.db is located in your user config folder and can be edited if XG is not running.

Unnecessary Files

Because XG changed some internal routines you can safely delete the following files in the config folder:

prior version 2

  • XG/xgsnapshots.bin
  • XG/xgsnapshots.bin.bak
  • XG/statistics.xml

prior version 3

  • XG/xg.bin
  • XG/xg.bin.bak
  • XG/xgfiles.bin
  • XG/xgfiles.bin.bak
  • XG/xgsearches.bin
  • XG/xgsearches.bin.bak
  • XG/settings.xml

Running XG

On Windows

You need at least .net 4.5.

On Linux with Mono

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:

http://mono-project.com/DistroPackages/Debian

Needed packets / libs

  • mono-complete

Install command for Debian / Ubuntu to copy paste:

sudo apt-get install mono-complete