JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 28.08.2010, 17:55
mareser
Guest
 
Posts: n/a
Default Load dlc links via double click in ubuntu

Hi dear guys!

This is what I'd like to do: I double click on a dlc file and the links are loaded into JDownloader. If JD is not running, it starts beforehand.

I'm running Linux Mint Isadora which is a basically a modified Lucid Lynx.

I associated the dlc file format with the command "jdownloader". So when I click on a dlc file, JDownloader starts up but doesn't load the links. If JD is running at that time, nothing happens.

So how do I do this? Every help is much appreciated.

Last edited by Jiaz; 05.09.2010 at 00:17.
Reply With Quote
  #2  
Old 01.09.2010, 16:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,544
Default

what does your command line jdownloader do?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 04.09.2010, 15:33
mareser
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
what does your command line jdownloader do?
It starts JDownloader but doesn't load any links. When I double click a .dlc file I would like to load the links from the dlc into JDownloader.

Edit: My current way to load dlc links into JD, is to drag and drop the dlc file into JD. That's neither fast nor elegant.

Last edited by mareser; 04.09.2010 at 20:22.
Reply With Quote
  #4  
Old 05.09.2010, 00:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,544
Default

can you show the script?
cause your script must pass the correct parameters too to load the dlc
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 05.09.2010, 23:25
mareser
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
can you show the script?
I didn't write a script myself. The following shell script called "jdownloader" was placed in /usr/bin when I added your ppa (**External links are only visible to Support Staff****External links are only visible to Support Staff**).
This is the jdownloader command I was talking about earlier.

I think the answer to my question are the correct parameters you mentioned.

Thanks for your support until now, btw.

Below you'll find the content of the jdownloader shell script. I didn't change the script so I guess the code will be familar to you.

Code:
#!/bin/sh
set -e

if test -z "$JDOWNLOADER_DIRECTORY"; then
	# You can override this default by setting JDOWNLOADER_DIRECTORY
	JDOWNLOADER_DIRECTORY=~/.jdownloader
fi

LOG_FILE=${JDOWNLOADER_DIRECTORY}/jdownloader.log
JAVA_OPTIONS="-Xmx512m"
NUMBER_OF_UPDATE_MIRRORS=3

download_updater() {
	RANDOM_NUMBER=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")
	MIRROR=http://update$(expr ${RANDOM_NUMBER} % ${NUMBER_OF_UPDATE_MIRRORS}).jdownloader.org/

	rm -f jdupdate.jar
	echo "$0: Download jdupdate.jar from ${MIRROR}." >> ${LOG_FILE}
	wget --append-output=${LOG_FILE} ${MIRROR}/jdupdate.jar || zenity --error --text "The JDownloader updater could not be downloaded. Check your Internet connection and try again.\n\nThe error log can be found in\n${LOG_FILE}."

	rm -f jdupdate.jar.md5
	echo "$0: Download jdupdate.jar.md5 from ${MIRROR}." >> ${LOG_FILE}
	wget --append-output=${LOG_FILE} ${MIRROR}/jdupdate.jar.md5 || zenity --error --text "The JDownloader updater MD5 sum file could not be downloaded. Check your Internet connection and try again.\n\nThe error log can be found in\n${LOG_FILE}."

	ACTUAL_MD5SUM=$(md5sum jdupdate.jar | cut -f1 -d" ")
	TARGET_MD5SUM=$(cat jdupdate.jar.md5)
	if test "$ACTUAL_MD5SUM" != "$TARGET_MD5SUM"; then
		zenity --warning --text "The MD5 sum of the JDownloader updater mismatches. It is ${ACTUAL_MD5SUM}, but it should be ${TARGET_MD5SUM}. Either there was a download error, or one of the files (downloader or md5 sum file) is not up-to-date.\n\nThe log file can be found in\n${LOG_FILE}."
	fi
}

# determine command line parameters
while getopts 'u' OPTION; do
	case $OPTION in
	u)	UPDATE=1
		;;
	esac
done
shift $(( OPTIND - 1 ))

# create JDownloader directory
mkdir -p "${JDOWNLOADER_DIRECTORY}"
cd "${JDOWNLOADER_DIRECTORY}"

# clear log
> ${LOG_FILE}

# download updater, if it is missing (e.g. first run)
if test ! -f jdupdate.jar; then
	echo "$0: No installer/updater found in ${JDOWNLOADER_DIRECTORY}." >> ${LOG_FILE}
	download_updater
fi

# start update if requested
if test "$UPDATE" = "1"; then
	echo "$0: Starting updater by your request." >> ${LOG_FILE}
	exec java ${JAVA_OPTIONS} -jar jdupdate.jar "$0"
elif test -f JDownloader.jar; then
	echo "$0: Starting JDownloader." >> ${LOG_FILE}
	exec java ${JAVA_OPTIONS} -jar JDownloader.jar "$0"
else
	# run updater, if JDownloader.jar does not exist
	echo "$0: No valid JDownloader.jar exist. Starting updater." >> ${LOG_FILE}
	exec java ${JAVA_OPTIONS} -jar jdupdate.jar "$0"
fi

Last edited by mareser; 05.09.2010 at 23:29.
Reply With Quote
  #6  
Old 21.09.2010, 00:04
mareser
Guest
 
Posts: n/a
Default

It would be quite nice if you or somebody else could tell me the necessary parameters or any other way to do it.
Reply With Quote
  #7  
Old 21.09.2010, 10:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,544
Default

--add-containers filename
or
--add-container filename
or
--co filename
you need to modify the start line
exec java ${JAVA_OPTIONS} -jar JDownloader.jar "$0"
to add the above parameters in case a file is given as paramter.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 21.09.2010, 22:50
mareser
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
you need to modify the start line
exec java ${JAVA_OPTIONS} -jar JDownloader.jar "$0"
to add the above parameters in case a file is given as paramter.
How should the line look after I modified it?
Reply With Quote
  #9  
Old 22.09.2010, 09:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,544
Default

im sorry, but im not a bash coder
i suggest to ask Benjamin Drung
h__ps://launchpad.net/~jd-team/+archive/jdownloader
as he wrote the script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #10  
Old 22.09.2010, 22:44
mareser
Guest
 
Posts: n/a
Default

Alright, I will do that.
When I know the answer, I'll post it here.
Reply With Quote
  #11  
Old 23.09.2010, 10:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,544
Default

thanks
__________________
JD-Dev & Server-Admin
Reply With Quote
  #12  
Old 15.10.2010, 21:24
mareser
Guest
 
Posts: n/a
Default

After mailing with Benjamin he was kind enough to implement the feature I requested. The changes have already been included in the PPA I was told by Benjamin.

So this is what I tested: Using the new script in Ubuntu 10.10 I associated the dlc-files with the command 'jdownloader -co'. Now I doubleclicked on a dlc container and voila: The links of the dlc were loaded into JDownloader. Exactly what I wished for.

Additionally in Firefox I associated the dlcs with 'jdownloader' which yielded the same satisfying results as described above.

I'm happy.

Thanks Jiaz and Benjamin!

Last edited by mareser; 15.10.2010 at 21:26.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 15:35.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.