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
f4a706b7
Commit
f4a706b7
authored
Jan 12, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add --get-filesize option and url_get_size() function
parent
63f72b9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
eget
eget
+20
-0
No files found.
eget
View file @
f4a706b7
...
@@ -370,6 +370,7 @@ GETRESPONSE=''
...
@@ -370,6 +370,7 @@ GETRESPONSE=''
GETFILENAME
=
''
GETFILENAME
=
''
GETREALURL
=
''
GETREALURL
=
''
GETIPFSCID
=
''
GETIPFSCID
=
''
GETFILESIZE
=
''
LATEST
=
''
LATEST
=
''
SECONDLATEST
=
''
SECONDLATEST
=
''
CHECKMIRRORS
=
''
CHECKMIRRORS
=
''
...
@@ -446,6 +447,7 @@ Options:
...
@@ -446,6 +447,7 @@ Options:
--check-site URL - check if the site is accessible (returns HTTP 200 OK or 404 Not found)
--check-site URL - check if the site is accessible (returns HTTP 200 OK or 404 Not found)
--get-response URL - get response with all headers (ever if HEAD is not acceptable)
--get-response URL - get response with all headers (ever if HEAD is not acceptable)
--get-filename URL - print filename for the URL (via Content-Disposition if applicable)
--get-filename URL - print filename for the URL (via Content-Disposition if applicable)
--get-filesize URL - print file size in bytes (via Content-Length)
--get-real-url URL - print URL after all redirects
--get-real-url URL - print URL after all redirects
--get-ipfs-cid URL - print CID for URL (after all redirects)
--get-ipfs-cid URL - print CID for URL (after all redirects)
...
@@ -570,6 +572,9 @@ while [ -n "$1" ] ; do
...
@@ -570,6 +572,9 @@ while [ -n "$1" ] ; do
--get-ipfs-cid
)
--get-ipfs-cid
)
GETIPFSCID
=
"
$1
"
GETIPFSCID
=
"
$1
"
;;
;;
--get-filesize
)
GETFILESIZE
=
"
$1
"
;;
--latest
)
--latest
)
LATEST
=
"
$1
"
LATEST
=
"
$1
"
;;
;;
...
@@ -1734,6 +1739,11 @@ url_get_header()
...
@@ -1734,6 +1739,11 @@ url_get_header()
url_get_headers
"
$URL
"
|
grep
-
i
"^ *
$HEADER
: "
|
sed
-
e
"s|^ *
$HEADER
: ||i"
url_get_headers
"
$URL
"
|
grep
-
i
"^ *
$HEADER
: "
|
sed
-
e
"s|^ *
$HEADER
: ||i"
}
}
url_get_size
()
{
url_get_header
"
$1
"
"Content-Length"
|
tr
-
d
'\r'
}
url_get_raw_real_url
()
url_get_raw_real_url
()
{
{
local
URL
=
"
$1
"
local
URL
=
"
$1
"
...
@@ -1878,6 +1888,11 @@ sget()
...
@@ -1878,6 +1888,11 @@ sget()
exit
exit
fi
fi
if
[
-
n
"
$GETFILESIZE
"
]
;
then
url_get_size
"
$URL
"
exit
fi
local
REALURL
=
"
$(
get_real_url
"
$URL
"
)
"
||
return
local
REALURL
=
"
$(
get_real_url
"
$URL
"
)
"
||
return
if
[
-
n
"
$GETREALURL
"
]
;
then
if
[
-
n
"
$GETREALURL
"
]
;
then
...
@@ -2032,6 +2047,11 @@ sget()
...
@@ -2032,6 +2047,11 @@ sget()
exit
exit
fi
fi
if
[
-
n
"
$GETFILESIZE
"
]
;
then
url_get_size
"
$URL
"
exit
fi
if
[
-
n
"
$GETREALURL
"
]
;
then
if
[
-
n
"
$GETREALURL
"
]
;
then
get_real_url
"
$URL
"
get_real_url
"
$URL
"
exit
exit
...
...
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