Hi,
may I ask where did you get the info to connect and send messages to the download station ?
Thx a lot !
PS: feel free to PM me in french if you fill it's easier ;p
sabbelgreth wrote:Hey picapica,
Actually, english is easier for me
I looked up most of the commands in the HTML source code of the QNap browser interface. They are calls to some cgi scripts on the server. The QGet windows app uses other commands in some situations. I used Wireshark to see these commands. Markus who programmed the QDownloader (viewtopic.php?f=30&t=3700) told me, that there is also an "official" QNAP specification with all commands. If you ask in the forum, they may send it to you.
Cheers,
Nicolas
ansible wrote:I've been looking into writing some custom scripts for my QNAP too, but haven't had much luck looking in the source, beacuse the CGIs are compiled. So you just make http requests to the CGIs? How do you get the Job IDs, screen scraping?
#!/bin/sh
PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# QNAP NAS IP or host name
NAS=1.1.1.1
# QNAP NAS port addres: 80 or 8080
PORT=80
# Temp directory
DIR=/tmp
# QNAP NAS username
USER=admin
# QNAP NAS password
PASS=password
# -------------------------------------------
# parse file name from the url
file=$(basename $1)
# download file
wget --output-document "$DIR/$file" "$1"
# send file to NAS
CURL_OUTPUT=`curl --fail --silent --form "upload=@$DIR/$file" --form name=upload_file --user "$USER:$PASS" http://$NAS:$PORT/cgi-bin/Qdownload/btoption.cgi?name=add_submit`
# handle error
if [ $? = 0 ]; then
INFO="$file has been successfully transmitted to $NAS on $(date)"
else
INFO="$file $CURL_OUTPUT"
fi
# show notification
zenity --notification --title "send2nas" --text "$INFO"
# remove temp file
#rm "$DIR/$file"
private final String csvPath = "/cgi-bin/Qdownload/html/";
private final String btOptionCmd = "/cgi-bin/Qdownload/btoption.cgi?";
private final String upParam = "name=up";
private final String downParam = "name=down";
private final String pauseParam = "name=pause";
private final String indexParamKey = "index";
private final String restartParam = "name=restart";
private final String kindParamKey = "kind";
private final String showErrorParam = "name=show_error";
private final String pageParamKey = "page";
private final String jobIndexParamKey = "jobindex";
private final String submitTorrentParam = "name=add_submit";
private final String getConfigurationParam = "name=set";
private final String configurationSubmitParam = "name=set_submit";
private final String shareTimeParam = "name=edit";
private final String shareTimeSubmitParam = "name=edit_submit";
private final String addFtpParam = "name=add_qget";
private final String addFtpSubmitParam = "name=add_qget_submit";
private final String listUrl = "/cgi-bin/Qdownload/Get_DL_List.cgi?status=";
public enum TorrentDownloadState { Running, Paused, Finished };
CasperTDK wrote:If I run your script in the terminal, it works.
Such as:
/Users/caspertdk/Documents/send2nas.sh http://torrents.thepiratebay.org/457075 ... PB.torrent
If i type that, it works.
CasperTDK wrote:No, I can't get zenity installed on my mac. It haven't had success in doing that.
I tried re-writing it, so it wouldn't use zenity, but simple do it without any notification messages on the status. Again, it worked in terminal but not in flashgot.
CasperTDK wrote:The whole execution flag. Do you mean group permission (chown)?
Return to Download Station and QGet
Users browsing this forum: No registered users and 1 guest