#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
what does your command line jdownloader do?
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
can you show the script?
cause your script must pass the correct parameters too to load the dlc
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
It would be quite nice if you or somebody else could tell me the necessary parameters or any other way to do it.
|
#7
|
||||
|
||||
--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 |
#8
|
|||
|
|||
How should the line look after I modified it?
|
#9
|
||||
|
||||
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 |
#10
|
|||
|
|||
Alright, I will do that.
When I know the answer, I'll post it here. |
#11
|
||||
|
||||
thanks
__________________
JD-Dev & Server-Admin |
#12
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|