Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eget
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eget
Commits
317ebab0
Commit
317ebab0
authored
Jan 08, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add --list support for FTP protocol
parent
a03b3ad0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
eget
eget
+16
-18
No files found.
eget
View file @
317ebab0
...
...
@@ -265,6 +265,11 @@ is_httpurl()
echo
"
$1
"
|
grep
-q
"^http://"
&&
return
}
is_ftpurl
()
{
echo
"
$1
"
|
grep
-q
"^ftp://"
}
cid_from_url
()
{
echo
"
$1
"
|
sed
-e
's|^ipfs://*||'
-e
's|\?.*||'
...
...
@@ -1994,16 +1999,18 @@ get_urls()
return
fi
# Hack: Converted markdown support
# https://github.com/dotnet/core/blob/main/release-notes/9.0/preview/rc1/9.0.0-rc.1.md
if
false
&&
echo
"
$URL
"
|
grep
-
q
"
\.
md$"
;
then
scat
"
$URL
"
|
sed
-
e
's|<|<\n|g'
|
grep
"https*"
|
sed
-
e
's|.*\(https*://\)|\1|'
-
e
's|".*||g'
return
fi
local
content
content
=
"
$(
scat
"
$URL
"
)
"
# cat html, divide to lines by tags and cut off hrefs only
scat
"
$URL
"
|
sed
-
e
's|<|<\n|g'
-
e
's|data-file=|href=|g'
-
e
"s|href=http|href=
\"
http|g"
-
e
"s|>|
\"
>|g"
-
e
"s|'|
\"
|g"
|
\
grep
-
i
-
o
-
E
'href="(.+)"'
|
sed
-
e
's|&|\&|'
|
cut
-
d
'"'
-
f2
|
sed
-
e
's|^ *||g'
-
e
's| *$||g'
# Detect format: HTML (contains <) or ls -l (FTP directory listing from curl)
if
echo
"
$content
"
|
grep
-
q
'<'
;
then
# HTML format (wget FTP, HTTP): parse href attributes
echo
"
$content
"
|
sed
-
e
's|<|<\n|g'
-
e
's|data-file=|href=|g'
-
e
"s|href=http|href=
\"
http|g"
-
e
"s|>|
\"
>|g"
-
e
"s|'|
\"
|g"
|
\
grep
-
i
-
o
-
E
'href="(.+)"'
|
sed
-
e
's|&|\&|'
|
cut
-
d
'"'
-
f2
|
sed
-
e
's|^ *||g'
-
e
's| *$||g'
else
# ls -l format (curl FTP): extract last field (filename)
echo
"
$content
"
|
awk
'{print $NF}'
fi
}
# Check that URL is provided (unless using -i|--input-file)
...
...
@@ -2120,15 +2127,6 @@ else
[
-
n
"
$3
"
]
&&
fatal
"too many args: extra '
$3
'. May be you need use quotes for arg with wildcards."
fi
# TODO: curl?
# If ftp protocol, just download
if
echo
"
$URL
"
|
grep
-
q
"^ftp://"
;
then
[
-
n
"
$LISTONLY
"
]
&&
fatal
"TODO: list files for ftp:// is not supported yet"
sget
"
$1
"
"
$TARGETFILE
"
exit
fi
if
[
-
n
"
$LISTONLY
"
]
;
then
for
fn
in
$(
get_urls | filter_glob
"
$MASK
"
| filter_order
)
;
do
is_url
"
$fn
"
&&
echo
"
$fn
"
&&
continue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment