Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lbry
ytsync
Commits
9d65fce6
Commit
9d65fce6
authored
Jul 25, 2019
by
ci
Browse files
do not apply limits if disabled
parent
d5ed4ce7
Changes
1
Hide whitespace changes
Inline
Side-by-side
sources/youtubeVideo.go
View file @
9d65fce6
...
...
@@ -199,10 +199,6 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
qualityIndex
:=
0
ytdlArgs
:=
[]
string
{
"--no-progress"
,
"--max-filesize"
,
fmt
.
Sprintf
(
"%dM"
,
v
.
maxVideoSize
),
"--match-filter"
,
fmt
.
Sprintf
(
"duration <= %d"
,
int
(
math
.
Round
(
v
.
maxVideoLength
*
3600
))),
"-o"
+
strings
.
TrimSuffix
(
v
.
getFullPath
(),
".mp4"
),
"--merge-output-format"
,
"mp4"
,
...
...
@@ -212,6 +208,18 @@ func (v *YoutubeVideo) download(useIPv6 bool) error {
"--fragment-retries"
,
"0"
,
}
if
v
.
maxVideoSize
>
0
{
ytdlArgs
=
append
(
ytdlArgs
,
"--max-filesize"
,
fmt
.
Sprintf
(
"%dM"
,
v
.
maxVideoSize
),
)
}
if
v
.
maxVideoLength
>
0
{
ytdlArgs
=
append
(
ytdlArgs
,
"--match-filter"
,
fmt
.
Sprintf
(
"duration <= %d"
,
int
(
math
.
Round
(
v
.
maxVideoLength
*
3600
))),
)
}
sourceAddress
,
err
:=
ipManager
.
GetNextIP
(
useIPv6
)
if
err
!=
nil
{
if
sourceAddress
==
"throttled"
{
...
...
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