add support for --no-continue
This commit is contained in:
parent
a0533a0861
commit
3ebd66fd60
3 changed files with 23 additions and 5 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -25,6 +25,7 @@
|
||||||
"brainicism",
|
"brainicism",
|
||||||
"brotlicffi",
|
"brotlicffi",
|
||||||
"consoletitle",
|
"consoletitle",
|
||||||
|
"continuedl",
|
||||||
"cookiesfrombrowser",
|
"cookiesfrombrowser",
|
||||||
"copyts",
|
"copyts",
|
||||||
"creationflags",
|
"creationflags",
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,9 @@ class Download:
|
||||||
|
|
||||||
params["logger"] = NestedLogger(self.logger)
|
params["logger"] = NestedLogger(self.logger)
|
||||||
|
|
||||||
|
if "continuedl" in params and params["continuedl"] is False:
|
||||||
|
self.delete_temp(by_pass=True)
|
||||||
|
|
||||||
cls = YTDLP(params=params)
|
cls = YTDLP(params=params)
|
||||||
|
|
||||||
self.started_time = int(time.time())
|
self.started_time = int(time.time())
|
||||||
|
|
@ -435,11 +438,16 @@ class Download:
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def delete_temp(self):
|
def delete_temp(self, by_pass: bool = False):
|
||||||
if self.temp_disabled or self.temp_keep is True or not self.temp_path:
|
if self.temp_disabled or self.temp_keep is True or not self.temp_path:
|
||||||
return
|
return
|
||||||
|
|
||||||
if "finished" != self.info.status and self.info.downloaded_bytes and self.info.downloaded_bytes > 0:
|
if (
|
||||||
|
not by_pass
|
||||||
|
and "finished" != self.info.status
|
||||||
|
and self.info.downloaded_bytes
|
||||||
|
and self.info.downloaded_bytes > 0
|
||||||
|
):
|
||||||
self.logger.warning(
|
self.logger.warning(
|
||||||
f"Keeping temp folder '{self.temp_path}', as the reported status is not finished '{self.info.status}'."
|
f"Keeping temp folder '{self.temp_path}', as the reported status is not finished '{self.info.status}'."
|
||||||
)
|
)
|
||||||
|
|
@ -457,7 +465,11 @@ class Download:
|
||||||
return
|
return
|
||||||
|
|
||||||
status = delete_dir(tmp_dir)
|
status = delete_dir(tmp_dir)
|
||||||
self.logger.info(f"Temp folder '{self.temp_path}' deletion is {'success' if status else 'failed'}.")
|
if by_pass:
|
||||||
|
tmp_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
self.logger.info(f"Temp folder '{self.temp_path}' emptied.")
|
||||||
|
else:
|
||||||
|
self.logger.info(f"Temp folder '{self.temp_path}' deletion is {'success' if status else 'failed'}.")
|
||||||
|
|
||||||
async def progress_update(self):
|
async def progress_update(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -127,8 +127,8 @@
|
||||||
<span>
|
<span>
|
||||||
<NuxtLink @click="showOptions = true" v-text="'View all options'" />. Not all options are supported
|
<NuxtLink @click="showOptions = true" v-text="'View all options'" />. Not all options are supported
|
||||||
<NuxtLink target="_blank"
|
<NuxtLink target="_blank"
|
||||||
to="https://github.com/arabcoders/ytptube/blob/master/app/library/Utils.py#L26">some are
|
to="https://github.com/arabcoders/ytptube/blob/master/app/library/Utils.py#L26">some
|
||||||
ignored</NuxtLink>. Use with caution.
|
are ignored</NuxtLink>. Use with caution.
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -313,6 +313,11 @@ const addDownload = async () => {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const keyRegex = new RegExp(`(^|\s)${key}(\s|$)`);
|
||||||
|
if (form_cli && keyRegex.test(form_cli)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
joined.push(true === value ? `${key}` : `${key} ${value}`)
|
joined.push(true === value ? `${key}` : `${key} ${value}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue