Skip to content

Commit fecd883

Browse files
committed
- Linux only: copy aria2-remote script to binary folder as CI wouldn't do it anymore.
1 parent 1e8b103 commit fecd883

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed

pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,24 @@
927927
</dependencies>
928928
<build>
929929
<plugins>
930+
<plugin>
931+
<groupId>com.coderplus.maven.plugins</groupId>
932+
<artifactId>copy-rename-maven-plugin</artifactId>
933+
<version>1.0</version>
934+
<executions>
935+
<execution>
936+
<id>rename-file</id>
937+
<phase>package</phase>
938+
<goals>
939+
<goal>copy</goal>
940+
</goals>
941+
<configuration>
942+
<sourceFile>${project.basedir}/scripte/aria2-remote.sh</sourceFile>
943+
<destinationFile>${project.build.directory}/res/bin/aria2-remote.sh</destinationFile>
944+
</configuration>
945+
</execution>
946+
</executions>
947+
</plugin>
930948
<plugin>
931949
<groupId>org.apache.maven.plugins</groupId>
932950
<artifactId>maven-shade-plugin</artifactId>
@@ -1006,6 +1024,24 @@
10061024
</dependencies>
10071025
<build>
10081026
<plugins>
1027+
<plugin>
1028+
<groupId>com.coderplus.maven.plugins</groupId>
1029+
<artifactId>copy-rename-maven-plugin</artifactId>
1030+
<version>1.0</version>
1031+
<executions>
1032+
<execution>
1033+
<id>rename-file</id>
1034+
<phase>package</phase>
1035+
<goals>
1036+
<goal>copy</goal>
1037+
</goals>
1038+
<configuration>
1039+
<sourceFile>${project.basedir}/scripte/aria2-remote.sh</sourceFile>
1040+
<destinationFile>${project.build.directory}/res/bin/aria2-remote.sh</destinationFile>
1041+
</configuration>
1042+
</execution>
1043+
</executions>
1044+
</plugin>
10091045
<plugin>
10101046
<groupId>org.apache.maven.plugins</groupId>
10111047
<artifactId>maven-shade-plugin</artifactId>

scripte/aria2-remote.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
3+
# Das Skript muss evtl. noch
4+
# "ausführbar" gemacht werden!!!
5+
6+
# Programmparameter in MediathekView
7+
# %f ** <URL of aria2 daemon> <secret for aria2 daemon>
8+
9+
# oder ohne gesetztes Passwort
10+
# %f ** <URL of aria2 daemon>
11+
12+
# Start von aria2 auf dem Server
13+
# aria2c --enable-rpc --rpc-listen-all --dir=/ZIELPFAD/FILME
14+
15+
16+
log=/tmp/MediathekView-aria2.log
17+
echo "Running $0 $*" >$log
18+
19+
url=$1
20+
filename=$(basename "$2")
21+
22+
aria2_server_url=$3
23+
aria2_server_secret=$4
24+
25+
#echo >>$log
26+
#echo "MediathekView-aria2 parameters:" >>$log
27+
#while [ -n "$1" ]
28+
#do
29+
# echo "$1" >>$log
30+
# shift
31+
#done
32+
33+
echo >>$log
34+
echo "url: " $url >>$log
35+
echo "filename: " $filename >>$log
36+
echo "aria2_server_url: " $aria2_server_url >>$log
37+
echo "aria2_server_secret: " $aria2_server_secret >>$log
38+
39+
id=medview
40+
method=aria2.addUri
41+
42+
if [ -n "$filename" ]
43+
then
44+
options=",{\"out\":\"${filename}\"}"
45+
else
46+
options=""
47+
fi
48+
49+
params="[\"token:${aria2_server_secret}\",[\"${url}\"]${options}]"
50+
params_base64enc=$(echo "${params}" | base64 -w 0 -)
51+
params_base64enc_urlenc=${params_base64enc//=/%3D}
52+
53+
get="${aria2_server_url}?id=${id}&method=${method}&params=${params_base64enc_urlenc}"
54+
55+
echo >>$log
56+
echo "executing: $get" >>$log
57+
58+
result=$(curl -S -k "$get")
59+
60+
echo >>$log
61+
echo "result: $result" >>$log
62+
63+
if [[ $result =~ '"result":' ]]
64+
then
65+
exit 0
66+
else
67+
exit 1
68+
fi
69+

0 commit comments

Comments
 (0)