Hello, maybe this script can be useful to someone. Requests downloads.dpi to download a URL to a file. He talks to dpid like dillo does. I think it's also a useful coding exercise. I'm bad at naming so if someone has a better name ^_^¡ Best, Diego!
Hi Diego, On Wed, 4 Sep 2024 18:17:42 +0200 Diego <darkspirit5000@gmail.com> wrote:
Hello, maybe this script can be useful to someone.
Requests downloads.dpi to download a URL to a file. He talks to dpid like dillo does.
I think it's also a useful coding exercise.
Nice, looks like a fun experiment! I think it's neat to be able to interact with dpid outside of Dillo, and possibly could aid in troubleshooting dpi development issues in future. The script seems to work fine, except the filename in the download window just shows '??'. Do you get that as well? Regards, Alex
I see same when do use filename without a path. I think download.dpi needs a filename with one path-segment or more. Send script v0.2 with a workarround (prefix "./" if there is not a "/" in filename) Best, Diego! El jue, 5 sept 2024 a las 15:17, <a1ex@dismail.de> escribió:
Hi Diego,
On Wed, 4 Sep 2024 18:17:42 +0200 Diego <darkspirit5000@gmail.com> wrote:
Hello, maybe this script can be useful to someone.
Requests downloads.dpi to download a URL to a file. He talks to dpid like dillo does.
I think it's also a useful coding exercise.
Nice, looks like a fun experiment! I think it's neat to be able to interact with dpid outside of Dillo, and possibly could aid in troubleshooting dpi development issues in future.
The script seems to work fine, except the filename in the download window just shows '??'. Do you get that as well?
Regards, Alex
_______________________________________________ Dillo-dev mailing list -- dillo-dev@mailman3.com To unsubscribe send an email to dillo-dev-leave@mailman3.com
On Fri, 6 Sep 2024 00:06:41 +0200 Diego <darkspirit5000@gmail.com> wrote:
I see same when do use filename without a path. I think download.dpi needs a filename with one path-segment or more.
Send script v0.2 with a workarround (prefix "./" if there is not a "/" in filename)
That works. It might be nice to set a default download location, and also automatically get the filename from the url with basename. Also, if you want to make this portable so it works on other shells than just bash, you can do something like this to get the port number: echo $a | cut -f4- -d"'" | rev | cut -c 5- | rev There are probably other ways to do it using sed, etc. I attached a quick and probably incomplete example which incorporates these ideas :) Regards, Alex
Also, if you want to make this portable so it works on other shells than just bash, you can do something like this to get the port number:
echo $a | cut -f4- -d"'" | rev | cut -c 5- | rev
There are probably other ways to do it using sed, etc.
Here is a sed equivalent, which might be a more conventional approach: $ echo $a <cmd='send_data' msg='12345' '> $ echo $a | sed "s/^.*msg=[']\([^']*\)['].*$/\1/" 12345 -Alex
participants (2)
-
a1ex@dismail.de
-
Diego